hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harish tangella <harish.tange...@gmail.com>
Subject Re: Loading xml to hive and fetching unbounded tags
Date Fri, 13 Jun 2014 11:33:52 GMT
Hi,

We are trying to get the data in the form of rows not in columns ..We are
able to get partial data by implementing RecordReader. Logic we have
applied is - getting the xml with start and end tag as 'Row' as the result
we get only the second row, expected is 2 rows....

Refering to below xml , Expected result is :

 <Row><APPLICATION_ID>1</APPLICATION_ID><AppDetails><AppDetail>
<APPLICATION_CODE>1</APPLICATION_CODE></AppDetail></AppDetails></Row>

<Row><APPLICATION_ID>1</APPLICATION_ID><AppDetails>
<AppDetail><APPLICATION_CODE>2</APPLICATION_CODE></AppDetail></AppDetails>
</Row>

In case if we use Xpath.. we get the data in the column wise , when we do
select  APPLICATION_ID,APPLICATION_CODE from the table , we get 1,["1","2"]









On Fri, Jun 13, 2014 at 4:01 PM, Knowledge gatherer <
knowledge.gatherer.007@gmail.com> wrote:

>  Are you trying to capture this data in one column and use XPATH with UDF
> to get the data.
>
>
> On Wed, Jun 11, 2014 at 11:12 AM, harish tangella <
> harish.tangella@gmail.com> wrote:
>
>> Hi,
>>
>>   Request you to help.
>>
>>   Fetching unbounded tags from the xml in hive
>>
>>  We tried with xpath but unable to get all the unbounded tags.
>>
>> a sample xml file is
>>
>> <Rows>
>> <Row>
>> <APPLICATION_ID>1</APPLICATION_ID>
>> <AppDetails>
>> <AppDetail>
>> <APPLICATION_CODE>1</APPLICATION_CODE>
>> </AppDetail>
>> <AppDetail>
>> <APPLICATION_CODE>2</APPLICATION_CODE>
>> </AppDetail>
>> </AppDetails>
>> </Row>
>> </Rows>
>>
>> we are able to get the application code by giving [1] in appdetail.
>> Request for help to get all the appdetail tags.
>>
>
>

Mime
View raw message