incubator-hcatalog-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Gates <ga...@hortonworks.com>
Subject Re: Accesing Views created in Hive using HCatLoader in Pig
Date Tue, 05 Mar 2013 16:16:43 GMT
HCatLoader does not support reading views in Hive.  The issue is that a view is defined as
a query on a table (create view V as select x, y from t).  Pig doesn't speak SQL, and HCat
doesn't contain Hive's execution engine so it cannot execute the query either.  Reading Hive
views from Pig and MR will require much tighter integration of the products than we currently
have.

Alan.

On Mar 4, 2013, at 4:36 PM, atul aggarwal wrote:

> Hi,
> I am fairly new to HCatlog, and hence I was just trying something in hive and HcatLoader
in Pig. What I did is, created a view in Hive and then tried to load data by view I created
into pig using HcatLoader. But it seems it is not  working. I just wanted to confirm that
is there any way to do this? I am getting following error when I tried to load view in pig
using HcatLoader
> 
> events=Load 'ViewName' using org.apache.hcatalog.pig.HCatLoader(); dump events;
> 
> When I use any tableName instead of View from Hive, it seems to work. Further it does
not give metastore error. As it says successfully connected to metastore at load statement
when it comes to dump, it crashes with the following error.
> 
> Any Pointers will be helpful.
> 
> Thanks, Atul
> 
> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator
for alias events
> at org.apache.pig.PigServer.openIterator(PigServer.java:857)
> at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:682)
> at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303)
> at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189)
> at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165)
> at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
> at org.apache.pig.Main.run(Main.java:555)
> at org.apache.pig.Main.main(Main.java:111)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> Caused by: org.apache.pig.PigException: ERROR 1002: Unable to store alias events
> at org.apache.pig.PigServer.storeEx(PigServer.java:956)
> at org.apache.pig.PigServer.store(PigServer.java:919)
> at org.apache.pig.PigServer.openIterator(PigServer.java:832)
> ... 12 more
> Caused by: org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException:
ERROR 2017: Internal error creating job configuration.
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:731)
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:259)
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:180)
> at org.apache.pig.PigServer.launchPlan(PigServer.java:1270)
> at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1255)
> at org.apache.pig.PigServer.storeEx(PigServer.java:952)
> 
> 


Mime
View raw message