Permalink
Browse files

Merge pull request #3 from jarcec/master

Lower case JSON keys
  • Loading branch information...
2 parents 27074c8 + 7580ab8 commit 65bbc1915fa862dfe99340f02d700501cdda2d48 @joey joey committed Mar 23, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 hive-serdes/src/main/java/com/cloudera/hive/serde/JSONSerDe.java
@@ -127,6 +127,13 @@ public Object deserialize(Writable blob) throws SerDeException {
} catch (Exception e) {
throw new SerDeException(e);
}
+
+ // Lowercase the keys as expected by hive
+ Map<String, Object> lowerRoot = new HashMap();
+ for(Map.Entry entry: root.entrySet()) {
+ lowerRoot.put(((String)entry.getKey()).toLowerCase(), entry.getValue());
+ }
+ root = lowerRoot;
Object value= null;
for (String fieldName : rowTypeInfo.getAllStructFieldNames()) {

0 comments on commit 65bbc19

Please sign in to comment.