Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rcongiu/Hive-JSON-Serde
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Congiu committed Aug 21, 2012
2 parents 740cb29 + 2503566 commit 89101b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Versions:
1.0: initial release
1.1: fixed some string issues
1.1.1 (2012/07/03): fixed Map Adapter (get and put would call themselves...ooops)
1.1.2 (2012/07/26): Fixed issue with columns that are not mapped into JSON, reported by Michael Phung



2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.openx.data</groupId>
<artifactId>json-serde</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>jar</packaging>

<name>openx-json-serde</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public Object getStructFieldData(Object data, StructField fieldRef) {
assert (fieldID >= 0 && fieldID < fields.size());

try {
return obj.get(f.getFieldName());
if(obj.has(f.getFieldName()))
return obj.get(f.getFieldName());
else
return null;
} catch (JSONException ex) {
// if key does not exist
return null;
Expand All @@ -59,7 +62,10 @@ public List<Object> getStructFieldsDataAsList(Object o) {

for (int i = 0; i < fields.size(); i++) {
try {
values.add(jObj.get(fields.get(i).getFieldName()));
if (jObj.has(fields.get(i).getFieldName()))
values.add(jObj.get(fields.get(i).getFieldName()));
else
values.add(null);
} catch (JSONException ex) {
// we're iterating through the keys so
// this should never happen
Expand Down

0 comments on commit 89101b7

Please sign in to comment.