venkatsambath / hive-json-serde

Automatically exported from code.google.com/p/hive-json-serde
0 stars 0 forks source link

Add a SerDe property to use a different name for the Hive column name and the JSON key name. #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Add a SerDe property to use a different name for the Hive column name and the 
JSON key name.

This helps in case you have a data stream with columns named the same as Hive 
reserved words (eg 'timestamp' and 'bucket').

Patch attached. Use like so:

CREATE TABLE foo (
 ts double,
 bckt string,
 event string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
WITH SERDEPROPERTIES ('rename_columns'='timestamp>ts,bucket>bckt');

Original issue reported on code.google.com by nick.mar...@gmail.com on 14 Jan 2011 at 11:48

Attachments:

GoogleCodeExporter commented 8 years ago
is this change done?

Original comment by chandan....@gmail.com on 10 Dec 2012 at 9:42