Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> reg : reteriveing a single column from hive serde table


Copy link to this message
-
Re: reg : reteriveing a single column from hive serde table
Mohit,
There is nothing wrong with the query. It seems (from the line below)
that you are using a custom SerDe:
org.apache.hadoop.hive.contrib.serde2.XmlInputFormat$XmlRecordReader.<init>(XmlInputFormat.java:76)

That seems to the causing the problem. You'd need to look into the
input format's code to see what's going on.

Mark

On Mon, Dec 17, 2012 at 2:19 AM, Mohit Chaudhary01
<[EMAIL PROTECTED]> wrote:
>
> I am using serde in hive to store data into hive table from xml file.
>
> Whenever I retrieve data using command select * from table it give all records  from table.
>
>
>
> But when I want to extract an individual column it gives error .
>
> Please Tell me how can I retrieve a single column from this table.
>
>
>
> This is the error when I try to extract a single column from hive serde table .
>
>
>
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>
>         at org.apache.hadoop.hive.shims.Hadoop20SShims$CombineFileRecordReader.initNextRecordReader(Hadoop20SShims.java:306)
>
>         at org.apache.hadoop.hive.shims.Hadoop20SShims$CombineFileRecordReader.<init>(Hadoop20SShims.java:269)
>
>         at org.apache.hadoop.hive.shims.Hadoop20SShims$CombineFileInputFormatShim.getRecordReader(Hadoop20SShims.java:366)
>
>         at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getRecordReader(CombineHiveInputFormat.java:413)
>
>         at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:371)
>
>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:325)
>
>         at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
>
>         at java.security.AccessController.doPrivileged(Native Method)
>
>         at javax.security.auth.Subject.doAs(Subject.java:396)
>
>         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1127)
>
>         at org.apache.hadoop.mapred.Child.main(Child.java:264)
>
> Caused by: java.lang.reflect.InvocationTargetException
>
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>
>         at org.apache.hadoop.hive.shims.Hadoop20SShims$CombineFileRecordReader.initNextRecordReader(Hadoop20SShims.java:292)
>
>         ... 10 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.apache.hadoop.hive.contrib.serde2.XmlInputFormat$XmlRecordReader.<init>(XmlInputFormat.java:76)
>
>         at org.apache.hadoop.hive.contrib.serde2.XmlInputFormat.getRecordReader(XmlInputFormat.java:44)
>
>         at org.apache.hadoop.hive.ql.io.CombineHiveRecordReader.<init>(CombineHiveRecordReader.java:68)
>
>         ... 15 more
>
>
>
>
>
> From: Nitin Pawar [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 17, 2012 1:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: reg : reteriveing a single column from hive serde table
>
>
>
> select * will just hdfs cat your file
>
>
>
> when you are using serde, do you have column separator in place? if not can you do select * from table limit 1
>
>
>
> to get normally a single coulmn you should do select column from table where column=value
>
>
>
> On Mon, Dec 17, 2012 at 1:51 PM, Mohit Chaudhary01 <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I am using serde in hive to store data into hive table from xml file.
>
> Whenever I retrieve data using command select * from table it give all records  from table.
>
>
>
> But when I want to extract an individual column it gives error .
>
> Please Tell me how can I retrieve a single column from this table.
>
>
>
> Thanks
>
> Mohit chaudhary
>
> **************** CAUTION - Disclaimer *****************
>
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
>
> for the use of the addressee(s). If you are not the intended recipient, please
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB