[ https://issues.apache.org/jira/browse/DRILL-5546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135706#comment-16135706 ]
ASF GitHub Bot commented on DRILL-5546: --------------------------------------- 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. > Schema change problems caused by empty batch > -------------------------------------------- > > Key: DRILL-5546 > URL: https://issues.apache.org/jira/browse/DRILL-5546 > Project: Apache Drill > Issue Type: Bug > Reporter: Jinfeng Ni > Assignee: Jinfeng Ni > > There have been a few JIRAs opened related to schema change failure caused by > empty batch. This JIRA is opened as an umbrella for all those related JIRAS ( > such as DRILL-4686, DRILL-4734, DRILL4476, DRILL-4255, etc). > -- This message was sent by Atlassian JIRA (v6.4.14#64029)