Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HIVE-3840 : hive cli null representation in output is inconsistent (T…

…hejas Nair via Ashutosh Chauhan)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1465261 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit ba34b9927735d5364de106a38b02aa24de10608f 1 parent 0010fbd
@ashutoshc ashutoshc authored
View
10 ql/src/test/results/clientpositive/avro_nullable_fields.q.out
@@ -171,10 +171,10 @@ string 42 3 100 NULL true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42
string 42 3 100 1412341 NULL 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
string 42 3 100 1412341 true NULL 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
string 42 3 100 1412341 true 42.43 NULL ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
-string 42 3 100 1412341 true 42.43 85.23423424 null {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
-string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] null {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
-string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} null BLUE 72 [0,1,2,3,4,5] [50,51,53]
+string 42 3 100 1412341 true 42.43 85.23423424 NULL {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
+string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] NULL {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] [50,51,53]
+string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} NULL BLUE 72 [0,1,2,3,4,5] [50,51,53]
string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} NULL 72 [0,1,2,3,4,5] [50,51,53]
string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE NULL [0,1,2,3,4,5] [50,51,53]
-string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 null [50,51,53]
-string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] null
+string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 NULL [50,51,53]
+string 42 3 100 1412341 true 42.43 85.23423424 ["alpha","beta","gamma"] {"Earth":42,"Bob":31,"Control":86} {"sint":17,"sboolean":true,"sstring":"Abe Linkedin"} BLUE 72 [0,1,2,3,4,5] NULL
View
2  ql/src/test/results/clientpositive/columnarserde_create_shortcut.q.out
@@ -119,7 +119,7 @@ POSTHOOK: Lineage: columnarserde_create_shortcut.e SIMPLE [(src_thrift)src_thrif
[7,14,21] ["70","700","7000"] {"key_7":"value_7"} -1461153973 record_7
[8,16,24] ["80","800","8000"] {"key_8":"value_8"} 1638581578 record_8
[9,18,27] ["90","900","9000"] {"key_9":"value_9"} 336964413 record_9
-null null null 0 NULL
+NULL NULL NULL 0 NULL
PREHOOK: query: SELECT columnarserde_create_shortcut.a[0], columnarserde_create_shortcut.b[0], columnarserde_create_shortcut.c['key2'], columnarserde_create_shortcut.d, columnarserde_create_shortcut.e FROM columnarserde_create_shortcut CLUSTER BY 1
PREHOOK: type: QUERY
PREHOOK: Input: default@columnarserde_create_shortcut
View
2  ql/src/test/results/clientpositive/create_nested_type.q.out
@@ -52,4 +52,4 @@ POSTHOOK: Input: default@table1
a0 ["b00","b01"] [{"c001":"C001","c002":"C002"},{"c011":null,"c012":"C012"}] {"d01":["d011","d012"],"d02":["d021","d022"]}
a1 ["b10"] [{"c001":"C001","c002":"C002"}] {"d01":["d011","d012"],"d02":null}
a2 [] [{"c001":null,"c002":"C002"},{"c011":"C011","c012":"C012"}] {"d01":[null,"d012"],"d02":["d021","d022"]}
-a3 null null null
+a3 NULL NULL NULL
View
2  ql/src/test/results/clientpositive/input17.q.out
@@ -126,7 +126,7 @@ POSTHOOK: Input: default@dest1
#### A masked pattern was here ####
POSTHOOK: Lineage: dest1.key SCRIPT [(src_thrift)src_thrift.FieldSchema(name:aint, type:int, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lint, type:array<int>, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lintstring, type:array<struct<myint:int,mystring:string,underscore_int:int>>, comment:from deserializer), ]
POSTHOOK: Lineage: dest1.value SCRIPT [(src_thrift)src_thrift.FieldSchema(name:aint, type:int, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lint, type:array<int>, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lintstring, type:array<struct<myint:int,mystring:string,underscore_int:int>>, comment:from deserializer), ]
-NULL null
+NULL NULL
-1461153966 {"myint":49,"mystring":"343","underscore_int":7}
-1952710705 {"myint":25,"mystring":"125","underscore_int":5}
-734328905 {"myint":16,"mystring":"64","underscore_int":4}
View
2  ql/src/test/results/clientpositive/input5.q.out
@@ -126,6 +126,7 @@ POSTHOOK: Input: default@dest1
#### A masked pattern was here ####
POSTHOOK: Lineage: dest1.key SCRIPT [(src_thrift)src_thrift.FieldSchema(name:lint, type:array<int>, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lintstring, type:array<struct<myint:int,mystring:string,underscore_int:int>>, comment:from deserializer), ]
POSTHOOK: Lineage: dest1.value SCRIPT [(src_thrift)src_thrift.FieldSchema(name:lint, type:array<int>, comment:from deserializer), (src_thrift)src_thrift.FieldSchema(name:lintstring, type:array<struct<myint:int,mystring:string,underscore_int:int>>, comment:from deserializer), ]
+NULL NULL
[0,0,0] [{"myint":0,"mystring":"0","underscore_int":0}]
[1,2,3] [{"myint":1,"mystring":"1","underscore_int":1}]
[2,4,6] [{"myint":4,"mystring":"8","underscore_int":2}]
@@ -136,4 +137,3 @@ POSTHOOK: Lineage: dest1.value SCRIPT [(src_thrift)src_thrift.FieldSchema(name:l
[7,14,21] [{"myint":49,"mystring":"343","underscore_int":7}]
[8,16,24] [{"myint":64,"mystring":"512","underscore_int":8}]
[9,18,27] [{"myint":81,"mystring":"729","underscore_int":9}]
-null null
View
2  ql/src/test/results/clientpositive/input_columnarserde.q.out
@@ -129,7 +129,7 @@ POSTHOOK: Lineage: input_columnarserde.e SIMPLE [(src_thrift)src_thrift.FieldSch
[7,14,21] ["70","700","7000"] {"key_7":"value_7"} -1461153973 record_7
[8,16,24] ["80","800","8000"] {"key_8":"value_8"} 1638581578 record_8
[9,18,27] ["90","900","9000"] {"key_9":"value_9"} 336964413 record_9
-null null null 0 NULL
+NULL NULL NULL 0 NULL
PREHOOK: query: SELECT input_columnarserde.a[0], input_columnarserde.b[0], input_columnarserde.c['key2'], input_columnarserde.d, input_columnarserde.e FROM input_columnarserde DISTRIBUTE BY 1
PREHOOK: type: QUERY
PREHOOK: Input: default@input_columnarserde
View
2  ql/src/test/results/clientpositive/input_dynamicserde.q.out
@@ -158,7 +158,7 @@ POSTHOOK: Lineage: dest1.e SIMPLE [(src_thrift)src_thrift.FieldSchema(name:astri
[7,14,21] ["70","700","7000"] {"key_7":"value_7"} -1461153973 record_7
[8,16,24] ["80","800","8000"] {"key_8":"value_8"} 1638581578 record_8
[9,18,27] ["90","900","9000"] {"key_9":"value_9"} 336964413 record_9
-null null null 0 NULL
+NULL NULL NULL 0 NULL
PREHOOK: query: SELECT dest1.a[0], dest1.b[0], dest1.c['key2'], dest1.d, dest1.e FROM dest1
PREHOOK: type: QUERY
PREHOOK: Input: default@dest1
View
6 ql/src/test/results/clientpositive/input_lazyserde.q.out
@@ -131,7 +131,7 @@ POSTHOOK: Lineage: dest1.e SIMPLE [(src_thrift)src_thrift.FieldSchema(name:astri
[7,14,21] ["70","700","7000"] {"key_7":"value_7"} -1461153973 record_7
[8,16,24] ["80","800","8000"] {"key_8":"value_8"} 1638581578 record_8
[9,18,27] ["90","900","9000"] {"key_9":"value_9"} 336964413 record_9
-null null null 0 NULL
+NULL NULL NULL 0 NULL
PREHOOK: query: SELECT dest1.a[0], dest1.b[0], dest1.c['key2'], dest1.d, dest1.e FROM dest1 CLUSTER BY 1
PREHOOK: type: QUERY
PREHOOK: Input: default@dest1
@@ -217,7 +217,7 @@ POSTHOOK: Lineage: dest1.e SIMPLE [(src_thrift)src_thrift.FieldSchema(name:astri
[7,14,21]
[8,16,24]
[9,18,27]
-null
+NULL
PREHOOK: query: DROP TABLE dest1
PREHOOK: type: DROPTABLE
PREHOOK: Input: default@dest1
@@ -283,4 +283,4 @@ POSTHOOK: Lineage: dest1.e SIMPLE [(src_thrift)src_thrift.FieldSchema(name:astri
{"key_7":"value_7"}
{"key_8":"value_8"}
{"key_9":"value_9"}
-null
+NULL
View
2  ql/src/test/results/clientpositive/input_testxpath3.q.out
@@ -59,4 +59,4 @@ NULL [36]
NULL [49]
NULL [64]
value_9 [81]
-NULL null
+NULL NULL
View
2  ql/src/test/results/clientpositive/join_thrift.q.out
@@ -109,7 +109,7 @@ POSTHOOK: Input: default@src_thrift
-1461153973 [{"myint":49,"mystring":"343","underscore_int":7}]
-751827638 [{"myint":4,"mystring":"8","underscore_int":2}]
-734328909 [{"myint":16,"mystring":"64","underscore_int":4}]
-0 null
+0 NULL
336964413 [{"myint":81,"mystring":"729","underscore_int":9}]
465985200 [{"myint":1,"mystring":"1","underscore_int":1}]
477111222 [{"myint":9,"mystring":"27","underscore_int":3}]
View
192 ql/src/test/results/clientpositive/udf_percentile.q.out
@@ -306,56 +306,56 @@ GROUP BY CAST(key AS INT) DIV 10
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
#### A masked pattern was here ####
-0 NULL null
-1 NULL null
-2 NULL null
-3 NULL null
-4 NULL null
-5 NULL null
-6 NULL null
-7 NULL null
-8 NULL null
-9 NULL null
-10 NULL null
-11 NULL null
-12 NULL null
-13 NULL null
-14 NULL null
-15 NULL null
-16 NULL null
-17 NULL null
-18 NULL null
-19 NULL null
-20 NULL null
-21 NULL null
-22 NULL null
-23 NULL null
-24 NULL null
-25 NULL null
-26 NULL null
-27 NULL null
-28 NULL null
-29 NULL null
-30 NULL null
-31 NULL null
-32 NULL null
-33 NULL null
-34 NULL null
-35 NULL null
-36 NULL null
-37 NULL null
-38 NULL null
-39 NULL null
-40 NULL null
-41 NULL null
-42 NULL null
-43 NULL null
-44 NULL null
-45 NULL null
-46 NULL null
-47 NULL null
-48 NULL null
-49 NULL null
+0 NULL NULL
+1 NULL NULL
+2 NULL NULL
+3 NULL NULL
+4 NULL NULL
+5 NULL NULL
+6 NULL NULL
+7 NULL NULL
+8 NULL NULL
+9 NULL NULL
+10 NULL NULL
+11 NULL NULL
+12 NULL NULL
+13 NULL NULL
+14 NULL NULL
+15 NULL NULL
+16 NULL NULL
+17 NULL NULL
+18 NULL NULL
+19 NULL NULL
+20 NULL NULL
+21 NULL NULL
+22 NULL NULL
+23 NULL NULL
+24 NULL NULL
+25 NULL NULL
+26 NULL NULL
+27 NULL NULL
+28 NULL NULL
+29 NULL NULL
+30 NULL NULL
+31 NULL NULL
+32 NULL NULL
+33 NULL NULL
+34 NULL NULL
+35 NULL NULL
+36 NULL NULL
+37 NULL NULL
+38 NULL NULL
+39 NULL NULL
+40 NULL NULL
+41 NULL NULL
+42 NULL NULL
+43 NULL NULL
+44 NULL NULL
+45 NULL NULL
+46 NULL NULL
+47 NULL NULL
+48 NULL NULL
+49 NULL NULL
PREHOOK: query: -- test empty array handling
SELECT CAST(key AS INT) DIV 10,
percentile(IF(CAST(key AS INT) DIV 10 < 5, 1, NULL), 0.5),
@@ -379,51 +379,51 @@ POSTHOOK: Input: default@src
2 1.0 [1.0,1.0,1.0,1.0]
3 1.0 [1.0,1.0,1.0,1.0]
4 1.0 [1.0,1.0,1.0,1.0]
-5 NULL null
-6 NULL null
-7 NULL null
-8 NULL null
-9 NULL null
-10 NULL null
-11 NULL null
-12 NULL null
-13 NULL null
-14 NULL null
-15 NULL null
-16 NULL null
-17 NULL null
-18 NULL null
-19 NULL null
-20 NULL null
-21 NULL null
-22 NULL null
-23 NULL null
-24 NULL null
-25 NULL null
-26 NULL null
-27 NULL null
-28 NULL null
-29 NULL null
-30 NULL null
-31 NULL null
-32 NULL null
-33 NULL null
-34 NULL null
-35 NULL null
-36 NULL null
-37 NULL null
-38 NULL null
-39 NULL null
-40 NULL null
-41 NULL null
-42 NULL null
-43 NULL null
-44 NULL null
-45 NULL null
-46 NULL null
-47 NULL null
-48 NULL null
-49 NULL null
+5 NULL NULL
+6 NULL NULL
+7 NULL NULL
+8 NULL NULL
+9 NULL NULL
+10 NULL NULL
+11 NULL NULL
+12 NULL NULL
+13 NULL NULL
+14 NULL NULL
+15 NULL NULL
+16 NULL NULL
+17 NULL NULL
+18 NULL NULL
+19 NULL NULL
+20 NULL NULL
+21 NULL NULL
+22 NULL NULL
+23 NULL NULL
+24 NULL NULL
+25 NULL NULL
+26 NULL NULL
+27 NULL NULL
+28 NULL NULL
+29 NULL NULL
+30 NULL NULL
+31 NULL NULL
+32 NULL NULL
+33 NULL NULL
+34 NULL NULL
+35 NULL NULL
+36 NULL NULL
+37 NULL NULL
+38 NULL NULL
+39 NULL NULL
+40 NULL NULL
+41 NULL NULL
+42 NULL NULL
+43 NULL NULL
+44 NULL NULL
+45 NULL NULL
+46 NULL NULL
+47 NULL NULL
+48 NULL NULL
+49 NULL NULL
PREHOOK: query: select percentile(cast(key as bigint), 0.5) from src where false
PREHOOK: type: QUERY
PREHOOK: Input: default@src
@@ -443,4 +443,4 @@ select percentile(cast(key as bigint), array()) from src where false
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
#### A masked pattern was here ####
-null
+NULL
View
2  ql/src/test/results/clientpositive/udf_substr.q.out
@@ -181,7 +181,7 @@ FROM (
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
#### A masked pattern was here ####
-NULL NULL null null null A AB ABC ABC A AB ABC ABC B BC BC BC C C C C C C C C B BC BC BC A AB ABC ABC
+NULL NULL NULL NULL NULL A AB ABC ABC A AB ABC ABC B BC BC BC C C C C C C C C B BC BC BC A AB ABC ABC
PREHOOK: query: -- test UTF-8 substr
SELECT
substr("玩", 1),
View
2  ql/src/test/results/clientpositive/udtf_stack.q.out
@@ -156,7 +156,7 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
#### A masked pattern was here ####
x [1]
-z null
+z NULL
PREHOOK: query: SELECT x, y FROM src LATERAL VIEW STACK(2, 'x', array(1), 'z', array(4)) a AS x, y LIMIT 2
PREHOOK: type: QUERY
PREHOOK: Input: default@src
View
4 serde/src/java/org/apache/hadoop/hive/serde2/DelimitedJSONSerDe.java
@@ -55,8 +55,9 @@ public Object deserialize(Writable field) throws SerDeException {
protected void serializeField(ByteStream.Output out, Object obj, ObjectInspector objInspector,
SerDeParameters serdeParams) throws SerDeException {
if (!objInspector.getCategory().equals(Category.PRIMITIVE) || (objInspector.getTypeName().equalsIgnoreCase(serdeConstants.BINARY_TYPE_NAME))) {
+ //do this for all complex types and binary
try {
- serialize(out, SerDeUtils.getJSONString(obj, objInspector),
+ serialize(out, SerDeUtils.getJSONString(obj, objInspector, serdeParams.getNullSequence().toString()),
PrimitiveObjectInspectorFactory.javaStringObjectInspector, serdeParams.getSeparators(),
1, serdeParams.getNullSequence(), serdeParams.isEscaped(), serdeParams.getEscapeChar(),
serdeParams.getNeedsEscape());
@@ -66,6 +67,7 @@ protected void serializeField(ByteStream.Output out, Object obj, ObjectInspector
}
} else {
+ //primitives except binary
super.serializeField(out, obj, objInspector, serdeParams);
}
}
View
41 serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java
@@ -62,6 +62,9 @@
public static final String LBRACE = "{";
public static final String RBRACE = "}";
+ // lower case null is used within json objects
+ private static final String JSON_NULL = "null";
+
private static ConcurrentHashMap<String, Class<?>> serdes =
new ConcurrentHashMap<String, Class<?>>();
@@ -216,18 +219,32 @@ public static String lightEscapeString(String str) {
}
public static String getJSONString(Object o, ObjectInspector oi) {
+ return getJSONString(o, oi, JSON_NULL);
+ }
+
+ /**
+ * Use this if you need to have custom representation of top level null .
+ * (ie something other than 'null')
+ * eg, for hive output, we want to to print NULL for a null map object.
+ * @param o Object
+ * @param oi ObjectInspector
+ * @param nullStr The custom string used to represent null value
+ * @return
+ */
+ public static String getJSONString(Object o, ObjectInspector oi, String nullStr) {
StringBuilder sb = new StringBuilder();
- buildJSONString(sb, o, oi);
+ buildJSONString(sb, o, oi, nullStr);
return sb.toString();
}
- static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
+
+ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi, String nullStr) {
switch (oi.getCategory()) {
case PRIMITIVE: {
PrimitiveObjectInspector poi = (PrimitiveObjectInspector) oi;
if (o == null) {
- sb.append("null");
+ sb.append(nullStr);
} else {
switch (poi.getPrimitiveCategory()) {
case BOOLEAN: {
@@ -297,14 +314,14 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
.getListElementObjectInspector();
List<?> olist = loi.getList(o);
if (olist == null) {
- sb.append("null");
+ sb.append(nullStr);
} else {
sb.append(LBRACKET);
for (int i = 0; i < olist.size(); i++) {
if (i > 0) {
sb.append(COMMA);
}
- buildJSONString(sb, olist.get(i), listElementObjectInspector);
+ buildJSONString(sb, olist.get(i), listElementObjectInspector, JSON_NULL);
}
sb.append(RBRACKET);
}
@@ -317,7 +334,7 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
.getMapValueObjectInspector();
Map<?, ?> omap = moi.getMap(o);
if (omap == null) {
- sb.append("null");
+ sb.append(nullStr);
} else {
sb.append(LBRACE);
boolean first = true;
@@ -328,9 +345,9 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
sb.append(COMMA);
}
Map.Entry<?, ?> e = (Map.Entry<?, ?>) entry;
- buildJSONString(sb, e.getKey(), mapKeyObjectInspector);
+ buildJSONString(sb, e.getKey(), mapKeyObjectInspector, JSON_NULL);
sb.append(COLON);
- buildJSONString(sb, e.getValue(), mapValueObjectInspector);
+ buildJSONString(sb, e.getValue(), mapValueObjectInspector, JSON_NULL);
}
sb.append(RBRACE);
}
@@ -340,7 +357,7 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
StructObjectInspector soi = (StructObjectInspector) oi;
List<? extends StructField> structFields = soi.getAllStructFieldRefs();
if (o == null) {
- sb.append("null");
+ sb.append(nullStr);
} else {
sb.append(LBRACE);
for (int i = 0; i < structFields.size(); i++) {
@@ -352,7 +369,7 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
sb.append(QUOTE);
sb.append(COLON);
buildJSONString(sb, soi.getStructFieldData(o, structFields.get(i)),
- structFields.get(i).getFieldObjectInspector());
+ structFields.get(i).getFieldObjectInspector(), JSON_NULL);
}
sb.append(RBRACE);
}
@@ -361,13 +378,13 @@ static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) {
case UNION: {
UnionObjectInspector uoi = (UnionObjectInspector) oi;
if (o == null) {
- sb.append("null");
+ sb.append(nullStr);
} else {
sb.append(LBRACE);
sb.append(uoi.getTag(o));
sb.append(COLON);
buildJSONString(sb, uoi.getField(o),
- uoi.getObjectInspectors().get(uoi.getTag(o)));
+ uoi.getObjectInspectors().get(uoi.getTag(o)), JSON_NULL);
sb.append(RBRACE);
}
break;
Please sign in to comment.
Something went wrong with that request. Please try again.