How to create HIVE table from XML file , with only few specific fields?? For example I have a XML file of 1000 fields but I need only 100 fields in my HIVE table. And apart from that. How do I store the 100 fields in different databases and different tables?
Asked
Active
Viewed 297 times
1 Answers
0
The usual method is to run XLST transformations on your XML file and produce 1 to N csv files that can you store on HDFS, then expose data through HIVE external tables, or load to ORC/Parquet tables in a second stage.

Harold
- 455
- 4
- 10
-
Is there anyway I can expose directly to HIVE , without performing XLST transformations? – Harish Apr 18 '18 at 20:07
-
yes, using HIVE xpath; See https://stackoverflow.com/questions/15375031/exploding-a-row-of-xml-data-in-hive – Harold Apr 19 '18 at 08:13
-
Thanks Harold. I think that helps – Harish Apr 19 '18 at 13:07