hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From foy...@apache.org
Subject incubator-hawq git commit: HAWQ-225. Adding aggregate with grouping set test case.
Date Fri, 04 Dec 2015 23:45:15 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master ad8ed914d -> 0ec66d57d


HAWQ-225. Adding aggregate with grouping set test case.

closes #161.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0ec66d57
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0ec66d57
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0ec66d57

Branch: refs/heads/master
Commit: 0ec66d57d6cb8c06037e4a3fbb4daca4b533c9df
Parents: ad8ed91
Author: Karthikeyan Jambu Rajaraman <krajaraman@pivotal.io>
Authored: Fri Dec 4 15:12:12 2015 -0800
Committer: Karthikeyan Jambu Rajaraman <krajaraman@pivotal.io>
Committed: Fri Dec 4 15:12:12 2015 -0800

----------------------------------------------------------------------
 .../expected/aggregate_with_groupingsets.out    | 37 ++++++++++++++++++++
 src/test/regress/known_good_schedule            |  1 +
 .../regress/sql/aggregate_with_groupingsets.sql | 27 ++++++++++++++
 3 files changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0ec66d57/src/test/regress/expected/aggregate_with_groupingsets.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/aggregate_with_groupingsets.out b/src/test/regress/expected/aggregate_with_groupingsets.out
new file mode 100644
index 0000000..ccec222
--- /dev/null
+++ b/src/test/regress/expected/aggregate_with_groupingsets.out
@@ -0,0 +1,37 @@
+---
+--- Drop existing table
+---
+DROP TABLE IF EXISTS foo;
+NOTICE:  table "foo" does not exist, skipping
+---
+--- Create new table foo
+---
+CREATE TABLE foo(type INTEGER, prod VARCHAR, quantity NUMERIC);
+NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'type' as the Greenplum
Database data distribution key for this table.
+HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s)
chosen are the optimal data distribution key to minimize skew.
+---
+--- Insert some value
+---
+INSERT INTO foo VALUES(1, 'Table', 100);
+INSERT INTO foo VALUES(2, 'Chair', 250);
+INSERT INTO foo VALUES(3, 'Bed', 300);
+---
+--- Select query with grouping sets
+---
+SELECT type, prod, sum(quantity) s_quant
+FROM
+(
+  SELECT type, prod, quantity
+  FROM foo F1
+  LIMIT 3
+) F2 GROUP BY GROUPING SETS((type, prod), (prod)) ORDER BY type, s_quant;
+ type | prod  | s_quant 
+------+-------+---------
+    1 | Table |     100
+    2 | Chair |     250
+    3 | Bed   |     300
+      | Table |     100
+      | Chair |     250
+      | Bed   |     300
+(6 rows)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0ec66d57/src/test/regress/known_good_schedule
----------------------------------------------------------------------
diff --git a/src/test/regress/known_good_schedule b/src/test/regress/known_good_schedule
index 2c1a5bd..4272916 100755
--- a/src/test/regress/known_good_schedule
+++ b/src/test/regress/known_good_schedule
@@ -75,6 +75,7 @@ ignore: constraints
 ignore: triggers
 ignore: create_misc
 test: create_aggregate
+test: aggregate_with_groupingsets
 ignore: create_operator
 ignore: create_index
 ignore: drop_if_exists

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0ec66d57/src/test/regress/sql/aggregate_with_groupingsets.sql
----------------------------------------------------------------------
diff --git a/src/test/regress/sql/aggregate_with_groupingsets.sql b/src/test/regress/sql/aggregate_with_groupingsets.sql
new file mode 100644
index 0000000..2d1b95c
--- /dev/null
+++ b/src/test/regress/sql/aggregate_with_groupingsets.sql
@@ -0,0 +1,27 @@
+---
+--- Drop existing table
+---
+DROP TABLE IF EXISTS foo;
+
+---
+--- Create new table foo
+---
+CREATE TABLE foo(type INTEGER, prod VARCHAR, quantity NUMERIC);
+
+---
+--- Insert some value
+---
+INSERT INTO foo VALUES(1, 'Table', 100);
+INSERT INTO foo VALUES(2, 'Chair', 250);
+INSERT INTO foo VALUES(3, 'Bed', 300);
+
+---
+--- Select query with grouping sets
+---
+SELECT type, prod, sum(quantity) s_quant
+FROM
+(
+  SELECT type, prod, quantity
+  FROM foo F1
+  LIMIT 3
+) F2 GROUP BY GROUPING SETS((type, prod), (prod)) ORDER BY type, s_quant;
\ No newline at end of file


Mime
View raw message