hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [4/7] hive git commit: HIVE-14012 : some ColumnVector-s are missing ensureSize (Sergey Shelukhin, reviewed by Prasanth J)
Date Mon, 20 Jun 2016 21:39:53 GMT
HIVE-14012 : some ColumnVector-s are missing ensureSize (Sergey Shelukhin, reviewed by Prasanth
J)


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

Branch: refs/heads/master
Commit: bfbd24ef23d0502eb81ffa429397264918a53b91
Parents: 912aad7
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Mon Jun 20 14:36:46 2016 -0700
Committer: Sergey Shelukhin <sershe@apache.org>
Committed: Mon Jun 20 14:36:46 2016 -0700

----------------------------------------------------------------------
 .../exec/vector/IntervalDayTimeColumnVector.java | 19 +++++++++++++++++++
 .../ql/exec/vector/TimestampColumnVector.java    | 19 +++++++++++++++++++
 2 files changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/bfbd24ef/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
index 39ccea8..c4a6c0f 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
@@ -345,4 +345,23 @@ public class IntervalDayTimeColumnVector extends ColumnVector {
       buffer.append("null");
     }
   }
+
+  @Override
+  public void ensureSize(int size, boolean preserveData) {
+    super.ensureSize(size, preserveData);
+    if (size <= totalSeconds.length) return;
+    long[] oldTime = totalSeconds;
+    int[] oldNanos = nanos;
+    totalSeconds = new long[size];
+    nanos = new int[size];
+    if (preserveData) {
+      if (isRepeating) {
+        totalSeconds[0] = oldTime[0];
+        nanos[0] = oldNanos[0];
+      } else {
+        System.arraycopy(oldTime, 0, totalSeconds, 0, oldTime.length);
+        System.arraycopy(oldNanos, 0, nanos, 0, oldNanos.length);
+      }
+    }
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/bfbd24ef/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
index 228461a..0948d2d 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
@@ -397,4 +397,23 @@ public class TimestampColumnVector extends ColumnVector {
       buffer.append("null");
     }
   }
+
+  @Override
+  public void ensureSize(int size, boolean preserveData) {
+    super.ensureSize(size, preserveData);
+    if (size <= time.length) return;
+    long[] oldTime = time;
+    int[] oldNanos = nanos;
+    time = new long[size];
+    nanos = new int[size];
+    if (preserveData) {
+      if (isRepeating) {
+        time[0] = oldTime[0];
+        nanos[0] = oldNanos[0];
+      } else {
+        System.arraycopy(oldTime, 0, time, 0, oldTime.length);
+        System.arraycopy(oldNanos, 0, nanos, 0, oldNanos.length);
+      }
+    }
+  }
 }


Mime
View raw message