Skip to content

Commit 9986597

Browse files
committed
address comments
1 parent fe41fa6 commit 9986597

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,13 @@ private Object extract(Object json, String path, boolean skipMapProc) {
239239
indexListCache.put(path, indexList);
240240
}
241241

242-
if (indexList.isEmpty()) {
243-
// Return null if index is invalid.
244-
return path.contains("[") ? null : json;
242+
if (indexList.size() > 0) {
243+
json = extract_json_withindex(json, indexList);
244+
} else if (path.indexOf('[') >= 0) {
245+
return null; // index is invalid
245246
}
246247

247-
return extract_json_withindex(json, indexList);
248+
return json;
248249
}
249250

250251
private transient AddingList jsonList = new AddingList();

0 commit comments

Comments
 (0)