You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/05/31 19:02:35 UTC
[1/3] hive git commit: HIVE-13870 : Decimal vector is not resized
correctly (Sergey Shelukhin, reviewed by Matt McCline)
Repository: hive
Updated Branches:
refs/heads/branch-2.0 e3cfeebce -> f0e072030
refs/heads/branch-2.1 23ca1b46e -> 545973cdf
refs/heads/master b7166d7d5 -> acdc31b8d
HIVE-13870 : Decimal vector is not resized correctly (Sergey Shelukhin, reviewed by Matt McCline)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/545973cd
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/545973cd
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/545973cd
Branch: refs/heads/branch-2.1
Commit: 545973cdfdbc622b0196113e96c391b714d6932b
Parents: 23ca1b4
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue May 31 11:48:44 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue May 31 11:56:57 2016 -0700
----------------------------------------------------------------------
.../ql/exec/vector/DecimalColumnVector.java | 30 ++++++++------------
1 file changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/545973cd/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
index 0c52210..2488631 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
@@ -60,14 +60,6 @@ public class DecimalColumnVector extends ColumnVector {
}
}
- // Fill the column vector with nulls
- public void fillWithNulls() {
- noNulls = false;
- isRepeating = true;
- vector[0] = null;
- isNull[0] = true;
- }
-
@Override
public void flatten(boolean selectedInUse, int[] sel, int size) {
// TODO Auto-generated method stub
@@ -141,16 +133,18 @@ public class DecimalColumnVector extends ColumnVector {
@Override
public void ensureSize(int size, boolean preserveData) {
super.ensureSize(size, preserveData);
- if (size > vector.length) {
- HiveDecimalWritable[] oldArray = vector;
- vector = new HiveDecimalWritable[size];
- if (preserveData) {
- // we copy all of the values to avoid creating more objects
- System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
- for(int i= oldArray.length; i < vector.length; ++i) {
- vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
- }
- }
+ if (size <= vector.length) return; // We assume the existing vector is always valid.
+ HiveDecimalWritable[] oldArray = vector;
+ vector = new HiveDecimalWritable[size];
+ int initPos = 0;
+ if (preserveData) {
+ // we copy all of the values to avoid creating more objects
+ // TODO: it might be cheaper to always preserve data or reset existing objects
+ initPos = oldArray.length;
+ System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
+ }
+ for (int i = initPos; i < vector.length; ++i) {
+ vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
}
}
}
[2/3] hive git commit: HIVE-13870 : Decimal vector is not resized
correctly (Sergey Shelukhin, reviewed by Matt McCline)
Posted by se...@apache.org.
HIVE-13870 : Decimal vector is not resized correctly (Sergey Shelukhin, reviewed by Matt McCline)
Conflicts:
storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f0e07203
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f0e07203
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f0e07203
Branch: refs/heads/branch-2.0
Commit: f0e072030062210b3927b9ffbbec97d8e1d66e4d
Parents: e3cfeeb
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue May 31 11:48:44 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue May 31 11:58:54 2016 -0700
----------------------------------------------------------------------
.../ql/exec/vector/DecimalColumnVector.java | 32 ++++++++------------
1 file changed, 13 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/f0e07203/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
index 1523ff6..2488631 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
@@ -60,14 +60,6 @@ public class DecimalColumnVector extends ColumnVector {
}
}
- // Fill the column vector with nulls
- public void fillWithNulls() {
- noNulls = false;
- isRepeating = true;
- vector[0] = null;
- isNull[0] = true;
- }
-
@Override
public void flatten(boolean selectedInUse, int[] sel, int size) {
// TODO Auto-generated method stub
@@ -140,17 +132,19 @@ public class DecimalColumnVector extends ColumnVector {
@Override
public void ensureSize(int size, boolean preserveData) {
- if (size > vector.length) {
- super.ensureSize(size, preserveData);
- HiveDecimalWritable[] oldArray = vector;
- vector = new HiveDecimalWritable[size];
- if (preserveData) {
- // we copy all of the values to avoid creating more objects
- System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
- for(int i= oldArray.length; i < vector.length; ++i) {
- vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
- }
- }
+ super.ensureSize(size, preserveData);
+ if (size <= vector.length) return; // We assume the existing vector is always valid.
+ HiveDecimalWritable[] oldArray = vector;
+ vector = new HiveDecimalWritable[size];
+ int initPos = 0;
+ if (preserveData) {
+ // we copy all of the values to avoid creating more objects
+ // TODO: it might be cheaper to always preserve data or reset existing objects
+ initPos = oldArray.length;
+ System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
+ }
+ for (int i = initPos; i < vector.length; ++i) {
+ vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
}
}
}
[3/3] hive git commit: HIVE-13870 : Decimal vector is not resized
correctly (Sergey Shelukhin, reviewed by Matt McCline)
Posted by se...@apache.org.
HIVE-13870 : Decimal vector is not resized correctly (Sergey Shelukhin, reviewed by Matt McCline)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/acdc31b8
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/acdc31b8
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/acdc31b8
Branch: refs/heads/master
Commit: acdc31b8d3c2b85e4b7882422f5a35cf8665eb8d
Parents: b7166d7
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue May 31 11:48:44 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue May 31 11:59:09 2016 -0700
----------------------------------------------------------------------
.../ql/exec/vector/DecimalColumnVector.java | 30 ++++++++------------
1 file changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/acdc31b8/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
index 0c52210..2488631 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/DecimalColumnVector.java
@@ -60,14 +60,6 @@ public class DecimalColumnVector extends ColumnVector {
}
}
- // Fill the column vector with nulls
- public void fillWithNulls() {
- noNulls = false;
- isRepeating = true;
- vector[0] = null;
- isNull[0] = true;
- }
-
@Override
public void flatten(boolean selectedInUse, int[] sel, int size) {
// TODO Auto-generated method stub
@@ -141,16 +133,18 @@ public class DecimalColumnVector extends ColumnVector {
@Override
public void ensureSize(int size, boolean preserveData) {
super.ensureSize(size, preserveData);
- if (size > vector.length) {
- HiveDecimalWritable[] oldArray = vector;
- vector = new HiveDecimalWritable[size];
- if (preserveData) {
- // we copy all of the values to avoid creating more objects
- System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
- for(int i= oldArray.length; i < vector.length; ++i) {
- vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
- }
- }
+ if (size <= vector.length) return; // We assume the existing vector is always valid.
+ HiveDecimalWritable[] oldArray = vector;
+ vector = new HiveDecimalWritable[size];
+ int initPos = 0;
+ if (preserveData) {
+ // we copy all of the values to avoid creating more objects
+ // TODO: it might be cheaper to always preserve data or reset existing objects
+ initPos = oldArray.length;
+ System.arraycopy(oldArray, 0, vector, 0 , oldArray.length);
+ }
+ for (int i = initPos; i < vector.length; ++i) {
+ vector[i] = new HiveDecimalWritable(HiveDecimal.ZERO);
}
}
}