DRILL-5993: Fixed copyEntry for var length nullable vectors.

Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/cd6ddc96
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/cd6ddc96
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/cd6ddc96

Branch: refs/heads/master
Commit: cd6ddc96a21d84fcdbf9fecdcf5b3fe3732a0f95
Parents: 55c2bea
Author: Ben-Zvi <[email protected]>
Authored: Tue Jan 16 11:29:38 2018 -0800
Committer: Ben-Zvi <[email protected]>
Committed: Fri Feb 2 17:50:17 2018 -0800

----------------------------------------------------------------------
 .../src/main/codegen/templates/NullableValueVectors.java | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/cd6ddc96/exec/vector/src/main/codegen/templates/NullableValueVectors.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/codegen/templates/NullableValueVectors.java 
b/exec/vector/src/main/codegen/templates/NullableValueVectors.java
index 93f8e7b..bc13d62 100644
--- a/exec/vector/src/main/codegen/templates/NullableValueVectors.java
+++ b/exec/vector/src/main/codegen/templates/NullableValueVectors.java
@@ -410,6 +410,17 @@ public final class ${className} extends 
BaseDataValueVector implements <#if type
 
   @Override
   public void copyEntry(int toIndex, ValueVector from, int fromIndex) {
+    <#if type.major == "VarLen">
+    mutator.fillEmpties(toIndex);
+    </#if>
+
+    // Handle the case of not-nullable copied into a nullable
+    if (from instanceof ${minor.class}Vector) {
+      bits.getMutator().set(toIndex,1);
+      values.copyFromSafe(fromIndex,toIndex,(${minor.class}Vector)from);
+      return;
+    }
+
     Nullable${minor.class}Vector fromVector = (Nullable${minor.class}Vector) 
from;
     <#if type.major == "VarLen">
 

Reply via email to