Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/594#discussion_r103547010
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
---
@@ -170,6 +184,21 @@ public void ensureAtLeastOneField(ComplexWriter
writer) {
}
}
+ private void initializeFieldWriter(MapWriter fieldWriter, String path) {
+ if (allTextMode) {
+ fieldWriter.varChar(path);
+ } else {
+ fieldWriter.integer(path);
--- End diff --
At the Drill Hangout it was mentioned that this fix handles nulls for
non-Varchar fields. Note that it does so using the same mechanism that Drill
uses elsewhere: assume the field is of type int. However, we have many, many
bugs that result from that assumption. There is simply no guarantee that, in a
later batch, when we see the field, that it will, in fact, be an int.
I'm not sure whether it is OK to simply continue to propagate that
well-known error here (as we have done) or to take another path that avoids the
error. (Since doing so requires a design change that has, so far, always been
beyond our ability to accomplish.)
---
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.
---