Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/906#discussion_r134299504
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java 
---
    @@ -329,9 +326,11 @@ public TypedFieldId getValueVectorId(SchemaPath path) {
     
       @VisibleForTesting
       public static class Mutator implements OutputMutator {
    -    /** Whether schema has changed since last inquiry (via #isNewSchema}). 
 Is
    -     *  true before first inquiry. */
    -    private boolean schemaChanged = true;
    +    /** Flag keeping track whether top-level schema has changed since last 
inquiry (via #isNewSchema}).
    +     * It's initialized to false, or reset to false after #isNewSchema or 
after #clear, until a new value vector
    +     * or a value vector with different type is added to fieldVectorMap.
    +     **/
    +    private boolean schemaChanged;
    --- End diff --
    
    Using a flag is very messy. The new version uses a counter. An observer 
simply remembers the previous count and compares it against the current count. 
Allows multiple observers without negotiating over which is responsible for 
resetting the flag.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to