hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iw...@apache.org
Subject incubator-hawq git commit: HAWQ-1018. Add feature test for goh_gp_dist_random with new test framework
Date Tue, 30 Aug 2016 01:54:22 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master cb80c3331 -> 569f7545d


HAWQ-1018. Add feature test for goh_gp_dist_random with new test framework


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

Branch: refs/heads/master
Commit: 569f7545d289a396f9c002bb304b613a89c3cfc1
Parents: cb80c33
Author: ivan <iweng@pivotal.io>
Authored: Tue Aug 30 09:52:52 2016 +0800
Committer: ivan <iweng@pivotal.io>
Committed: Tue Aug 30 09:52:52 2016 +0800

----------------------------------------------------------------------
 .../feature/query/ans/goh_gp_dist_random.ans     | 15 +++++++++++++++
 .../feature/query/sql/goh_gp_dist_random.sql     |  6 ++++++
 src/test/feature/query/test_gp_dist_random.cpp   | 19 +++++++++++++++++++
 3 files changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/ans/goh_gp_dist_random.ans
----------------------------------------------------------------------
diff --git a/src/test/feature/query/ans/goh_gp_dist_random.ans b/src/test/feature/query/ans/goh_gp_dist_random.ans
new file mode 100644
index 0000000..7c3adec
--- /dev/null
+++ b/src/test/feature/query/ans/goh_gp_dist_random.ans
@@ -0,0 +1,15 @@
+select count(*) > 0 as c from gp_dist_random('pg_class');
+ c 
+---
+ t
+(1 row)
+
+select relname from gp_dist_random('pg_class') c
+  inner join gp_dist_random('pg_namespace') n
+    on c.gp_segment_id = n.gp_segment_id
+      and c.relnamespace = n.oid
+  where n.nspname = 'nonexistent';
+ relname 
+---------
+(0 rows)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/sql/goh_gp_dist_random.sql
----------------------------------------------------------------------
diff --git a/src/test/feature/query/sql/goh_gp_dist_random.sql b/src/test/feature/query/sql/goh_gp_dist_random.sql
new file mode 100644
index 0000000..d476520
--- /dev/null
+++ b/src/test/feature/query/sql/goh_gp_dist_random.sql
@@ -0,0 +1,6 @@
+select count(*) > 0 as c from gp_dist_random('pg_class');
+select relname from gp_dist_random('pg_class') c
+  inner join gp_dist_random('pg_namespace') n
+    on c.gp_segment_id = n.gp_segment_id
+      and c.relnamespace = n.oid
+  where n.nspname = 'nonexistent';

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/test_gp_dist_random.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/query/test_gp_dist_random.cpp b/src/test/feature/query/test_gp_dist_random.cpp
new file mode 100644
index 0000000..476911d
--- /dev/null
+++ b/src/test/feature/query/test_gp_dist_random.cpp
@@ -0,0 +1,19 @@
+#include "gtest/gtest.h"
+
+#include "lib/sql_util.h"
+
+using std::string;
+
+class TestGpDistRandom: public ::testing::Test
+{
+	public:
+		TestGpDistRandom() { }
+		~TestGpDistRandom() {}
+};
+
+TEST_F(TestGpDistRandom, BasicTest)
+{
+	hawq::test::SQLUtility util;
+	util.execSQLFile("query/sql/goh_gp_dist_random.sql",
+	                 "query/ans/goh_gp_dist_random.ans");
+}


Mime
View raw message