hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramasubramanian Narayanan <ramasubramanian.naraya...@gmail.com>
Subject How to overwrite Key in RecordReader function
Date Thu, 12 Jun 2014 08:47:20 GMT
DA,

We are trying to write a UDF to read an XML which contains some unbounded
tags.

For repeated tags, new row has to be generated.

Please let us know how to ovewrite the default key with the new key in the
Record Reader function (where we do for loop to make multiple rows).

*Sample XML:*
<students>
<student>
  <name> ABC </name>
  <Addresses>
    <Address> address1 </Address>
    <Address> address2 </Address>
  </Addresses>
</student>
</students>

*Expected Output* (using custom input format in HIVE table and quering
through a view using xpath).

ABC | address1|
ABC | address2

Thanks and Regards,
Rams

Mime
View raw message