Reply
Champion Alumni
Posts: 162
Registered: ‎02-11-2014
Accepted Solution

Using Pig to Load data from avro backed hive table

[ Edited ]

Hello,

I am trying to load data from from avro backed hive table in  a pig script using the below command 

A = LOAD 'dev.avro_test' USING  org.apache.hive.hcatalog.pig.HCatLoader();

We are running into the below error.Request to give some direction.We are using CDH 5.5.1.

 

2016-02-12 19:21:26,515 [main] ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. Type void not present
Failed to parse: Type void not present
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:198)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1688)
at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1421)
at org.apache.pig.PigServer.parseAndBuild(PigServer.java:354)
at org.apache.pig.PigServer.executeBatch(PigServer.java:379)
at org.apache.pig.PigServer.executeBatch(PigServer.java:365)
at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:140)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:769)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:484)
at org.apache.pig.Main.main(Main.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.TypeNotPresentException: Type void not present
at org.apache.hive.hcatalog.data.schema.HCatFieldSchema$Type.getPrimitiveHType(HCatFieldSchema.java:92)
at org.apache.hive.hcatalog.data.schema.HCatFieldSchema.<init>(HCatFieldSchema.java:226)
at org.apache.hive.hcatalog.data.schema.HCatSchemaUtils.getHCatFieldSchema(HCatSchemaUtils.java:122)
at org.apache.hive.hcatalog.data.schema.HCatSchemaUtils.getHCatFieldSchema(HCatSchemaUtils.java:115)
at org.apache.hive.hcatalog.common.HCatUtil.getHCatFieldSchemaList(HCatUtil.java:151)
at org.apache.hive.hcatalog.common.HCatUtil.getTableSchemaWithPtnCols(HCatUtil.java:184)
at org.apache.hive.hcatalog.pig.HCatLoader.getSchema(HCatLoader.java:216)
at org.apache.pig.newplan.logical.relational.LOLoad.getSchemaFromMetaData(LOLoad.java:175)
at org.apache.pig.newplan.logical.relational.LOLoad.<init>(LOLoad.java:89)
at org.apache.pig.parser.LogicalPlanBuilder.buildLoadOp(LogicalPlanBuilder.java:853)
at org.apache.pig.parser.LogicalPlanGenerator.load_clause(LogicalPlanGenerator.java:3568)
at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1625)
at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:1102)
at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:560)
at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:421)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:188)
... 19 more
2016-02-12 19:21:26,518 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Type void not present

Posts: 1,903
Kudos: 435
Solutions: 307
Registered: ‎07-31-2013

Re: Using Pig to Load data from avro backed hive table

What's the DESCRIBE output of your avro_test table? If it includes a VOID column type, HCatalog currently does not support that.
Champion Alumni
Posts: 162
Registered: ‎02-11-2014

Re: Using Pig to Load data from avro backed hive table

Thanks Harsh. Yes my key  was  a void .So I changed the avro output  to use keyOutputformat (earlier value is now the key) from Avrokeyvalueoutputformat and it worked.

 

Thanks,

Nishanth