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:nitinpawar...@gmail.com] Sent: Monday, December 17, 2012 1:54 PM To: user@hive.apache.org 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 <mohit_chaudhar...@infosys.com<mailto:mohit_chaudhar...@infosys.com>> 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 notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** -- Nitin Pawar