[ 
https://issues.apache.org/jira/browse/DRILL-7441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976470#comment-16976470
 ] 

ASF GitHub Bot commented on DRILL-7441:
---------------------------------------

vvysotskyi commented on pull request #1896: DRILL-7441: Fix issues with 
fillEmpties, offset vectors
URL: https://github.com/apache/drill/pull/1896#discussion_r347331522
 
 

 ##########
 File path: exec/vector/src/main/codegen/templates/NullableValueVectors.java
 ##########
 @@ -844,29 +841,35 @@ public void generateTestData(int valueCount) {
 
     @Override
     public void reset() {
-      setCount = 0;
       <#if type.major = "VarLen">lastSet = -1;</#if>
     }
 
     <#if type.major = "VarLen">
     @VisibleForTesting
     public int getLastSet() { return lastSet; }
-    
+
     </#if>
+    @Override
+    public void setSetCount(int n) {
+      <#if type.major = "VarLen">lastSet = n - 1;</#if>
+    }
+    
     // For nullable vectors, exchanging buffers (done elsewhere)
     // requires also exchanging mutator state (done here.)
 
     @Override
     public void exchange(ValueVector.Mutator other) {
-      final Mutator target = (Mutator) other;
-      int temp = setCount;
-      setCount = target.setCount;
-      target.setCount = temp;
+      <#if type.major == "VarLen">
 
 Review comment:
   Thanks for the explanation!
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix issues with fillEmpties, offset vectors
> -------------------------------------------
>
>                 Key: DRILL-7441
>                 URL: https://issues.apache.org/jira/browse/DRILL-7441
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Major
>
> Enable the vector validator with full testing of offset vectors. A number of 
> operators trigger errors. Tracking down the issues, and adding detailed 
> tests, it turns out that:
> * Drill has an informal standard that zero-length batches should have 
> zero-length offset vectors, while a batch of size 1 will have offset vectors 
> of size 2. Thus, zero-length is a special case.
> * Nullable, repeated and variable-width vectors have "fill empties" logic 
> that is used in two places: when setting the value count and when preparing 
> to write a new value. The current logic is not quite right for either case.
> Detailed vector checks fail due to inconsistencies in how the above works. 
> This PR fixes those issues.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to