cloudera / cdh-twitter-example

Example application for analyzing Twitter data using CDH - Flume, Oozie, Hive
288 stars 343 forks source link

Lower case JSON keys #3

Closed jarcec closed 11 years ago

jarcec commented 11 years ago

HIVE seems to be internally lower casing all columns names even though when they are properly escaped during table creation:

hive> create table xxxx(DeviceID string); OK Time taken: 0.229 seconds hive> describe xxxx; OK deviceid string Time taken: 0.128 seconds

I'm attaching simple patch that will automatically lowercase all keys in the input JSON, so that the SerDe will work on keys that are not lower cased. SerDe with this patch might behave unpredictable if the input JSON have multiple columns that have same lower cased form (for example "DevideId" and "deviceId").