You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2017/01/19 15:31:54 UTC

[2/3] incubator-trafodion git commit: update based on review comment about better error message.

update based on review comment about better error message.

Also, fixed test scripts to drop/cleanup objects


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/52d050f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/52d050f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/52d050f6

Branch: refs/heads/master
Commit: 52d050f65098c54210c0d2c5a18b380340674331
Parents: 8b5e8a0
Author: Anoop Sharma <an...@esgyn.com>
Authored: Wed Jan 18 20:53:42 2017 +0000
Committer: Anoop Sharma <an...@esgyn.com>
Committed: Wed Jan 18 20:53:42 2017 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExeUtil.cpp   |  5 ++++-
 core/sql/regress/hive/EXPECTED007   |  4 ++--
 core/sql/regress/hive/TEST007       |  2 ++
 core/sql/regress/privs2/EXPECTED129 | 36 ++++++++++++++++----------------
 4 files changed, 26 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/52d050f6/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index c568081..c59f323 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -4473,7 +4473,10 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
   if (isHbase_ || externalTable || isVolatile)
     return boundExpr;
 
-  *CmpCommon::diags() << DgSqlCode(-3242) << DgString0("DDL operations can only be done on trafodion or external tables.");
+  if (isView_ && (isCreate_ || isDrop_))
+    *CmpCommon::diags() << DgSqlCode(-3242) << DgString0("DDL views can only be created or dropped in trafodion schema.");
+  else
+    *CmpCommon::diags() << DgSqlCode(-3242) << DgString0("DDL operations can only be done on trafodion or external tables.");
   bindWA->setErrStatus();
   return NULL;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/52d050f6/core/sql/regress/hive/EXPECTED007
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED007 b/core/sql/regress/hive/EXPECTED007
index 2b46f87..85e0dfc 100644
--- a/core/sql/regress/hive/EXPECTED007
+++ b/core/sql/regress/hive/EXPECTED007
@@ -76,7 +76,7 @@ CREATE EXTERNAL TABLE THIVE1
 >>invoke trafodion.sch.vhivehbase;
 
 -- Definition of Trafodion view TRAFODION.SCH.VHIVEHBASE
--- Definition current  Mon Jan 16 18:43:12 2017
+-- Definition current  Wed Jan 18 20:20:24 2017
 
   (
     AA                               INT DEFAULT NULL
@@ -302,7 +302,7 @@ CREATE TABLE THIVE2
 >>-- traf view must be in traf cat/sch
 >>create view vhive5 as select * from thive1;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/52d050f6/core/sql/regress/hive/TEST007
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST007 b/core/sql/regress/hive/TEST007
index 6de9ea9..2fedc47 100644
--- a/core/sql/regress/hive/TEST007
+++ b/core/sql/regress/hive/TEST007
@@ -43,6 +43,8 @@ drop view trafodion.sch.vhive3 cascade;
 drop view trafodion.sch.vhive4 cascade;
 drop view trafodion.sch.vhive5 cascade;
 drop view trafodion.sch.vhive6 cascade;
+drop external table thive1 for hive.hive.thive1 cascade;
+cleanup table trafodion."_HV_HIVE_".thive1;
 drop external table thive2 for hive.hive.thive2 cascade;
 sh echo "drop table thive1;" > TEST007_junk;
 sh regrhive.ksh -f TEST007_junk;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/52d050f6/core/sql/regress/privs2/EXPECTED129
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/EXPECTED129 b/core/sql/regress/privs2/EXPECTED129
index b51852b..5cc90c4 100644
--- a/core/sql/regress/privs2/EXPECTED129
+++ b/core/sql/regress/privs2/EXPECTED129
@@ -608,7 +608,7 @@ X
 >>
 >>create view v3bd as select b,d from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -620,7 +620,7 @@ X
 
 >>create view v3b as select b from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -632,7 +632,7 @@ X
 
 >>create view v3d as select d from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -644,7 +644,7 @@ X
 
 >>create view v3bbbbbb (c1,c2,c3,c4,c5,c6) as select b,b,b,b,b,b from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -659,45 +659,45 @@ X
 >>
 >>create view v3ac as select a,c from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v3a as select a from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v3c as select c from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>
 >>create view v3 as select * from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>
 >>create view v3ab as select a,b from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v3abcd as select a,b,c,d from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v3bc as select b,c from t3;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -706,7 +706,7 @@ X
 >>
 >>create view v34bf as select b,f from t3, t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -718,7 +718,7 @@ X
 
 >>create view v34bdfg as select b,d,f,g from t3, t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -730,7 +730,7 @@ X
 
 >>create view v34bdfg2 (c1,c2,c3,c4) as select b,d,f,g from t3, t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -742,7 +742,7 @@ X
 
 >>create view v34gb as select g,b from t3, t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -757,19 +757,19 @@ X
 >>
 >>create view v34 as select * from t3,t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v34af as select a,f from t3, t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>create view v34bh as select b,h from t3,t4;
 
-*** ERROR[3242] This statement is not supported. Reason: DDL operations can only be done on trafodion or external tables.
+*** ERROR[3242] This statement is not supported. Reason: DDL views can only be created or dropped in trafodion schema.
 
 *** ERROR[8822] The statement was not prepared.