Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/580#discussion_r99970247
--- Diff:
exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java
---
@@ -317,6 +317,12 @@ public Object getObject(int index) {
if (v != null && index < v.getAccessor().getValueCount()) {
Object value = v.getAccessor().getObject(index);
if (value != null) {
+ if ((v.getAccessor().getObject(index) instanceof Map
+ && ((Map) v.getAccessor().getObject(index)).size() ==
0)
+ || (v.getAccessor().getObject(index) instanceof List
+ && ((List) v.getAccessor().getObject(index)).size() ==
0)) {
+ continue;
+ }
--- End diff --
See the JIRA entry for more comments. The key problem is that Drill does
not support standard JSON rules. So, we are simply moving the problem around.
Consider this case:
{code}
{ }
{ "a": { } }
{ "a": { "b": {} } }
{code}
It appears that the code here would emit:
{ }
{ }
{ "a": { } }
{code}
If we are going to apply the empty-is-not-present rule we should do so
recursively.
---
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.
---