You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2019/04/15 16:23:30 UTC

[hive] branch branch-3 updated (cda7150 -> 90ae608)

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

jcamacho pushed a change to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git.


    from cda7150  HIVE-21591: Using triggers in non-LLAP mode should not require wm queue (Prasanth Jayachandran reviewed by Daniel Dai)
     new 41b65fd  HIVE-21613: Queries with join condition having timestamp or timestamp with local time zone literal throw SemanticException (Jesus Camacho Rodriguez, reviewed by Sankar Hariappan)
     new 90ae608  HIVE-21600: GenTezUtils.removeSemiJoinOperator may throw out of bounds exception for TS with multiple children (Jesus Camacho Rodriguez, reviewed by Vineet Garg)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../test/resources/testconfiguration.properties    |  2 +
 .../apache/hadoop/hive/ql/parse/GenTezUtils.java   |  2 +-
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java     |  2 +
 ql/src/test/queries/clientpositive/timestamp_4.q   | 15 ++++++
 ql/src/test/queries/clientpositive/timestamptz_5.q | 16 ++++++
 .../results/clientpositive/llap/timestamp_4.q.out  | 58 ++++++++++++++++++++++
 .../clientpositive/llap/timestamptz_5.q.out        | 57 +++++++++++++++++++++
 7 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 ql/src/test/queries/clientpositive/timestamp_4.q
 create mode 100644 ql/src/test/queries/clientpositive/timestamptz_5.q
 create mode 100644 ql/src/test/results/clientpositive/llap/timestamp_4.q.out
 create mode 100644 ql/src/test/results/clientpositive/llap/timestamptz_5.q.out


[hive] 01/02: HIVE-21613: Queries with join condition having timestamp or timestamp with local time zone literal throw SemanticException (Jesus Camacho Rodriguez, reviewed by Sankar Hariappan)

Posted by jc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jcamacho pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git

commit 41b65fd48fd51b3e460de23c23637e6b4d43e95d
Author: Jesus Camacho Rodriguez <jc...@apache.org>
AuthorDate: Fri Apr 12 20:12:04 2019 -0700

    HIVE-21613: Queries with join condition having timestamp or timestamp with local time zone literal throw SemanticException (Jesus Camacho Rodriguez, reviewed by Sankar Hariappan)
---
 .../test/resources/testconfiguration.properties    |  2 +
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java     |  2 +
 ql/src/test/queries/clientpositive/timestamp_4.q   | 15 ++++++
 ql/src/test/queries/clientpositive/timestamptz_5.q | 16 ++++++
 .../results/clientpositive/llap/timestamp_4.q.out  | 58 ++++++++++++++++++++++
 .../clientpositive/llap/timestamptz_5.q.out        | 57 +++++++++++++++++++++
 6 files changed, 150 insertions(+)

diff --git a/itests/src/test/resources/testconfiguration.properties b/itests/src/test/resources/testconfiguration.properties
index f09bf14..2504f53 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -758,6 +758,8 @@ minillaplocal.query.files=\
   tez_union_multiinsert.q,\
   tez_vector_dynpart_hashjoin_1.q,\
   tez_vector_dynpart_hashjoin_2.q,\
+  timestamp_4.q,\
+  timestamptz_5.q,\
   uber_reduce.q,\
   udaf_collect_set_2.q,\
   udaf_all_keyword.q,\
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 013cefc..ff9a71b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -2754,6 +2754,8 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
     case HiveParser.KW_TRUE:
     case HiveParser.KW_FALSE:
     case HiveParser.TOK_DATELITERAL:
+    case HiveParser.TOK_TIMESTAMPLITERAL:
+    case HiveParser.TOK_TIMESTAMPLOCALTZLITERAL:
       break;
 
     case HiveParser.TOK_FUNCTION:
diff --git a/ql/src/test/queries/clientpositive/timestamp_4.q b/ql/src/test/queries/clientpositive/timestamp_4.q
new file mode 100644
index 0000000..b7a6dcc
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/timestamp_4.q
@@ -0,0 +1,15 @@
+drop table if exists timestamp_1;
+drop table if exists timestamp_2;
+
+create table timestamp_1 (key int, dd timestamp);
+create table timestamp_2 (key int, dd timestamp);
+
+-- between clause with timestamp literal in join condition
+select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamp_1) d1
+  join timestamp_2 as d2
+    on d1.key = d2.key
+    where d2.dd between start_dd and end_dd;
+
+drop table timestamp_1;
+drop table timestamp_2;
\ No newline at end of file
diff --git a/ql/src/test/queries/clientpositive/timestamptz_5.q b/ql/src/test/queries/clientpositive/timestamptz_5.q
new file mode 100644
index 0000000..d1e15ee
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/timestamptz_5.q
@@ -0,0 +1,16 @@
+set hive.cbo.enable=false;
+
+drop table if exists timestamplocaltz_n1;
+drop table if exists timestamplocaltz_n2;
+
+create table timestamplocaltz_n1 (key int, dd timestamp with local time zone);
+create table timestamplocaltz_n2 (key int, dd timestamp with local time zone);
+
+-- between clause with timestamp literal in join condition
+select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamplocaltz_n1) d1
+  join timestamplocaltz_n2 as d2
+    on d1.key = d2.key or d2.dd between timestamplocaltz '2010-04-01 00:00:00 America/Los_Angeles' and timestamplocaltz '2010-04-02 00:00:00 America/Los_Angeles';
+
+drop table timestamplocaltz_n1;
+drop table timestamplocaltz_n2;
\ No newline at end of file
diff --git a/ql/src/test/results/clientpositive/llap/timestamp_4.q.out b/ql/src/test/results/clientpositive/llap/timestamp_4.q.out
new file mode 100644
index 0000000..54864de
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/timestamp_4.q.out
@@ -0,0 +1,58 @@
+PREHOOK: query: drop table if exists timestamp_1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists timestamp_1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists timestamp_2
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists timestamp_2
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table timestamp_1 (key int, dd timestamp)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@timestamp_1
+POSTHOOK: query: create table timestamp_1 (key int, dd timestamp)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@timestamp_1
+PREHOOK: query: create table timestamp_2 (key int, dd timestamp)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@timestamp_2
+POSTHOOK: query: create table timestamp_2 (key int, dd timestamp)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@timestamp_2
+PREHOOK: query: select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamp_1) d1
+  join timestamp_2 as d2
+    on d1.key = d2.key
+    where d2.dd between start_dd and end_dd
+PREHOOK: type: QUERY
+PREHOOK: Input: default@timestamp_1
+PREHOOK: Input: default@timestamp_2
+#### A masked pattern was here ####
+POSTHOOK: query: select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamp_1) d1
+  join timestamp_2 as d2
+    on d1.key = d2.key
+    where d2.dd between start_dd and end_dd
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@timestamp_1
+POSTHOOK: Input: default@timestamp_2
+#### A masked pattern was here ####
+PREHOOK: query: drop table timestamp_1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@timestamp_1
+PREHOOK: Output: default@timestamp_1
+POSTHOOK: query: drop table timestamp_1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@timestamp_1
+POSTHOOK: Output: default@timestamp_1
+PREHOOK: query: drop table timestamp_2
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@timestamp_2
+PREHOOK: Output: default@timestamp_2
+POSTHOOK: query: drop table timestamp_2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@timestamp_2
+POSTHOOK: Output: default@timestamp_2
diff --git a/ql/src/test/results/clientpositive/llap/timestamptz_5.q.out b/ql/src/test/results/clientpositive/llap/timestamptz_5.q.out
new file mode 100644
index 0000000..ca5ebe5
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/timestamptz_5.q.out
@@ -0,0 +1,57 @@
+PREHOOK: query: drop table if exists timestamplocaltz_n1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists timestamplocaltz_n1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists timestamplocaltz_n2
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists timestamplocaltz_n2
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table timestamplocaltz_n1 (key int, dd timestamp with local time zone)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@timestamplocaltz_n1
+POSTHOOK: query: create table timestamplocaltz_n1 (key int, dd timestamp with local time zone)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@timestamplocaltz_n1
+PREHOOK: query: create table timestamplocaltz_n2 (key int, dd timestamp with local time zone)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@timestamplocaltz_n2
+POSTHOOK: query: create table timestamplocaltz_n2 (key int, dd timestamp with local time zone)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@timestamplocaltz_n2
+Warning: Shuffle Join MERGEJOIN[8][tables = [d1, d2]] in Stage 'Reducer 2' is a cross product
+PREHOOK: query: select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamplocaltz_n1) d1
+  join timestamplocaltz_n2 as d2
+    on d1.key = d2.key or d2.dd between timestamplocaltz '2010-04-01 00:00:00 America/Los_Angeles' and timestamplocaltz '2010-04-02 00:00:00 America/Los_Angeles'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@timestamplocaltz_n1
+PREHOOK: Input: default@timestamplocaltz_n2
+#### A masked pattern was here ####
+POSTHOOK: query: select d1.key, d2.dd
+  from (select key, dd as start_dd, current_timestamp as end_dd from timestamplocaltz_n1) d1
+  join timestamplocaltz_n2 as d2
+    on d1.key = d2.key or d2.dd between timestamplocaltz '2010-04-01 00:00:00 America/Los_Angeles' and timestamplocaltz '2010-04-02 00:00:00 America/Los_Angeles'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@timestamplocaltz_n1
+POSTHOOK: Input: default@timestamplocaltz_n2
+#### A masked pattern was here ####
+PREHOOK: query: drop table timestamplocaltz_n1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@timestamplocaltz_n1
+PREHOOK: Output: default@timestamplocaltz_n1
+POSTHOOK: query: drop table timestamplocaltz_n1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@timestamplocaltz_n1
+POSTHOOK: Output: default@timestamplocaltz_n1
+PREHOOK: query: drop table timestamplocaltz_n2
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@timestamplocaltz_n2
+PREHOOK: Output: default@timestamplocaltz_n2
+POSTHOOK: query: drop table timestamplocaltz_n2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@timestamplocaltz_n2
+POSTHOOK: Output: default@timestamplocaltz_n2


[hive] 02/02: HIVE-21600: GenTezUtils.removeSemiJoinOperator may throw out of bounds exception for TS with multiple children (Jesus Camacho Rodriguez, reviewed by Vineet Garg)

Posted by jc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jcamacho pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git

commit 90ae60841e39ad5c7222911830c7d438e962a278
Author: Jesus Camacho Rodriguez <jc...@apache.org>
AuthorDate: Wed Apr 10 13:32:29 2019 -0700

    HIVE-21600: GenTezUtils.removeSemiJoinOperator may throw out of bounds exception for TS with multiple children (Jesus Camacho Rodriguez, reviewed by Vineet Garg)
---
 ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java
index 741833b..7188a0d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java
@@ -608,12 +608,12 @@ public class GenTezUtils {
       }
     }
     // Filter operator
-    filterDynamicValuePredicatesCollection = new DynamicValuePredicateContext();
     for (Operator<?> op : ts.getChildOperators()) {
       if (!(op instanceof FilterOperator)) {
         continue;
       }
       FilterDesc filterDesc = ((FilterOperator) op).getConf();
+      filterDynamicValuePredicatesCollection = new DynamicValuePredicateContext();
       collectDynamicValuePredicates(filterDesc.getPredicate(),
               filterDynamicValuePredicatesCollection);
       for (ExprNodeDesc nodeToRemove : filterDynamicValuePredicatesCollection