Permalink
Browse files

Merge pull request #202 from lyair1/addExplicitNullInSerializedJson

Update readme file (fixing variable name)
  • Loading branch information...
rcongiu committed Nov 17, 2017
2 parents 79f7453 + 3c16364 commit c9c860bcc9d9902db64cfb15dd0eb4cbb929596b
Showing with 5 additions and 5 deletions.
  1. +3 −3 README.md
  2. +2 −2 json-serde/src/test/java/org/openx/data/jsonserde/JsonSerDeTest.java
View
@@ -305,15 +305,15 @@ CREATE EXTERNAL TABLE tableWithNull
'structMissingCol' STRUCT<name : STRING>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES ("explicit.null.value" = "true");
WITH SERDEPROPERTIES ("explicit.null" = "true");
-- JSON string: {\"stringCol\":"blabla",\"stringNullCol\":null,\"structCol\":{\"name\":\"myName\"},\"structNullCol\":{\"name\":null}}
LOAD DATA LOCAL INPATH 'pathToJsonFile.json' OVERWRITE INTO TABLE tableWithNull;
-- The output when ("explicit.null.value" = "true"):
-- The output when ("explicit.null" = "true"):
-- {\"stringCol\":"blabla",\"stringNullCol\":null,\"stringMissingCol\":null,\"structCol\":{\"name\":\"myName\"},\"structNullCol\":{\"name\":null},\"structMissingCol\":null}
-- The default output or when ("explicit.null.value" = "false"):
-- The default output or when ("explicit.null" = "false"):
-- {\"stringCol\":"blabla",\"structCol\":{\"name\":\"myName\"},\"structNullCol\":{}}
```
@@ -661,7 +661,7 @@ public void testExplicitNullValue() throws SerDeException, IOException {
tbl.setProperty(serdeConstants.LIST_COLUMNS, "stringCol,nullCol,missingCol");
tbl.setProperty(serdeConstants.LIST_COLUMN_TYPES, "string,string,string");
// Set 'explicit.null.value' to true
// Set 'explicit.null' to true
tbl.setProperty(JsonSerDe.PROP_EXPLICIT_NULL, "true");
serde.initialize(conf, tbl);
@@ -688,7 +688,7 @@ public void testNestedExplicitNullValue() throws SerDeException, IOException {
tbl.setProperty(serdeConstants.LIST_COLUMNS, "structCol,structNullCol,missingStructCol");
tbl.setProperty(serdeConstants.LIST_COLUMN_TYPES, "struct<name:string>,struct<name:string>,struct<name:string>");
// Set 'explicit.null.value' to true
// Set 'explicit.null' to true
tbl.setProperty(JsonSerDe.PROP_EXPLICIT_NULL, "true");
serde.initialize(conf, tbl);

0 comments on commit c9c860b

Please sign in to comment.