Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/594#discussion_r101880961
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
---
@@ -63,6 +67,12 @@
private final List<ListWriter> emptyArrayWriters = Lists.newArrayList();
/**
+ * Collection for tracking nullable fields during reading
+ * and storing them for creating default typed vectors
+ */
+ private Map<List<String>, MapWriter> fieldPathWriter = Maps.newHashMap();
--- End diff --
Actually, in JSON, all scalar types can be null. Because JSON has no
schema, any field can have any type. Drill assumes that a given field has a
single type. But, in JSON semantics, that single type can be null. That is, the
following is always valid:
{code}
{ a: 10, b: null }
{ a: null, b: "foo" }
{ a: 20 }
{code}
JSON, but not Drill, differentiates between "not present" and null.
Given this, we don't need a special map for nullable fields: all JSON
fields are nullable.
Of course, JSON allows a null map, which Drill does not handle, but let's
ignore that here...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---