drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [5/8] drill git commit: DRILL-6203: Repeated Map Vector does not give correct payload bytecount.
Date Thu, 08 Mar 2018 02:55:14 GMT
DRILL-6203: Repeated Map Vector does not give correct payload bytecount.


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

Branch: refs/heads/master
Commit: 0a8a3f1984b17c883dd8ee7cc1065932a4700224
Parents: fe05ba0
Author: Padma Penumarthy <ppenumar97@yahoo.com>
Authored: Tue Mar 6 15:57:34 2018 -0800
Committer: Ben-Zvi <bben-zvi@mapr.com>
Committed: Wed Mar 7 15:40:55 2018 -0800

----------------------------------------------------------------------
 .../exec/vector/complex/RepeatedListVector.java  |  8 ++++++--
 .../exec/vector/complex/RepeatedMapVector.java   | 19 +++++++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/0a8a3f19/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
index 4a7eda1..e8e6b06 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
@@ -47,7 +47,7 @@ import org.apache.drill.exec.vector.complex.impl.RepeatedListReaderImpl;
 import org.apache.drill.exec.vector.complex.reader.FieldReader;
 
 public class RepeatedListVector extends AbstractContainerVector
-    implements RepeatedValueVector, RepeatedFixedWidthVectorLike {
+    implements RepeatedValueVector {
 
   public final static MajorType TYPE = Types.repeated(MinorType.LIST);
   private final RepeatedListReaderImpl reader = new RepeatedListReaderImpl(null, this);
@@ -411,7 +411,6 @@ public class RepeatedListVector extends AbstractContainerVector
     return typeify(delegate.getDataVector(), clazz);
   }
 
-  @Override
   public void allocateNew(int valueCount, int innerValueCount) {
     clear();
     getOffsetVector().allocateNew(valueCount + 1);
@@ -419,6 +418,11 @@ public class RepeatedListVector extends AbstractContainerVector
     getMutator().reset();
   }
 
+  public void allocateOffsetsNew(int groupCount) {
+    getOffsetVector().allocateNew(groupCount + 1);
+    getOffsetVector().zeroVector();
+  }
+
   @Override
   public VectorWithOrdinal getChildVectorWithOrdinal(String name) {
     if (name != null) {

http://git-wip-us.apache.org/repos/asf/drill/blob/0a8a3f19/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
index 270f973..b9902fa 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
@@ -53,7 +53,7 @@ import org.apache.drill.exec.vector.complex.reader.FieldReader;
 import com.google.common.collect.Maps;
 
 public class RepeatedMapVector extends AbstractMapVector
-    implements RepeatedValueVector, RepeatedFixedWidthVectorLike {
+    implements RepeatedValueVector {
 
   public final static MajorType TYPE = MajorType.newBuilder().setMinorType(MinorType.MAP).setMode(DataMode.REPEATED).build();
 
@@ -97,7 +97,6 @@ public class RepeatedMapVector extends AbstractMapVector
   @Override
   public RepeatedMapReaderImpl getReader() { return reader; }
 
-  @Override
   public void allocateNew(int groupCount, int innerValueCount) {
     clear();
     try {
@@ -609,4 +608,20 @@ public class RepeatedMapVector extends AbstractMapVector
   public void toNullable(ValueVector nullableVector) {
     throw new UnsupportedOperationException();
   }
+
+  @Override
+  public int getPayloadByteCount(int valueCount) {
+    if (valueCount == 0) {
+      return 0;
+    }
+
+    int entryCount = offsets.getAccessor().get(valueCount);
+    int count = offsets.getPayloadByteCount(valueCount);
+
+    for (final ValueVector v : getChildren()) {
+      count += v.getPayloadByteCount(entryCount);
+    }
+    return count;
+  }
+
 }


Mime
View raw message