- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Alter external hive table fails
- Labels:
-
Apache Hive
Created 09-15-2017 03:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alter table on the following external table fails:
CREATE EXTERNAL TABLE IF NOT EXISTS MODULES_1 ( `ModuleID` string ,
`ModuleName` string , `ContractType` string )
PARTITIONED BY ( meta_version string, year string, month string, day string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe'
WITH SERDEPROPERTIES ( "field.delim"="\t")
LOCATION '/tst/raw/comarch/modules/1'tblproperties("skip.header.line.count"="3");
When I try to modify this table using below:
Alter table MODULES_1 ADD COLUMNS(`OperationType` string)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Error: type expected at the position 0 of '<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:string' but '<' is found.
I tried it with partition specifications:
Alter table MODULES_1 PARTITIONS(meta_version,`year`,`month`,`day`) ADD COLUMNS(`OperationType` string)
that also fails.
Please suggest a workwround
Created 09-15-2017 04:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It should work actually. Try removing the '`' and execute it. Orelse the other way is to drop the table and re-create it. As it an external table it wont affect the data. Hope it helps!!