Github user Serhii-Harnyk commented on a diff in the pull request:

    https://github.com/apache/drill/pull/713#discussion_r97587774
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
 ---
    @@ -59,6 +59,12 @@
       private final boolean readNumbersAsDouble;
     
       /**
    +   * Collection for tracking empty array writers during reading
    +   * and storing them for initializing empty arrays
    +   */
    +  private final Set<ListWriter> emptyArrayWritersSet = Sets.newHashSet();
    --- End diff --
    
    But it should be mentioned that this list may contain many duplicates, as 
every ListWriter from every empty array field will be added into it. 
    To avoid secondary call field.integer() on the same ListWriter object, 
which was added many times into the list, in the method 
JsonReader.ensureAtLeastOneField() we check valueCapacity of every ListWriter. 
    Also LinkedHashSet may be used there, but in the case of many empty array 
fields it may cause additional extra cost.


---
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.
---

Reply via email to