Repository: hive
Updated Branches:
  refs/heads/branch-2 6615ed013 -> 40c9257a7


HIVE-17246: Add having related blobstore query test (Taklon Stephen Wu, 
reviewed by Sergio Pena)


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

Branch: refs/heads/branch-2
Commit: 40c9257a79e4bf035fd0b2fda3aac672c261b9df
Parents: 6615ed0
Author: Taklon Stephen Wu <taklo...@gmail.com>
Authored: Sun Aug 6 18:11:46 2017 -0500
Committer: Sergio Pena <sergio.p...@cloudera.com>
Committed: Sun Aug 6 18:12:25 2017 -0500

----------------------------------------------------------------------
 data/files/having_data.txt                      |  8 +++
 .../src/test/queries/clientpositive/having.q    | 12 ++++
 .../test/results/clientpositive/having.q.out    | 59 ++++++++++++++++++++
 3 files changed, 79 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/40c9257a/data/files/having_data.txt
----------------------------------------------------------------------
diff --git a/data/files/having_data.txt b/data/files/having_data.txt
new file mode 100644
index 0000000..99189bb
--- /dev/null
+++ b/data/files/having_data.txt
@@ -0,0 +1,8 @@
+1 5 a
+3 2 b
+1 3 a
+5 10 a
+9 51 c
+5 11 b
+5 12 d
+3 9 d

http://git-wip-us.apache.org/repos/asf/hive/blob/40c9257a/itests/hive-blobstore/src/test/queries/clientpositive/having.q
----------------------------------------------------------------------
diff --git a/itests/hive-blobstore/src/test/queries/clientpositive/having.q 
b/itests/hive-blobstore/src/test/queries/clientpositive/having.q
new file mode 100644
index 0000000..68ccff7
--- /dev/null
+++ b/itests/hive-blobstore/src/test/queries/clientpositive/having.q
@@ -0,0 +1,12 @@
+-- Test HAVING clause
+
+DROP TABLE having_blobstore_test;
+CREATE TABLE having_blobstore_test(a int, b int, c string)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ' '
+LOCATION 
'${hiveconf:test.blobstore.path.unique}/having_blobstore/having_blobstore_test';
+LOAD DATA LOCAL INPATH '../../data/files/having_data.txt' INTO TABLE 
having_blobstore_test;
+
+SELECT a, COUNT(b) AS ct FROM having_blobstore_test GROUP BY a HAVING ct > 1;
+SELECT a, MAX(b) FROM having_blobstore_test GROUP BY a HAVING MAX(b) > 9;
+SELECT a, MAX(b), MAX(c) FROM having_blobstore_test GROUP BY a HAVING MIN(c) < 
'b';

http://git-wip-us.apache.org/repos/asf/hive/blob/40c9257a/itests/hive-blobstore/src/test/results/clientpositive/having.q.out
----------------------------------------------------------------------
diff --git a/itests/hive-blobstore/src/test/results/clientpositive/having.q.out 
b/itests/hive-blobstore/src/test/results/clientpositive/having.q.out
new file mode 100644
index 0000000..d43b362
--- /dev/null
+++ b/itests/hive-blobstore/src/test/results/clientpositive/having.q.out
@@ -0,0 +1,59 @@
+PREHOOK: query: DROP TABLE having_blobstore_test
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE having_blobstore_test
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE having_blobstore_test(a int, b int, c string)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ' '
+#### A masked pattern was here ####
+PREHOOK: type: CREATETABLE
+PREHOOK: Input: ### test.blobstore.path 
###/having_blobstore/having_blobstore_test
+PREHOOK: Output: database:default
+PREHOOK: Output: default@having_blobstore_test
+POSTHOOK: query: CREATE TABLE having_blobstore_test(a int, b int, c string)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ' '
+#### A masked pattern was here ####
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Input: ### test.blobstore.path 
###/having_blobstore/having_blobstore_test
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@having_blobstore_test
+PREHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/having_data.txt' INTO 
TABLE having_blobstore_test
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@having_blobstore_test
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/having_data.txt' 
INTO TABLE having_blobstore_test
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@having_blobstore_test
+PREHOOK: query: SELECT a, COUNT(b) AS ct FROM having_blobstore_test GROUP BY a 
HAVING ct > 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT a, COUNT(b) AS ct FROM having_blobstore_test GROUP BY 
a HAVING ct > 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+1      2
+3      2
+5      3
+PREHOOK: query: SELECT a, MAX(b) FROM having_blobstore_test GROUP BY a HAVING 
MAX(b) > 9
+PREHOOK: type: QUERY
+PREHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT a, MAX(b) FROM having_blobstore_test GROUP BY a HAVING 
MAX(b) > 9
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+5      12
+9      51
+PREHOOK: query: SELECT a, MAX(b), MAX(c) FROM having_blobstore_test GROUP BY a 
HAVING MIN(c) < 'b'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT a, MAX(b), MAX(c) FROM having_blobstore_test GROUP BY 
a HAVING MIN(c) < 'b'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@having_blobstore_test
+#### A masked pattern was here ####
+1      5       a
+5      12      d

Reply via email to