You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by jy...@apache.org on 2016/07/21 03:10:29 UTC

incubator-hawq git commit: HAWQ-943. Various issues in hawq register feature_test cases

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 24d4d967e -> 9b004b7cb


HAWQ-943. Various issues in hawq register feature_test cases


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

Branch: refs/heads/master
Commit: 9b004b7cb93af8933ce7baa51698a61243731f7c
Parents: 24d4d96
Author: Paul Guo <pa...@gmail.com>
Authored: Wed Jul 20 17:35:47 2016 +0800
Committer: Paul Guo <pa...@gmail.com>
Committed: Thu Jul 21 11:08:51 2016 +0800

----------------------------------------------------------------------
 .../ManagementTool/test_hawq_register.cpp       | 48 ++++++++++----------
 1 file changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9b004b7c/src/test/feature/ManagementTool/test_hawq_register.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/ManagementTool/test_hawq_register.cpp b/src/test/feature/ManagementTool/test_hawq_register.cpp
index c802642..a7982b3 100644
--- a/src/test/feature/ManagementTool/test_hawq_register.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register.cpp
@@ -22,12 +22,12 @@ TEST_F(TestHawqRegister, TestSingleHawqFile) {
 	string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
 
 	util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(0, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
 
 	util.query("select * from hawqregister;", 3);
 	util.execute("insert into hawqregister values(1);");
@@ -41,12 +41,12 @@ TEST_F(TestHawqRegister, TestSingleHiveFile) {
 	string relativePath("/ManagementTool/test_hawq_register_hive.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_hive.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_hive.paq"));
 
 	util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(0, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_hive.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_hive.paq"));
 
 	util.query("select * from hawqregister;", 1);
 	util.execute("insert into hawqregister values(1);");
@@ -62,12 +62,12 @@ TEST_F(TestHawqRegister, TestDataTypes) {
 	string relativePath("/ManagementTool/test_hawq_register_data_types.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_data_types.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_data_types.paq"));
 
 	util.execute("create table hawqregister(a bool, b int2, c int2, d int4, e int8, f date, g float4, h float8, i varchar, j bytea, k char, l varchar) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(0, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_data_types.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_data_types.paq"));
 
 	util.query("select * from hawqregister;", 1);
 	util.execute("drop table hawqregister;");
@@ -82,12 +82,12 @@ TEST_F(TestHawqRegister, TestAllNULL) {
 	string relativePath("/ManagementTool/test_hawq_register_null.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_data_types.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_data_types.paq"));
 
 	util.execute("create table hawqregister(a bool, b int2, c int2, d int4, e int8, f date, g float4, h float8, i varchar, j bytea, k char, l varchar) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(0, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_data_types.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_data_types.paq"));
 
 	util.query("select * from hawqregister;", 1);
 	util.execute("drop table hawqregister;");
@@ -102,18 +102,18 @@ TEST_F(TestHawqRegister, TestFiles) {
 	string filePath2 = rootPath + relativePath;
 
 	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -mkdir -p hdfs://localhost:8020/hawq_register_test/t/t"));
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath1 + " hdfs://localhost:8020/hawq_register_test/hawq1.paq"));
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath1 + " hdfs://localhost:8020/hawq_register_test/hawq2.paq"));
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath1 + " hdfs://localhost:8020/hawq_register_test/t/hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath1 + " hdfs://localhost:8020/hawq_register_test/hawq1.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath1 + " hdfs://localhost:8020/hawq_register_test/hawq2.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath1 + " hdfs://localhost:8020/hawq_register_test/t/hawq.paq"));
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath2 + " hdfs://localhost:8020/hawq_register_test/hive1.paq"));
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath2 + " hdfs://localhost:8020/hawq_register_test/hive2.paq"));
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath2 + " hdfs://localhost:8020/hawq_register_test/t/hive.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath2 + " hdfs://localhost:8020/hawq_register_test/hive1.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath2 + " hdfs://localhost:8020/hawq_register_test/hive2.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath2 + " hdfs://localhost:8020/hawq_register_test/t/hive.paq"));
 
 	util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(0, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_test"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_test"));
 
 	util.query("select * from hawqregister;", 12);
 	util.execute("insert into hawqregister values(1);");
@@ -128,12 +128,12 @@ TEST_F(TestHawqRegister, TestHashDistributedTable) {
 	string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
 
 	util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet) distributed by (i);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(1, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(1, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
 	util.query("select * from hawqregister;", 0);
 
 	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -rm hdfs://localhost:8020/hawq_register_hawq.paq"));
@@ -146,12 +146,12 @@ TEST_F(TestHawqRegister, TestNotParquetFile) {
 	string relativePath("/ManagementTool/test_hawq_register_not_paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_test_not_paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_test_not_paq"));
 
 	util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(1, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_test_not_paq"));
+	EXPECT_EQ(1, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_test_not_paq"));
 	util.query("select * from hawqregister;", 0);
 
 	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -rm hdfs://localhost:8020/hawq_register_test_not_paq"));
@@ -164,12 +164,12 @@ TEST_F(TestHawqRegister, TestNotParquetTable) {
 	string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
 
 	util.execute("create table hawqregister(i int);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(1, Command::getCommandStatus("hawq register postgres hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(1, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister hdfs://localhost:8020/hawq_register_hawq.paq"));
 	util.query("select * from hawqregister;", 0);
 
 	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -rm hdfs://localhost:8020/hawq_register_hawq.paq"));
@@ -182,7 +182,7 @@ TEST_F(TestHawqRegister, TestFileNotExist) {
 	util.execute("create table hawqregister(i int);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(1, Command::getCommandStatus("hawq register postgres hawqregister /hdfs://localhost:8020hawq_register_file_not_exist"));
+	EXPECT_EQ(1, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + " hawqregister /hdfs://localhost:8020hawq_register_file_not_exist"));
 	util.query("select * from hawqregister;", 0);
 
 	util.execute("drop table hawqregister;");
@@ -194,12 +194,12 @@ TEST_F(TestHawqRegister, TestNotHDFSPath) {
 	string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
 	string filePath = rootPath + relativePath;
 
-	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
+	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath + " hdfs://localhost:8020/hawq_register_hawq.paq"));
 
 	util.execute("create table hawqregister(i int);");
 	util.query("select * from hawqregister;", 0);
 
-	EXPECT_EQ(1, Command::getCommandStatus("hawq register postgres hawqregister /hawq_register_hawq.paq"));
+	EXPECT_EQ(1, Command::getCommandStatus("hawq register " + (string) HAWQ_DB + "hawqregister /hawq_register_hawq.paq"));
 	util.query("select * from hawqregister;", 0);
 
 	EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -rm hdfs://localhost:8020/hawq_register_hawq.paq"));