rcongiu / Hive-JSON-Serde

Read - Write JSON SerDe for Apache Hive.
Other
733 stars 393 forks source link

DDL Error with hive 2.3.0 #214

Open lfyzjck opened 5 years ago

lfyzjck commented 5 years ago

Hive-JSON-Serde version: 1.3.8

alter table json_table add columns (new_col string) cascade

When i run this SQL in Hive version: 2.3.4, i got error below:

INFO  : Compiling command(queryId=hive_20190426152631_a2605cdd-553b-4181-aa38-3620d0772d65): alter table json_table add columns (new_col string) cascade
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20190426152631_a2605cdd-553b-4181-aa38-3620d0772d65); Time taken: 0.774 seconds
INFO  : Executing command(queryId=hive_20190426152631_a2605cdd-553b-4181-aa38-3620d0772d65): alter table json_table add columns (new_col string) cascade
INFO  : Starting task [Stage-0:DDL] in serial mode
ERROR : 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>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:string' but '<' is found.
INFO  : Completed executing command(queryId=hive_20190426152631_a2605cdd-553b-4181-aa38-3620d0772d65); Time taken: 0.008 secondsError: org.apache.hive.service.cli.HiveSQLException: Error while processing statement: 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>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:string' but '<' is found. 
at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:380) 
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257) 
at org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91) 
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348) 
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422) 
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) 
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:362) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Error: type expected at the position 0 of '<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:<derived from deserializer>:string' but '<' is found. 
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.expect(TypeInfoUtils.java:372) 
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.expect(TypeInfoUtils.java:355) 
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.parseType(TypeInfoUtils.java:416) 
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.parseTypeInfos(TypeInfoUtils.java:329) 
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils.getTypeInfosFromTypeString(TypeInfoUtils.java:814) at org.openx.data.jsonserde.JsonSerDe.initialize(JsonSerDe.java:120) 
at org.apache.hadoop.hive.serde2.AbstractSerDe.initialize(AbstractSerDe.java:54) 
at org.apache.hadoop.hive.serde2.SerDeUtils.initializeSerDe(SerDeUtils.java:533) 
at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(MetaStoreUtils.java:449) 
at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(MetaStoreUtils.java:436) 
at org.apache.hadoop.hive.ql.metadata.Table.getDeserializerFromMetaStore(Table.java:281) 
at org.apache.hadoop.hive.ql.metadata.Table.checkValidity(Table.java:199) 
at org.apache.hadoop.hive.ql.exec.DDLTask.alterTable(DDLTask.java:3581)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:390) 
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199) 
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) 
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183) 
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839) 
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237) 
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232) 
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255) ... 
11 more (state=08S01,code=1)
rcongiu commented 4 years ago

Do you have the table definition ?