orc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [1/7] orc git commit: HIVE-14012. Some ColumnVector subclasses are missing ensureSize.
Date Thu, 30 Jun 2016 22:00:14 GMT
Repository: orc
Updated Branches:
  refs/heads/master d9d529bcf -> 98c0992ed


HIVE-14012. Some ColumnVector subclasses are missing ensureSize.


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

Branch: refs/heads/master
Commit: e8c0eb541c31de500ca0428815347f4595c8e4c1
Parents: 17e14f6
Author: Owen O'Malley <omalley@apache.org>
Authored: Thu Jun 30 10:23:26 2016 -0700
Committer: Owen O'Malley <omalley@apache.org>
Committed: Thu Jun 30 14:33:57 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/orc/blob/e8c0eb54/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
----------------------------------------------------------------------
diff --git a/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
b/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
index 39ccea8..c4a6c0f 100644
--- a/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/IntervalDayTimeColumnVector.java
+++ b/java/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/orc/blob/e8c0eb54/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
----------------------------------------------------------------------
diff --git a/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
b/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
index 228461a..0948d2d 100644
--- a/java/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java
+++ b/java/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