0

I'm using PIG to store table data into hive database using HCatalog. I was able to load and dump the data in PIG grunt shell but when i'm trying to store the loaded data into HIVE table which i created as myweather.weathertable1 (myweather-database name ,weathertable1 -table name1) using the below command

STORE A INTO 'myweather.weathertable1' USING org.apache.hcatalog.pig.HCatStorer();

I'm encountering the following error :

2015-07-11 20:20:09,056 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Details at logfile: /X/Y/pig_1436660283762.log

And the log file says:

ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Failed to parse: Pig script failed to parse:
<line 4, column 45> pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
        at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:196)
        at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1660)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1633)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:587)
        at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:1093)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:501)
        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.run(Grunt.java:69)
        at org.apache.pig.Main.run(Main.java:541)
        at org.apache.pig.Main.main(Main.java:156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

Any help fixing the above issue could be highly appreciable. Thanks in advance.

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
bigdata123
  • 453
  • 2
  • 8
  • 24
  • possible duplicate of [Getting an error on running HCatalog](http://stackoverflow.com/questions/31295980/getting-an-error-on-running-hcatalog) – kira_codes Jul 15 '15 at 14:16

1 Answers1

0

Please try to start pig with -useHCatalog option. It will load the necessary jars. Please see HCat docs

Frederic
  • 3,274
  • 1
  • 21
  • 37
  • 1
    @Fred thanks for your reply .I had used pig -useHCatalog before posting this queston. I finally fixed the issue by replacing org.apache.hcatalog.pig.HCatStorer() with org.apache.hive.hcatalog.pig.HCatStorer() . Sadly ,Apache hive documentation has not updated this error yet (https://cwiki.apache.org/confluence/display/Hive/HCatalog+LoadStore#HCatalogLoadStore-The-useHCatalogFlag). – bigdata123 Aug 01 '15 at 23:48