Created 05-10-2016 08:50 AM
1) I had extracted data from xml .
2) I am getting the data correctly as below
hive> select * from xml_table;
OK
1 Satish Kumar Technical Lead
2 Ramya Testing
3)
hive> describe xml_table;
OK
_c0 int
_c1 string
_c2 string
issue : .. When I try to access only _c0 column , I am getting error as below
hive> select _c0,_c1 from xml_table;
FAILED: ParseException line 1:10 missing \' at ',' near '<EOF>' line
1:15 missing \' at 'from' near '<EOF>'
Created 05-10-2016 08:58 AM
Created 05-10-2016 08:58 AM
Try
select `_c0` from xml_table
Created 05-10-2016 09:05 AM
I tried @Bernhard Walter : But I am not getting values
hive> select '_c0' from xml_table;
Total jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_1461307169071_0063, Tracking URL = http://CDCUDHDOOPAPP02:8088/proxy/application_1461307169071_0063/ Kill Command = /chroot/hadoop/inst/hadoop/hadoop-2.4.0/bin/hadoop job -kill job_1461307169071_0063 Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0 2016-05-10 14:33:40,593 Stage-1 map = 0%, reduce = 0% 2016-05-10 14:33:45,811 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 0.96 sec MapReduce Total cumulative CPU time: 960 msec Ended Job = job_1461307169071_0063 MapReduce Jobs Launched: Job 0: Map: 1 Cumulative CPU: 0.96 sec HDFS Read: 265 HDFS Write: 8 SUCCESS Total MapReduce CPU Time Spent: 960 msec
OK
_c0
_c0
Time taken: 17.912 seconds, Fetched: 2 row(s)
Created 05-10-2016 09:07 AM
Use backticks ` and not '
Created 05-10-2016 09:09 AM
For quoting identifiers see, e.g. https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_dataintegration/content/hive-013-feature...
Created 05-10-2016 09:30 AM
Great !! @Bernhard Walter . Thanks for your help.