[1/6] hive git commit: HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran)
Repository: hive Updated Branches: refs/heads/master f38a42e52 -> 0a24c8859 HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a6626cc6 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a6626cc6 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a6626cc6 Branch: refs/heads/master Commit: a6626cc6fe071b3bee491fe3a0dbf31c58116712 Parents: f38a42e Author: Matt McClineAuthored: Fri May 27 18:13:46 2016 -0700 Committer: Matt McCline Committed: Fri May 27 20:36:22 2016 -0700 -- .../apache/hadoop/hive/ant/GenVectorCode.java | 1 + .../ql/exec/vector/VectorizationContext.java| 7 ++- .../apache/hadoop/hive/ql/udf/UDFToFloat.java | 4 ++-- .../clientpositive/tez/vectorized_casts.q.out | 20 ++-- .../clientpositive/vectorized_casts.q.out | 20 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/a6626cc6/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java -- diff --git a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java index 6c6cc63..e9fe8fa 100644 --- a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java +++ b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java @@ -933,6 +933,7 @@ public class GenVectorCode extends Task { // Casts {"ColumnUnaryFunc", "Cast", "long", "double", "", "", "(long)", "", ""}, {"ColumnUnaryFunc", "Cast", "double", "long", "", "", "(double)", "", ""}, + {"ColumnUnaryFunc", "CastLongToFloatVia", "double", "long", "", "", "(float)", "", ""}, {"ColumnUnaryFunc", "CastDoubleToBooleanVia", "long", "double", "MathExpr.toBool", "", "", "", ""}, {"ColumnUnaryFunc", "CastLongToBooleanVia", "long", "long", "MathExpr.toBool", "", http://git-wip-us.apache.org/repos/asf/hive/blob/a6626cc6/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java index a76e31d..7f55b31 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java @@ -1803,7 +1803,12 @@ public class VectorizationContext { return getConstantVectorExpression(doubleValue, returnType, Mode.PROJECTION); } if (isIntFamily(inputType)) { - return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + if (udf.equals(UDFToFloat.class)) { +// In order to convert from integer to float correctly, we need to apply the float cast not the double cast (HIVE-13338). +return createVectorExpression(CastLongToFloatViaLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } else { +return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } } else if (inputType.equals("timestamp")) { return createVectorExpression(CastTimestampToDouble.class, childExpr, Mode.PROJECTION, returnType); http://git-wip-us.apache.org/repos/asf/hive/blob/a6626cc6/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java index c612307..5808c90 100755 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hive.ql.udf; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastDecimalToDouble; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToDouble; +import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToFloatViaLongToDouble; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastTimestampToDouble; import org.apache.hadoop.hive.serde2.io.ByteWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; @@ -40,7 +40,7 @@ import org.apache.hadoop.io.Text; * UDFToFloat. * */ -@VectorizedExpressions({CastTimestampToDouble.class, CastLongToDouble.class,
hive git commit: HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran)
Repository: hive Updated Branches: refs/heads/branch-1 6e0504d9a -> 213f9f185 HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/213f9f18 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/213f9f18 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/213f9f18 Branch: refs/heads/branch-1 Commit: 213f9f185a80d597ce698708131f9c6d49d5b95f Parents: 6e0504d Author: Matt McClineAuthored: Fri May 27 18:58:27 2016 -0700 Committer: Matt McCline Committed: Fri May 27 18:58:27 2016 -0700 -- .../apache/hadoop/hive/ant/GenVectorCode.java | 1 + .../ql/exec/vector/VectorizationContext.java| 7 ++- .../apache/hadoop/hive/ql/udf/UDFToFloat.java | 4 ++-- .../clientpositive/vectorized_casts.q.out | 20 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/213f9f18/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java -- diff --git a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java index 08eee0b..5a67a16 100644 --- a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java +++ b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java @@ -951,6 +951,7 @@ public class GenVectorCode extends Task { // Casts {"ColumnUnaryFunc", "Cast", "long", "double", "", "", "(long)", "", ""}, {"ColumnUnaryFunc", "Cast", "double", "long", "", "", "(double)", "", ""}, + {"ColumnUnaryFunc", "CastLongToFloatVia", "double", "long", "", "", "(float)", "", ""}, {"ColumnUnaryFunc", "CastDoubleToBooleanVia", "long", "double", "MathExpr.toBool", "", "", "", ""}, {"ColumnUnaryFunc", "CastLongToBooleanVia", "long", "long", "MathExpr.toBool", "", http://git-wip-us.apache.org/repos/asf/hive/blob/213f9f18/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java index 86fdf1c..9caa771 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java @@ -1784,7 +1784,12 @@ public class VectorizationContext { return getConstantVectorExpression(doubleValue, returnType, Mode.PROJECTION); } if (isIntFamily(inputType)) { - return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + if (udf.equals(UDFToFloat.class)) { +// In order to convert from integer to float correctly, we need to apply the float cast not the double cast (HIVE-13338). +return createVectorExpression(CastLongToFloatViaLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } else { +return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } } else if (inputType.equals("timestamp")) { return createVectorExpression(CastTimestampToDouble.class, childExpr, Mode.PROJECTION, returnType); http://git-wip-us.apache.org/repos/asf/hive/blob/213f9f18/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java index e2183f4..6e2c396 100755 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hive.ql.udf; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastDecimalToDouble; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToDouble; +import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToFloatViaLongToDouble; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastTimestampToDouble; import org.apache.hadoop.hive.serde2.io.ByteWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; @@ -39,7 +39,7 @@ import org.apache.hadoop.io.Text; * UDFToFloat. * */ -@VectorizedExpressions({CastTimestampToDouble.class, CastLongToDouble.class, +@VectorizedExpressions({CastTimestampToDouble.class,
hive git commit: HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran)
Repository: hive Updated Branches: refs/heads/branch-2.1 7a41e7ccf -> 2bd2e9a09 HIVE-13338: Differences in vectorized_casts.q output for vectorized and non-vectorized runs (Matt McCline, reviewed by Prasanth Jayachandran) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/2bd2e9a0 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/2bd2e9a0 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/2bd2e9a0 Branch: refs/heads/branch-2.1 Commit: 2bd2e9a091a81751c4c2d5392538a2763fe754a2 Parents: 7a41e7c Author: Matt McClineAuthored: Fri May 27 18:13:46 2016 -0700 Committer: Matt McCline Committed: Fri May 27 18:13:46 2016 -0700 -- .../apache/hadoop/hive/ant/GenVectorCode.java | 1 + .../ql/exec/vector/VectorizationContext.java| 7 ++- .../apache/hadoop/hive/ql/udf/UDFToFloat.java | 4 ++-- .../clientpositive/tez/vectorized_casts.q.out | 20 ++-- .../clientpositive/vectorized_casts.q.out | 20 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/2bd2e9a0/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java -- diff --git a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java index 6c6cc63..e9fe8fa 100644 --- a/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java +++ b/ant/src/org/apache/hadoop/hive/ant/GenVectorCode.java @@ -933,6 +933,7 @@ public class GenVectorCode extends Task { // Casts {"ColumnUnaryFunc", "Cast", "long", "double", "", "", "(long)", "", ""}, {"ColumnUnaryFunc", "Cast", "double", "long", "", "", "(double)", "", ""}, + {"ColumnUnaryFunc", "CastLongToFloatVia", "double", "long", "", "", "(float)", "", ""}, {"ColumnUnaryFunc", "CastDoubleToBooleanVia", "long", "double", "MathExpr.toBool", "", "", "", ""}, {"ColumnUnaryFunc", "CastLongToBooleanVia", "long", "long", "MathExpr.toBool", "", http://git-wip-us.apache.org/repos/asf/hive/blob/2bd2e9a0/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java index a76e31d..7f55b31 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java @@ -1803,7 +1803,12 @@ public class VectorizationContext { return getConstantVectorExpression(doubleValue, returnType, Mode.PROJECTION); } if (isIntFamily(inputType)) { - return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + if (udf.equals(UDFToFloat.class)) { +// In order to convert from integer to float correctly, we need to apply the float cast not the double cast (HIVE-13338). +return createVectorExpression(CastLongToFloatViaLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } else { +return createVectorExpression(CastLongToDouble.class, childExpr, Mode.PROJECTION, returnType); + } } else if (inputType.equals("timestamp")) { return createVectorExpression(CastTimestampToDouble.class, childExpr, Mode.PROJECTION, returnType); http://git-wip-us.apache.org/repos/asf/hive/blob/2bd2e9a0/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java index c612307..5808c90 100755 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToFloat.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hive.ql.udf; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.hive.ql.exec.vector.VectorizedExpressions; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastDecimalToDouble; -import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToDouble; +import org.apache.hadoop.hive.ql.exec.vector.expressions.gen.CastLongToFloatViaLongToDouble; import org.apache.hadoop.hive.ql.exec.vector.expressions.CastTimestampToDouble; import org.apache.hadoop.hive.serde2.io.ByteWritable; import org.apache.hadoop.hive.serde2.io.DoubleWritable; @@ -40,7 +40,7 @@ import org.apache.hadoop.io.Text; * UDFToFloat. * */ -@VectorizedExpressions({CastTimestampToDouble.class, CastLongToDouble.class,