You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kr...@apache.org on 2022/11/18 09:01:42 UTC

[hive] branch master updated: HIVE-26726: Tinyint column with windowing fn crashes at runtime (Steve Carlin, reviewed by Aman Sinha, Krisztian Kasa)

This is an automated email from the ASF dual-hosted git repository.

krisztiankasa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f6220c6c1b HIVE-26726: Tinyint column with windowing fn crashes at runtime (Steve Carlin, reviewed by Aman Sinha, Krisztian Kasa)
5f6220c6c1b is described below

commit 5f6220c6c1b820208a992c57638ca85d9be20e56
Author: scarlin-cloudera <55...@users.noreply.github.com>
AuthorDate: Fri Nov 18 01:01:34 2022 -0800

    HIVE-26726: Tinyint column with windowing fn crashes at runtime (Steve Carlin, reviewed by Aman Sinha, Krisztian Kasa)
---
 .../hive/ql/udf/ptf/ValueBoundaryScanner.java      |  1 +
 .../queries/clientpositive/windowing_tinyint.q     | 10 ++++++
 .../clientpositive/llap/windowing_tinyint.q.out    | 37 ++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java
index b433e390cf6..59bb6d9b261 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java
@@ -760,6 +760,7 @@ abstract class SingleValueBoundaryScanner extends ValueBoundaryScanner {
     case "int":
     case "bigint":
     case "smallint":
+    case "tinyint":
       return new LongPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
     case "timestamp":
       return new TimestampPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
diff --git a/ql/src/test/queries/clientpositive/windowing_tinyint.q b/ql/src/test/queries/clientpositive/windowing_tinyint.q
new file mode 100644
index 00000000000..2bf381f38ef
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/windowing_tinyint.q
@@ -0,0 +1,10 @@
+CREATE TABLE t_test(
+  int_col int,
+  tinyint_col tinyint
+);
+
+insert into t_test values (1, 1);
+
+select 
+count(int_col) over (order by tinyint_col)
+from t_test;
diff --git a/ql/src/test/results/clientpositive/llap/windowing_tinyint.q.out b/ql/src/test/results/clientpositive/llap/windowing_tinyint.q.out
new file mode 100644
index 00000000000..98f30162210
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/windowing_tinyint.q.out
@@ -0,0 +1,37 @@
+PREHOOK: query: CREATE TABLE t_test(
+  int_col int,
+  tinyint_col tinyint
+)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t_test
+POSTHOOK: query: CREATE TABLE t_test(
+  int_col int,
+  tinyint_col tinyint
+)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t_test
+PREHOOK: query: insert into t_test values (1, 1)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t_test
+POSTHOOK: query: insert into t_test values (1, 1)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t_test
+POSTHOOK: Lineage: t_test.int_col SCRIPT []
+POSTHOOK: Lineage: t_test.tinyint_col SCRIPT []
+PREHOOK: query: select 
+count(int_col) over (order by tinyint_col)
+from t_test
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t_test
+#### A masked pattern was here ####
+POSTHOOK: query: select 
+count(int_col) over (order by tinyint_col)
+from t_test
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t_test
+#### A masked pattern was here ####
+1