Hi Carl
Thanks for guidance.

I have loaded the xml file in this way. First I create a table with single
column like this

*create table test (xmlFile String);*

Then I load complete xml in this table using this script

*LOAD DATA LOCAL INPATH '1.xml'
OVERWRITE INTO TABLE test;*

Now this table have one row having all xml file in it. So in this way, I
have loaded xml in hdfs. Kindly correct me if i have done anything wrong??


Thanks



On Thu, Jun 10, 2010 at 11:30 PM, Carl Steinbach <c...@cloudera.com> wrote:

> Hi Shuja,
>
> If you have already loaded the XML data into Hive you can extract
> individual fields using the XPath UDFs described here:
> http://wiki.apache.org/hadoop/Hive/LanguageManual/XPathUDF
>
> One thing to keep in mind is that you want to avoid having lots of small
> files. If you have one XML document per file and each file is relatively
> small, you should probably try concatenating the files together before
> ingesting them into Hive. You can separate each XML document in the file
> with a control character and then reference this character as the row
> terminator when defining the Hive table.
>
> Hope this helps.
>
> Carl
>
>
> On Thu, Jun 10, 2010 at 1:38 PM, Shuja Rehman <shujamug...@gmail.com>wrote:
>
>> Hi All
>> I want to load data from xml file to hive tables. Any suggestion how can I
>> achieve this??
>>
>> --
>> Regards
>> Shuja-ur-Rehman Baig
>> _________________________________
>> MS CS - School of Science and Engineering
>> Lahore University of Management Sciences (LUMS)
>> Sector U, DHA, Lahore, 54792, Pakistan
>> Cell: +92 3214207445
>>
>
>


-- 
Regards
Shuja-ur-Rehman Baig
_________________________________
MS CS - School of Science and Engineering
Lahore University of Management Sciences (LUMS)
Sector U, DHA, Lahore, 54792, Pakistan
Cell: +92 3214207445

Reply via email to