Skip to content

Commit

Permalink
Coral-Schema: return nullable schema for array item and map value (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfgem authored Jan 17, 2023
1 parent d720898 commit fda6891
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public Schema union(Schema union, List<Schema> options) {

@Override
public Schema array(Schema array, Schema element) {
return Schema.createArray(element);
return Schema.createArray(SchemaUtilities.makeNullable(element, false));
}

@Override
public Schema map(Schema map, Schema value) {
return Schema.createMap(value);
return Schema.createMap(SchemaUtilities.makeNullable(value, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"name" : "Array_Col",
"type" : [ "null", {
"type" : "array",
"items" : "string"
"items" : [ "null", "string" ]
} ],
"default" : null
}, {
"name" : "Map_Col",
"type" : [ "null", {
"type" : "map",
"values" : "string"
"values" : [ "null", "string" ]
} ],
"default" : null
}, {
Expand Down Expand Up @@ -86,7 +86,7 @@
"name" : "Map_Col",
"type" : [ "null", {
"type" : "map",
"values" : "string"
"values" : [ "null", "string" ]
} ],
"default" : null
} ]
Expand Down

0 comments on commit fda6891

Please sign in to comment.