You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2015/09/08 21:33:27 UTC

[1/4] incubator-trafodion git commit: JIRA TRAFODION-19 && TRAFODION-1483

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master e0b7601dd -> cef057381


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/regress/hive/EXPECTED009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED009 b/core/sql/regress/hive/EXPECTED009
index 89c004a..77519c2 100644
--- a/core/sql/regress/hive/EXPECTED009
+++ b/core/sql/regress/hive/EXPECTED009
@@ -5,19 +5,29 @@
 
 --- SQL command prepared.
 >>
+>>prepare get_hb_schemas from
++>select schema_name from "_MD_".objects
++>where schema_name like '_HB_%' and object_type = 'PS';
+
+--- SQL command prepared.
+>>
 >>obey TEST009(create_db);
 >>
 >>-- The version of hive installed does not support special characters
 >>-- TDB - when hive is upgraded to a new version, add tests where
 >>--   the hive schema contains special characters
 >>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql;
+>>sh regrhbase.ksh $REGRTSTDIR/TEST009_create_hbase_objects.hbase &> $REGRRUNDIR/LOG009_create_hbase_tables.log ;
 >>
->>-- make sure no external hive schema exist in Trafodion
+>>-- make sure no external schemas exist in Trafodion
 >>execute get_hv_schemas;
 
 --- 0 row(s) selected.
+>>execute get_hb_schemas;
+
+--- 0 row(s) selected.
 >>
->>obey TEST009(tests);
+>>obey TEST009(test_hive1);
 >>-- create external tables for precreated tables
 >>create external table customer for hive.hive.customer;
 
@@ -82,8 +92,8 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".ITEM
     I_ITEM_SK                        INT DEFAULT NULL
   , I_ITEM_ID                        VARCHAR(32000 BYTES) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL
-  , I_REC_START_DATE                 TIMESTAMP(0) DEFAULT NULL
-  , I_REC_END_DATE                   TIMESTAMP(0) DEFAULT NULL
+  , I_REC_START_DATE                 TIMESTAMP(6) DEFAULT NULL
+  , I_REC_END_DATE                   TIMESTAMP(6) DEFAULT NULL
   , I_ITEM_DESC                      VARCHAR(32000 BYTES) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL
   , I_CURRENT_PRICE                  REAL DEFAULT NULL
@@ -258,7 +268,7 @@ A            B            C
 
 --- 10 row(s) selected.
 >>
->>-- accesses to the external name should be prohibited
+>>-- fails since accesses to the external name are prohibited
 >>select * from trafodion."_HV_SCH_T009_".t009t1;
 
 *** ERROR[4258] Trying to access external table TRAFODION."_HV_SCH_T009_".T009T1 through its external name format. Please use the native table name.
@@ -266,10 +276,301 @@ A            B            C
 *** ERROR[8822] The statement was not prepared.
 
 >>
+>>set schema "_HV_HIVE_";
+
+--- SQL operation complete.
+>>
+>>-- all these creates should fail, they are not supported yet
+>>create table hive_customer like hive.hive.customer;
+
+*** ERROR[1118] Creating object TRAFODION."_HV_HIVE_".HIVE_CUSTOMER is not allowed in a reserved system schema.
+
+--- SQL operation failed with errors.
+>>create table newtable1 like hive.hive.customer;
+
+*** ERROR[1118] Creating object TRAFODION."_HV_HIVE_".NEWTABLE1 is not allowed in a reserved system schema.
+
+--- SQL operation failed with errors.
+>>create table newtable2 like customer;
+
+*** ERROR[1118] Creating object TRAFODION."_HV_HIVE_".NEWTABLE2 is not allowed in a reserved system schema.
+
+--- SQL operation failed with errors.
+>>create table newtable3 (a int);
+
+*** ERROR[1118] Creating object TRAFODION."_HV_HIVE_".NEWTABLE3 is not allowed in a reserved system schema.
+
+--- SQL operation failed with errors.
+>>get tables;
+
+Tables in Schema TRAFODION._HV_HIVE_
+====================================
+
+CUSTOMER
+ITEM
+PROMOTION
+
+--- SQL operation complete.
+>>
+>>-- test creates with a different default schema
+>>create schema hive_t009;
+
+--- SQL operation complete.
+>>set schema hive_t009;
+
+--- SQL operation complete.
+>>
+>>-- these creates fail
+>>create table hive_customer like hive.hive.customer;
+
+*** ERROR[1010] The statement just entered is currently not supported.
+
+--- SQL operation failed with errors.
+>>create table newtable1 like hive.hive.customer;
+
+*** ERROR[1010] The statement just entered is currently not supported.
+
+--- SQL operation failed with errors.
+>>create external table seabase.customer like hive.hive.customer;
+
+*** ERROR[1180] Trying to create an external HIVE table with a different schema or table name (SEABASE) than the source table (HIVE).  The external schema and table name must be the same as the source.
+
+--- SQL operation failed with errors.
+>>create external table customer1 like hive.hive.customer;
+
+*** ERROR[1180] Trying to create an external HIVE table with a different schema or table name (CUSTOMER1) than the source table (CUSTOMER).  The external schema and table name must be the same as the source.
+
+--- SQL operation failed with errors.
+>>create table t009t1 like "_HV_SCH_T009_".t009t1;
+
+*** ERROR[1010] The statement just entered is currently not supported.
+
+--- SQL operation failed with errors.
+>>create table t009t2 as select * from "_HV_SCH_T009_".t009t2;
+
+*** ERROR[4258] Trying to access external table TRAFODION."_HV_SCH_T009_".T009T2 through its external name format. Please use the native table name.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-- this create succeeds
+>>create table t009t1 as select * from hive.sch_t009.t009t1;
+
+--- 10 row(s) inserted.
+>>
+>>get tables;
+
+Tables in Schema TRAFODION.HIVE_T009
+====================================
+
+T009T1
+
+--- SQL operation complete.
+>>drop table t009t1;
+
+--- SQL operation complete.
+>>
 >>drop external table "_HV_HIVE_".customer;
 
 --- SQL operation complete.
 >>drop external table item for hive.hive.item;
 
 --- SQL operation complete.
+>>
+>>obey TEST009(test_hive2);
+>>-- drop data from the hive table and recreate with 4 columns
+>>-- this causes the external table to be invalid
+>>
+>>-- cleanup data from the old table, and create/load data with additional column
+>>sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
+>>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql;
+>>
+>>-- should fail - column mismatch
+>>select count(*) from hive.sch_t009.t009t1;
+
+*** ERROR[3078] The column list for HIVE.SCH_T009.T009T1 does not match its external table representation defined as TRAFODION."_HV_SCH_T009_".T009T1.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>sh sqlci -i "TEST009(select_stmts)";
+>>select * from hive.sch_t009.t009t1;
+
+*** ERROR[3078] The column list for HIVE.SCH_T009.T009T1 does not match its external table representation defined as TRAFODION."_HV_SCH_T009_".T009T1.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select * from hive.sch_t009.t009t2;
+
+A            B            C          
+-----------  -----------  -----------
+
+         10           15           10
+          9           26           10
+          8           26           12
+          7           24            4
+          6            4           12
+          5            8            5
+          4            7            6
+          3           18            9
+          2            9            4
+          1            9           12
+
+--- 10 row(s) selected.
+>>
+>>exit;
+
+End of MXCI Session
+
+>>
+>>-- drop and recreate external table
+>>select * from table(natablecacheentries('user','local')) ;
+
+ROW_ID      CATALOG_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      SCHEMA_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                            OBJECT_NAME
+----------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+         1  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _MD_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            OBJECTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
+         2  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_HIVE_                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                            PROMOTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+         3  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_SCH_T009_                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                            T009T1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+         4  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_SCH_T009_                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                            T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+         5  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            ITEM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+         6  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            PROMOTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+         7  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                            T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+         8  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                            T009T1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+
+--- 8 row(s) selected.
+>>drop external table t009t1 for hive.sch_t009.t009t1;
+
+--- SQL operation complete.
+>>get tables in schema "_HV_SCH_T009_";
+
+Tables in Schema TRAFODION._HV_SCH_T009_
+========================================
+
+T009T2
+
+--- SQL operation complete.
+>>select * from table(natablecacheentries('user','local')) ;
+
+ROW_ID      CATALOG_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      SCHEMA_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                            OBJECT_NAME
+----------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+         1  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _MD_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            OBJECTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
+         2  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_HIVE_                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                            PROMOTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+         3  TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_SCH_T009_                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                            T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+         4  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            ITEM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+         5  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                            PROMOTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+         6  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                            T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+         7  HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                            T009T1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+
+--- 7 row(s) selected.
+>>create external table t009t1 for hive.sch_t009.t009t1;
+
+--- SQL operation complete.
+>>
+>>-- select should now succeed
+>>select count(*) from hive.sch_t009.t009t1;
+
+(EXPR)              
+--------------------
+
+                  10
+
+--- 1 row(s) selected.
+>>
+>>obey TEST009(test_hbase);
+>>-- create external tables for precreated tables
+>>create external table "baseball" for hbase."_ROW_"."baseball";
+
+--- SQL operation complete.
+>>create external table "baseball" for hbase."_CELL_"."baseball";
+
+--- SQL operation complete.
+>>
+>>-- should create schemas called "_HB__ROW__" and "_HB__CELL__"
+>>execute get_hb_schemas;
+
+SCHEMA_NAME
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+_HB__ROW__                                                                                                                                                                                                                                                      
+_HB__CELL__                                                                                                                                                                                                                                                     
+
+--- 2 row(s) selected.
+>>
+>>-- Verify tables were created
+>>showddl trafodion."_HB__ROW__"."baseball";
+
+CREATE EXTERNAL TABLE TRAFODION."_HB__ROW__"."baseball"
+  (
+    ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  , COLUMN_DETAILS                   VARCHAR(10000) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  )
+;
+
+--- SQL operation complete.
+>>showddl trafodion."_HB__CELL__"."baseball";
+
+CREATE EXTERNAL TABLE TRAFODION."_HB__CELL__"."baseball"
+  (
+    ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  , COL_FAMILY                       VARCHAR(100) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  , COL_NAME                         VARCHAR(100) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  , COL_TIMESTAMP                    LARGEINT DEFAULT NULL NOT NULL NOT
+      DROPPABLE
+  , COL_VALUE                        VARCHAR(1000) CHARACTER SET ISO88591
+      COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
+  )
+;
+
+--- SQL operation complete.
+>>
+>>select count(*) from hbase."_ROW_"."baseball";
+
+(EXPR)              
+--------------------
+
+                   3
+
+--- 1 row(s) selected.
+>>select count(*) from hbase."_CELL_"."baseball";
+
+(EXPR)              
+--------------------
+
+                  27
+
+--- 1 row(s) selected.
+>>
+>>select left(row_id, 10) as row_id, left(column_display(column_details, ('teams:team_number', 'games:visitor_team', 'games:game_time')), 100) as cols from hbase."_ROW_"."baseball";
+
+ROW_ID      COLS
+----------  ----------------------------------------------------------------------------------------------------
+
+1           games:game_time =>  2015-10-23 19:30:30 , games:visitor_team =>  2 , teams:team_number =>  1        
+2           games:game_time =>  2015-10-24 19:30:30 , games:visitor_team =>  3 , teams:team_number =>  2        
+3           games:game_time =>  2015-10-25 19:30:30 , games:visitor_team =>  4 , teams:team_number =>  3        
+
+--- 3 row(s) selected.
+>>
+>>-- fails since accesses to the external name are prohibited
+>>select * from trafodion."_HB__ROW__"."baseball";
+
+*** ERROR[4258] Trying to access external table TRAFODION."_HB__ROW__"."baseball" through its external name format. Please use the native table name.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>drop external table trafodion."_HB__ROW__"."baseball";
+
+--- SQL operation complete.
+>>drop external table "baseball" for hbase."_CELL_"."baseball";
+
+--- SQL operation complete.
+>>
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/regress/hive/TEST009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST009 b/core/sql/regress/hive/TEST009
index 292ac65..689a886 100755
--- a/core/sql/regress/hive/TEST009
+++ b/core/sql/regress/hive/TEST009
@@ -21,7 +21,6 @@
 --
 --   create external table
 --   drop external table
---   granting/revoking privileges on hive table
 --
 -- When local hadoop is executed, a set of hive tables in the hive default
 -- schema are created.  This test assumes that the following hive tables 
@@ -30,14 +29,15 @@
 --     item
 --     promotion
 --
--- This test also requires several additional tests in different hive schemas
 -- ============================================================================
 
 obey TEST009(clean_up);
 log LOG009 clear;
 obey TEST009(set_up);
 obey TEST009(create_db);
-obey TEST009(tests);
+obey TEST009(test_hive1);
+obey TEST009(test_hive2);
+obey TEST009(test_hbase);
 log;
 obey TEST009(clean_up);
 exit;
@@ -45,15 +45,20 @@ exit;
 ?section clean_up
 
 -- remove schemas from Trafodion
--- for now, parserflags need to be set to drop hv schemas:
-set parserflags 131072;
 drop schema if exists "_HV_HIVE_" cascade;
 drop schema if exists "_HV_SCH_T009_" cascade;
+drop schema if exists hive_t009 cascade;
 
 -- remove data from hdfs
 sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
 sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t2/*;
 
+-- drop hbase tables
+drop schema if exists "_HB__ROW__" cascade;
+drop schema if exists "_HB__CELL__" cascade;
+
+-- remove table from hbase
+drop hbase table "baseball";
 
 ?section create_db
 
@@ -61,16 +66,22 @@ sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t2/*;
 -- TDB - when hive is upgraded to a new version, add tests where
 --   the hive schema contains special characters
 sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql;
+sh regrhbase.ksh $REGRTSTDIR/TEST009_create_hbase_objects.hbase &> $REGRRUNDIR/LOG009_create_hbase_tables.log ;
 
--- make sure no external hive schema exist in Trafodion
+-- make sure no external schemas exist in Trafodion
 execute get_hv_schemas;
+execute get_hb_schemas;
 
 ?section set_up
 prepare get_hv_schemas from
 select schema_name from "_MD_".objects
 where schema_name like '_HV_%' and object_type = 'PS';
 
-?section tests
+prepare get_hb_schemas from
+select schema_name from "_MD_".objects
+where schema_name like '_HB_%' and object_type = 'PS';
+
+?section test_hive1
 -- create external tables for precreated tables
 create external table customer for hive.hive.customer;
 create external table item for hive.hive.item;
@@ -99,8 +110,87 @@ select count(*) from hive.hive.promotion;
 select * from hive.sch_t009.t009t1;
 select * from hive.sch_t009.t009t2;
 
--- accesses to the external name should be prohibited
+-- fails since accesses to the external name are prohibited
 select * from trafodion."_HV_SCH_T009_".t009t1;
 
+set schema "_HV_HIVE_";
+
+-- all these creates should fail, they are not supported yet
+create table hive_customer like hive.hive.customer;
+create table newtable1 like hive.hive.customer;
+create table newtable2 like customer;
+create table newtable3 (a int);
+get tables;
+
+-- test creates with a different default schema
+create schema hive_t009;
+set schema hive_t009;
+
+-- these creates fail
+create table hive_customer like hive.hive.customer;
+create table newtable1 like hive.hive.customer;
+create external table seabase.customer like hive.hive.customer;
+create external table customer1 like hive.hive.customer;
+create table t009t1 like "_HV_SCH_T009_".t009t1;
+create table t009t2 as select * from "_HV_SCH_T009_".t009t2;
+
+-- this create succeeds
+create table t009t1 as select * from hive.sch_t009.t009t1;
+
+get tables;
+drop table t009t1;
+
 drop external table "_HV_HIVE_".customer;
 drop external table item for hive.hive.item;
+
+?section test_hive2
+-- drop data from the hive table and recreate with 4 columns
+-- this causes the external table to be invalid
+
+-- cleanup data from the old table, and create/load data with additional column
+sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
+sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql;
+
+-- should fail - column mismatch
+select count(*) from hive.sch_t009.t009t1;
+
+sh sqlci -i "TEST009(select_stmts)";
+
+-- drop and recreate external table
+select * from table(natablecacheentries('user','local')) ;
+drop external table t009t1 for hive.sch_t009.t009t1;
+get tables in schema "_HV_SCH_T009_";
+select * from table(natablecacheentries('user','local')) ;
+create external table t009t1 for hive.sch_t009.t009t1;
+
+-- select should now succeed
+select count(*) from hive.sch_t009.t009t1;
+
+?section select_stmts
+log LOG009;
+select * from hive.sch_t009.t009t1;
+select * from hive.sch_t009.t009t2;
+
+?section test_hbase
+-- create external tables for precreated tables
+create external table "baseball" for hbase."_ROW_"."baseball";
+create external table "baseball" for hbase."_CELL_"."baseball";
+
+-- should create schemas called "_HB__ROW__" and "_HB__CELL__"
+execute get_hb_schemas;
+
+-- Verify tables were created
+showddl trafodion."_HB__ROW__"."baseball";
+showddl trafodion."_HB__CELL__"."baseball";
+
+select count(*) from hbase."_ROW_"."baseball";
+select count(*) from hbase."_CELL_"."baseball";
+
+select left(row_id, 10) as row_id, left(column_display(column_details, ('teams:team_number', 'games:visitor_team', 'games:game_time')), 100) as cols from hbase."_ROW_"."baseball";
+
+-- fails since accesses to the external name are prohibited
+select * from trafodion."_HB__ROW__"."baseball";
+
+drop external table trafodion."_HB__ROW__"."baseball";
+drop external table "baseball" for hbase."_CELL_"."baseball";
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/regress/hive/TEST009_create_hbase_objects.hbase
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST009_create_hbase_objects.hbase b/core/sql/regress/hive/TEST009_create_hbase_objects.hbase
new file mode 100644
index 0000000..fd6ac97
--- /dev/null
+++ b/core/sql/regress/hive/TEST009_create_hbase_objects.hbase
@@ -0,0 +1,55 @@
+#######################################################################
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#######################################################################
+create 'baseball', 'games', 'teams'
+put 'baseball', '1', 'games:team_number', ' 1 '
+put 'baseball', '1', 'games:visitor_team', ' 2 '
+put 'baseball', '1', 'games:game_number', ' 1 '
+put 'baseball', '1', 'games:game_time', ' 2015-10-23 19:30:30 '
+put 'baseball', '1', 'games:game_location', ' California '
+put 'baseball', '2', 'games:team_number', ' 1 '
+put 'baseball', '2', 'games:visitor_team', ' 3 '
+put 'baseball', '2', 'games:game_number', ' 2 '
+put 'baseball', '2', 'games:game_time', ' 2015-10-24 19:30:30 '
+put 'baseball', '2', 'games:game_location', ' California '
+put 'baseball', '3', 'games:team_number', ' 1 '
+put 'baseball', '3', 'games:visitor_team', ' 4 '
+put 'baseball', '3', 'games:game_number', ' 3 '
+put 'baseball', '3', 'games:game_time', ' 2015-10-25 19:30:30 '
+put 'baseball', '3', 'games:game_location', ' Oklahoma '
+
+put 'baseball', '1', 'teams:team_number', ' 1 '
+put 'baseball', '1', 'teams:team_name', ' White Socks '
+put 'baseball', '1', 'teams:team_contact', ' Sam '
+put 'baseball', '1', 'teams:contact_number', ' 1234561234 '
+put 'baseball', '2', 'teams:team_number', ' 2 '
+put 'baseball', '2', 'teams:team_name', ' Giants '
+put 'baseball', '2', 'teams:team_contact', ' Joe '
+put 'baseball', '2', 'teams:contact_number', ' 5102839483 '
+put 'baseball', '3', 'teams:team_number', ' 3 '
+put 'baseball', '3', 'teams:team_name', ' Cardinals '
+put 'baseball', '3', 'teams:team_contact', ' Stella '
+put 'baseball', '3', 'teams:contact_number', ' 9513849384 '
+
+scan 'baseball'
+exit
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
index e3ad51e..b0c5e1b 100644
--- a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
+++ b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
@@ -162,7 +162,7 @@ enum CatErrorCode { CAT_FIRST_ERROR = 1000
                   , CAT_WRONG_API_REQUEST                         = 1128
                   , CAT_OPERATION_NOT_ALLOWED_ON_VP_TABLE         = 1129
                   , CAT_DEFAULT_REQUIRED                          = 1130
-                  , CAT_CANNOT_ADD_COL_TO_ENTRY_SEQ_TABLE         = 1131
+                  , CAT_EXTERNAL_TABLE_EXISTS                     = 1131
                   , CAT_CANNOT_BE_DEFAULT_NULL_AND_NOT_NULL       = 1132
                   , CAT_ONLY_SUPER_CAN_DO_THIS                    = 1133
                   , CAT_LIST_OF_LOCKS_EXIST                       = 1134

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index fd2392b..264577d 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -2569,8 +2569,9 @@ short CmpDescribeSeabaseTable (
   const NAString& tableName =
     dtName.getQualifiedNameObj().getQualifiedNameAsAnsiString(TRUE);
  
-  // set inDDL to try to allow Hive External tables to be described
-  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), TRUE/*inDDL*/);
+  // set isExternalTable to allow Hive External tables to be described
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  bindWA.setAllowExternalTables (TRUE);
   NATable *naTable = bindWA.getNATable((CorrName&)dtName); 
   TableDesc *tdesc = NULL;
   if (naTable == NULL || bindWA.errStatus())
@@ -2583,7 +2584,11 @@ short CmpDescribeSeabaseTable (
     }
 
   if (NOT naTable->isHbaseTable())
-    return -1;
+    {
+      if (CmpCommon::diags()->getNumber() == 0)
+        *CmpCommon::diags() << DgSqlCode(-CAT_UNSUPPORTED_COMMAND_ERROR);
+      return -1;
+    }
 
   NABoolean isVolatile = naTable->isVolatileTable();
   NABoolean isExternalTable = naTable->isExternalTable();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index f0ec29a..92e9c88 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -909,11 +909,11 @@ class CmpSeabaseDDL
 			      StmtDDLCreateTable                  * createTableNode,
 			      NAString &currCatName, NAString &currSchName);
 
-  short createSeabaseTableExternalHive(
-                                       ExeCliInterface &cliInterface,
-                                       StmtDDLCreateTable * createTableNode,
-                                       NAString &currCatName,
-                                       NAString &currSchName);
+  short createSeabaseTableExternal(
+                                   ExeCliInterface &cliInterface,
+                                   StmtDDLCreateTable * createTableNode,
+                                   const ComObjectName &tgtTableName,
+                                   const ComObjectName &srcTableName);
 
   short dropSeabaseTable2(
                           ExeCliInterface *cliInterface,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 71f29ce..1168371 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -1026,8 +1026,12 @@ char volatileString[20] = {0};
    if (isVolatile)
       strcpy(volatileString,"VOLATILE");
 
-   str_sprintf(buf,"DROP %s TABLE \"%s\".\"%s\".\"%s\" CASCADE",
-               volatileString,catalogName,schemaName,objectName);
+   if (ComIsTrafodionExternalSchemaName(schemaName))
+     str_sprintf(buf,"DROP EXTERNAL TABLE \"%s\" FOR \"%s\".\"%s\".\"%s\" CASCADE",
+                 objectName,catalogName,schemaName,objectName);
+   else
+     str_sprintf(buf,"DROP %s TABLE \"%s\".\"%s\".\"%s\" CASCADE",
+                 volatileString,catalogName,schemaName,objectName);
  
 ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 2e00b09..454e9ac 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -249,6 +249,14 @@ void CmpSeabaseDDL::createSeabaseTableLike(
   ComObjectName srcTableName(createTableNode->getLikeSourceTableName(), COM_TABLE_NAME);
   srcTableName.applyDefaults(currCatAnsiName, currSchAnsiName);
   
+  // If source table is external, return an error.  
+  // TBD - allow create table like a native (external) HIVE or HBASE table
+  if (ComIsTrafodionExternalSchemaName(srcTableName.getSchemaNamePart().getInternalName()))
+    {
+      *SqlParser_Diags << DgSqlCode(-CAT_UNSUPPORTED_COMMAND_ERROR);
+      return;
+    }
+  
   CorrName cn(srcTableName.getObjectNamePart().getInternalName(),
               STMTHEAP,
               srcTableName.getSchemaNamePart().getInternalName(),
@@ -379,84 +387,40 @@ void CmpSeabaseDDL::createSeabaseTableLike(
 }
 
 // ----------------------------------------------------------------------------
-// Method: createSeabaseTableExternalHive
+// Method: createSeabaseTableExternal
 //
-// This method creates a Trafodion table that represents a Hive table 
+// This method creates a Trafodion table that represents a Hive or HBase table 
 //
 // in:
 //   cliInterface - references to the cli execution structure
 //   createTableNode - representation of the CREATE TABLE statement
-//   currCatName - catalog name to use, if not specified
-//   currSchName - schema name to use, if not specified
+//   tgtTableName - the Trafodion external table name to create
+//   srcTableName - the native source table
 //
-// returns:  0 - successful, -1 error, -2 error requiring cleanup
+// returns:  0 - successful, -1 error
 //
 // any error detected is added to the diags area
 // ---------------------------------------------------------------------------- 
-short CmpSeabaseDDL::createSeabaseTableExternalHive(
+short CmpSeabaseDDL::createSeabaseTableExternal(
   ExeCliInterface &cliInterface,
   StmtDDLCreateTable * createTableNode,
-  NAString &currCatName, 
-  NAString &currSchName)
+  const ComObjectName &tgtTableName,
+  const ComObjectName &srcTableName) 
 {
-  Lng32 retcode = 0;
-
-  ComObjectName srcTableName(createTableNode->getLikeSourceTableName(), COM_TABLE_NAME);
-  srcTableName.applyDefaults(currCatName, currSchName);
-
-  // For the target object, use TRAFODION as the default catalog and the source
-  // table's schema name as the default schema
-  ComObjectName tgtTableName(createTableNode->getTableName(), COM_TABLE_NAME);
-  ComAnsiNamePart currCatAnsiName(getSystemCatalog());
-  ComAnsiNamePart currSchAnsiName(srcTableName.getSchemaNamePart().getExternalName());
-  tgtTableName.applyDefaults(currCatName, currSchAnsiName);
-
-  // For now the object and schema name for the target table must match the
-  // object and schema name for the source table
-  if (tgtTableName.getObjectNamePart().getExternalName() != 
-      srcTableName.getObjectNamePart().getExternalName()) 
-    {
-      *CmpCommon::diags()
-        << DgSqlCode(-CAT_EXTERNAL_NAME_MISMATCH)
-        << DgTableName(tgtTableName.getObjectNamePart().getExternalName())
-        << DgTableName(srcTableName.getObjectNamePart().getExternalName());
-      return -1;
-    }
-
-  // Verify that the name with prepending is not too long
-  // sizeof(HIVE_EXT_SCHEMA_PREFIX) returns the length of the prefix plus
-  // one for the null character.  This works since we add a trailing 
-  // underscore to the generated name
-  NAString adjustedSchName = srcTableName.getSchemaNamePartAsAnsiString(TRUE);
-  if ((adjustedSchName.length() + sizeof(HIVE_EXT_SCHEMA_PREFIX)) > 
-      ComMAX_ANSI_IDENTIFIER_INTERNAL_LEN) 
-    {
-      *CmpCommon::diags()
-        << DgSqlCode(-CAT_EXTERNAL_SCHEMA_NAME_TOO_LONG)
-        << DgTableName(srcTableName.getSchemaNamePartAsAnsiString(FALSE))
-        << DgInt0(ComMAX_ANSI_IDENTIFIER_INTERNAL_LEN - sizeof(HIVE_EXT_SCHEMA_PREFIX)); 
-      return -1;
-    }
+  Int32 retcode = 0;
 
-  // Convert the target schema name to the special HIVE schema, prepend 
-  // HIVE_EXT_SCHEMA_PREFIX and a final underscore
-  adjustedSchName.prepend(HIVE_EXT_SCHEMA_PREFIX);
-  adjustedSchName.append ("_");
-  ComAnsiNamePart adjustedSchAnsiName(adjustedSchName, ComAnsiNamePart::INTERNAL_FORMAT);
-  tgtTableName.setSchemaNamePart (adjustedSchAnsiName);
+  NABoolean isHive = tgtTableName.isExternalHive(); 
 
   // go create the schema - if it does not already exist.
   NAString createSchemaStmt ("CREATE SCHEMA IF NOT EXISTS ");
-  createSchemaStmt += adjustedSchAnsiName.getExternalName();
+  createSchemaStmt += tgtTableName.getSchemaNamePartAsAnsiString();
   if (isAuthorizationEnabled())
     {
       createSchemaStmt += " AUTHORIZATION ";
-      createSchemaStmt += DB__HIVEROLE;
+      createSchemaStmt += (isHive) ? DB__HIVEROLE : DB__HBASEROLE; 
     }
 
-  Lng32 cliRC = 0;
-
-  cliRC = cliInterface.executeImmediate((char*)createSchemaStmt.data());
+  Lng32 cliRC = cliInterface.executeImmediate((char*)createSchemaStmt.data());
   if (cliRC < 0)
     {
       cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
@@ -491,17 +455,6 @@ short CmpSeabaseDDL::createSeabaseTableExternalHive(
               srcTableName.getSchemaNamePart().getInternalName(),
               srcTableName.getCatalogNamePart().getInternalName());
 
-  // Get a description of the source table
-  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
-  NATable *naTable = bindWA.getNATable(cnSrc);
-  if (naTable == NULL || bindWA.errStatus())
-    {
-      *CmpCommon::diags()
-        << DgSqlCode(-4082)
-        << DgTableName(cnSrc.getExposedNameAsAnsiString());
-      return -1;
-    }
-
   // build the structures needed to create the table
   // tableInfo contains data inserted into OBJECTS and TABLES
   ComTdbVirtTableTableInfo * tableInfo = new(STMTHEAP) ComTdbVirtTableTableInfo[1];
@@ -513,13 +466,23 @@ short CmpSeabaseDDL::createSeabaseTableExternalHive(
   tableInfo->validDef = 1;
   tableInfo->hbaseCreateOptions = NULL;
   tableInfo->numSaltPartns = 0;
-  tableInfo->rowFormat = COM_HIVE_EXTERNAL_FORMAT_TYPE;
-  tableInfo->objectFlags = SEABASE_OBJECT_IS_EXTERNAL_HIVE;
+  tableInfo->rowFormat = (isHive) ?  COM_HIVE_EXTERNAL_FORMAT_TYPE : 
+                                     COM_HBASE_EXTERNAL_FORMAT_TYPE;
+  tableInfo->objectFlags = (isHive) ?  SEABASE_OBJECT_IS_EXTERNAL_HIVE : 
+                                       SEABASE_OBJECT_IS_EXTERNAL_HBASE;
 
   if (isAuthorizationEnabled())
     {
-      tableInfo->objOwnerID = HIVE_ROLE_ID;
-      tableInfo->schemaOwnerID = HIVE_ROLE_ID;
+      if (srcTableName.isExternalHive())
+        {
+          tableInfo->objOwnerID = HIVE_ROLE_ID;
+          tableInfo->schemaOwnerID = HIVE_ROLE_ID;
+        }
+      else
+        {
+          tableInfo->objOwnerID = HBASE_ROLE_ID;
+          tableInfo->schemaOwnerID = HBASE_ROLE_ID;
+        }
     }
   else
     {
@@ -536,10 +499,24 @@ short CmpSeabaseDDL::createSeabaseTableExternalHive(
   NABoolean alignedFormat = FALSE;
   Lng32 serializedOption = -1;
 
+  Int32 numCols = 0;
+  ComTdbVirtTableColumnInfo * colInfoArray = NULL;
+        
+  // Get a description of the source table
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  NATable *naTable = bindWA.getNATable(cnSrc);
+  if (naTable == NULL || bindWA.errStatus())
+    {
+      *CmpCommon::diags()
+        << DgSqlCode(-4082)
+        << DgTableName(cnSrc.getExposedNameAsAnsiString());
+      return -1;
+    }
+
   // convert column array from NATable into a ComTdbVirtTableColumnInfo struct
   const NAColumnArray &naColArray = naTable->getNAColumnArray();
-  Lng32 numCols = naColArray.entries();
-  ComTdbVirtTableColumnInfo * colInfoArray = new(STMTHEAP) ComTdbVirtTableColumnInfo[numCols];
+  numCols = naColArray.entries();
+  colInfoArray = new(STMTHEAP) ComTdbVirtTableColumnInfo[numCols];
   for (CollIndex index = 0; index < numCols; index++)
     {
       const NAColumn *naCol = naColArray[index];
@@ -560,6 +537,7 @@ short CmpSeabaseDDL::createSeabaseTableExternalHive(
       colInfoArray[index].nullable = nullable;
       colInfoArray[index].charset = (SQLCHARSET_CODE)CharInfo::getCharSetEnum(charset);
       colInfoArray[index].precision = precision;
+      colInfoArray[index].scale = scale;
       colInfoArray[index].dtStart = dtStart;
       colInfoArray[index].dtEnd = dtEnd;
       colInfoArray[index].upshifted = upshifted;
@@ -603,7 +581,7 @@ short CmpSeabaseDDL::createSeabaseTableExternalHive(
       *CmpCommon::diags()
         << DgSqlCode(-CAT_UNABLE_TO_CREATE_OBJECT)
         << DgTableName(extTgtTableName);
-      return -2;
+      return -1;
     }
 
   // remove cached definition - this code exists in other create stmte,
@@ -1347,22 +1325,66 @@ short CmpSeabaseDDL::createSeabaseTable2(
   ComAnsiNamePart currSchAnsiName(currSchName);
   tableName.applyDefaults(currCatAnsiName, currSchAnsiName);
 
+  // Make some additional checks if creating an external table
+  ComObjectName *srcTableName = NULL;
   if (createTableNode->isExternal())
     {
-      // Convert the HIVE name to the external name
-      NABoolean getInternal (TRUE);
-      NAString adjustedSchName = tableName.getSchemaNamePartAsAnsiString(getInternal);
-      adjustedSchName.prepend(HIVE_EXT_SCHEMA_PREFIX);
-      adjustedSchName.append ("_");
-      ComAnsiNamePart adjustedSchAnsiName(adjustedSchName, ComAnsiNamePart::INTERNAL_FORMAT);
-      tableName.setSchemaNamePart (adjustedSchAnsiName);
+      // The schema name of the target table, if specified,  must match the 
+      // schema name of the source table
+      NAString origSchemaName = 
+        createTableNode->getOrigTableNameAsQualifiedName().getSchemaName();
+
+      srcTableName = new(STMTHEAP) ComObjectName
+          (createTableNode->getLikeSourceTableName(), COM_TABLE_NAME);
+      srcTableName->applyDefaults(currCatAnsiName, currSchAnsiName);
+
+      // Convert the native table name to its trafodion name
+      NAString tabName = ComConvertNativeNameToTrafName 
+        (srcTableName->getCatalogNamePartAsAnsiString(),
+         srcTableName->getSchemaNamePartAsAnsiString(),
+         tableName.getObjectNamePartAsAnsiString());
+                               
+      ComObjectName adjustedName(tabName, COM_TABLE_NAME);
+      NAString type = adjustedName.isExternalHive() ? "HIVE" : "HBASE";
+      tableName = adjustedName;
+
+      // Verify that the name with prepending is not too long
+      if (tableName.getSchemaNamePartAsAnsiString(TRUE).length() >
+          ComMAX_ANSI_IDENTIFIER_INTERNAL_LEN)
+        {
+          *CmpCommon::diags()
+            << DgSqlCode(-CAT_EXTERNAL_SCHEMA_NAME_TOO_LONG)
+            << DgString0(type.data())
+            << DgTableName(tableName.getSchemaNamePartAsAnsiString(FALSE))
+            << DgInt0(ComMAX_ANSI_IDENTIFIER_INTERNAL_LEN - sizeof(HIVE_EXT_SCHEMA_PREFIX));
+          return -1;
+        }
 
-      NAString adjustedCatName = getSystemCatalog();
-      ComAnsiNamePart adjustedCatAnsiName(adjustedCatName);
-      tableName.setCatalogNamePart (adjustedCatAnsiName);
+      if ((origSchemaName.length() > 0)&&
+          (origSchemaName != srcTableName->getSchemaNamePart().getExternalName()))
+      {
+        *CmpCommon::diags()
+          << DgSqlCode(-CAT_EXTERNAL_NAME_MISMATCH)
+          << DgString0 (type.data())
+          << DgTableName(origSchemaName)
+          << DgString1((srcTableName->getSchemaNamePart().getExternalName()));
+        return -1;
+      }
+              
+      // For now the object name of the target table must match the
+      // object name of the source table
+      if (tableName.getObjectNamePart().getExternalName() !=
+          srcTableName->getObjectNamePart().getExternalName())
+        {
+          *CmpCommon::diags()
+            << DgSqlCode(-CAT_EXTERNAL_NAME_MISMATCH)
+            << DgString0 (type.data())
+            << DgTableName(tableName.getObjectNamePart().getExternalName())
+            << DgString1((srcTableName->getObjectNamePart().getExternalName()));
+          return -1;
+        }
     }
 
-
   const NAString catalogNamePart = tableName.getCatalogNamePartAsAnsiString();
   const NAString schemaNamePart = tableName.getSchemaNamePartAsAnsiString(TRUE);
   const NAString objectNamePart = tableName.getObjectNamePartAsAnsiString(TRUE);
@@ -1424,13 +1446,14 @@ short CmpSeabaseDDL::createSeabaseTable2(
   // If creating an external table, go perform operation
   if (createTableNode->isExternal())
     {
-      retcode = createSeabaseTableExternalHive(cliInterface, createTableNode, currCatName, currSchName);
+      retcode = createSeabaseTableExternal
+        (cliInterface, createTableNode, tableName, *srcTableName);
       if (retcode != 0 && CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) == 0)
         SEABASEDDL_INTERNAL_ERROR("creating external HIVE table");
 
       deallocEHI(ehi);
       processReturn();
-      return -1;
+      return retcode;
     }
 
   ElemDDLColDefArray &colArray = createTableNode->getColDefArray();
@@ -1460,6 +1483,17 @@ short CmpSeabaseDDL::createSeabaseTable2(
      return -1;
   }
 
+  // If the schema name specified is external HIVE or HBase name, users cannot 
+  // create them.
+  if (ComIsTrafodionExternalSchemaName(schemaNamePart) &&
+      (!Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)))
+    {
+      // error.
+      *SqlParser_Diags << DgSqlCode(-CAT_CREATE_TABLE_NOT_ALLOWED_IN_SMD)
+                       << DgTableName(extTableName.data());
+      return -1;
+    }
+
   if (createTableNode->getIsLikeOptionSpecified())
     {
       createSeabaseTableLike(createTableNode, currCatName, currSchName);
@@ -2664,18 +2698,14 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 
   if (dropTableNode->isExternal())
     {
-      // Convert the HIVE name to the external name
-      NABoolean getInternal (TRUE);
-      NAString adjustedSchName = tableName.getSchemaNamePartAsAnsiString(getInternal);
-      adjustedSchName.prepend(HIVE_EXT_SCHEMA_PREFIX);
-      adjustedSchName.append ("_");
-      ComAnsiNamePart adjustedSchAnsiName(adjustedSchName, ComAnsiNamePart::INTERNAL_FORMAT);
-      tableName.setSchemaNamePart (adjustedSchAnsiName);
-  
-      NAString adjustedCatName = getSystemCatalog(); 
-      ComAnsiNamePart adjustedCatAnsiName(adjustedCatName);
-      tableName.setCatalogNamePart (adjustedCatAnsiName);
-      tabName = tableName.getExternalName();
+      // Convert the native name to its Trafodion form
+      tabName = ComConvertNativeNameToTrafName
+        (tableName.getCatalogNamePartAsAnsiString(),
+         tableName.getSchemaNamePartAsAnsiString(),
+         tableName.getObjectNamePartAsAnsiString());
+                               
+      ComObjectName adjustedName(tabName, COM_TABLE_NAME);
+      tableName = adjustedName;
     }
 
   NAString catalogNamePart = tableName.getCatalogNamePartAsAnsiString();
@@ -2684,8 +2714,9 @@ short CmpSeabaseDDL::dropSeabaseTable2(
   const NAString extTableName = tableName.getExternalName(TRUE);
   const NAString extNameForHbase = catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
 
-  // inDDL: true to allow an NATable entry to be created for an external table
-  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), TRUE/*inDDL*/);
+  // allowExternalTables: true to allow an NATable entry to be created for an external table
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  bindWA.setAllowExternalTables(TRUE);
  
   ExpHbaseInterface * ehi = allocEHI();
   if (ehi == NULL)
@@ -2831,7 +2862,6 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 
   // If this is an external (native HIVE or HBASE) table, then skip
   if (!isSeabaseExternalSchema(catalogNamePart, schemaNamePart))
-  //if (! (tableName.isExternalHive() || tableName.isExternalHbase()) )
     {
       HbaseStr hbaseTable;
       hbaseTable.val = (char*)extNameForHbase.data();
@@ -7813,6 +7843,9 @@ void CmpSeabaseDDL::dropNativeHbaseTable(
   const NAString schemaNamePart = tableName.getSchemaNamePartAsAnsiString(TRUE);
   const NAString objectNamePart = tableName.getObjectNamePartAsAnsiString(TRUE);
   
+  // TDB - add a check to see if there is an external HBASE table that should be
+  // removed
+
   ExpHbaseInterface * ehi = allocEHI();
   if (ehi == NULL)
     {
@@ -9337,7 +9370,8 @@ desc_struct * CmpSeabaseDDL::getSeabaseUserTableDesc(const NAString &catName,
 
       // if this is base table or index and hbase object doesn't exist, then this object
       // is corrupted.
-      if (!objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HIVE)
+      if (!objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HIVE &&
+          !objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HBASE)
         {
           if ((tableDesc->body.table_desc.objectType == COM_BASE_TABLE_OBJECT) &&
               (existsInHbase(extNameForHbase, ehi) == 0))


[3/4] incubator-trafodion git commit: Merge branch 'master' of github.com:apache/incubator-trafodion

Posted by su...@apache.org.
Merge branch 'master' of github.com:apache/incubator-trafodion


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

Branch: refs/heads/master
Commit: 569045b4fb816e598f5ec1e1bed45894aebf199d
Parents: 2e0b1dd 5d46472
Author: Roberta Marton <ro...@esgyn.com>
Authored: Fri Sep 4 17:11:13 2015 +0000
Committer: Roberta Marton <ro...@esgyn.com>
Committed: Fri Sep 4 17:11:13 2015 +0000

----------------------------------------------------------------------
 core/sql/optimizer/Cost.cpp              |  19 ++++
 core/sql/optimizer/Cost.h                |   2 +-
 core/sql/optimizer/ScanOptimizer.cpp     | 137 ++++++++++++++------------
 core/sql/optimizer/disjuncts.h           |   8 ++
 core/sql/optimizer/mdam.cpp              |  68 +++++++++++++
 core/sql/regress/compGeneral/EXPECTED042 |   8 +-
 core/sql/regress/seabase/EXPECTED011     |  84 ++++++++++++++--
 core/sql/regress/seabase/FILTER011       |   1 +
 core/sql/regress/seabase/TEST011         |   2 +
 install/installer/traf_config_setup      |   4 +-
 10 files changed, 257 insertions(+), 76 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-trafodion git commit: JIRA TRAFODION-19 && TRAFODION-1483

Posted by su...@apache.org.
JIRA TRAFODION-19 && TRAFODION-1483

JIRA TRAFODION-19:

Made the following changes:

Removed support for locklength from the parser
Test and fix issues with create table variants
Made recommended changes as mentioned in the initial delivery
  Rename some of the variable names to make them more informative
  Assume prefix length for HIVE and HBASE tables can be different and verify code works correctly
  Fix commented code to be correct and remove lines no longer needed
  Update error text for messages 1180 to include external table type

Beefed up the new regression test (hive/TEST009)
Check column list from hive descriptor with external table description and return an error if there is a mismatch
Add an error if the user specifies a different target schema name than the source
Allow someone with privileges to drop HIVE exernal schemas

JIRA TRAFODION-1483:

Added support for external HBase tables similar to Hive table support


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

Branch: refs/heads/master
Commit: 2e0b1ddf10efbd09fe027ce3af00aef7ba821271
Parents: 40c2786
Author: Roberta Marton <ro...@esgyn.com>
Authored: Fri Sep 4 17:09:32 2015 +0000
Committer: Roberta Marton <ro...@esgyn.com>
Committed: Fri Sep 4 17:09:32 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   6 +-
 core/sql/common/ComMisc.cpp                     |  66 +++-
 core/sql/common/ComMisc.h                       |   9 +-
 core/sql/common/ComObjectName.h                 |  29 +-
 core/sql/common/ComSmallDefs.h                  |   1 +
 core/sql/common/OperTypeEnum.h                  |   1 -
 core/sql/optimizer/BindRelExpr.cpp              |  50 ++-
 core/sql/optimizer/BindWA.cpp                   |   2 +-
 core/sql/optimizer/BindWA.h                     |  15 +-
 core/sql/optimizer/NAFileSet.cpp                |   2 -
 core/sql/optimizer/NAFileSet.h                  |   1 -
 core/sql/optimizer/NATable.cpp                  | 140 +++++----
 core/sql/optimizer/ObjectNames.h                |  15 +-
 core/sql/optimizer/RelExeUtil.cpp               |  28 +-
 core/sql/parser/AllElemDDLFileAttr.h            |   1 -
 core/sql/parser/ElemDDLFileAttr.cpp             |  32 --
 core/sql/parser/ElemDDLNode.cpp                 |   6 -
 core/sql/parser/ElemDDLNode.h                   |   2 -
 core/sql/parser/ParDDLFileAttrs.cpp             |  84 -----
 core/sql/parser/ParDDLFileAttrsAlterTable.h     |  28 --
 core/sql/parser/ParDDLFileAttrsCreateIndex.h    |  28 --
 core/sql/parser/ParKeyWords.cpp                 |   1 -
 core/sql/parser/StmtDDLAlter.cpp                |   1 -
 core/sql/parser/StmtDDLCreate.cpp               |   4 -
 core/sql/parser/StmtDDLDrop.cpp                 |   3 +-
 core/sql/parser/sqlparser.y                     |  13 -
 core/sql/regress/hive/EXPECTED009               | 311 ++++++++++++++++++-
 core/sql/regress/hive/TEST009                   | 106 ++++++-
 .../hive/TEST009_create_hbase_objects.hbase     |  55 ++++
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h          |   2 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |  11 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   8 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         | 242 ++++++++-------
 34 files changed, 848 insertions(+), 465 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 5dac5a5..7a900f6 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -130,7 +130,7 @@
 1128 ZZZZZ 99999 ADVANCED CRTCL DIALOUT An invalid API request was encountered.  Details: $0~String0.
 1129 ZZZZZ 99999 BEGINNER MINOR DBADMIN This operation is not allowed on a vertically partitioned table.
 1130 ZZZZZ 99999 BEGINNER MINOR DBADMIN The column requires a default value.
-1131 ZZZZZ 99999 BEGINNER MINOR DBADMIN A column cannot be added to an entry-sequenced table.
+1131 ZZZZZ 99999 BEGINNER MINOR DBADMIN There is an existing Trafodion external table, please drop it before dropping native table 0~TableName.
 1132 ZZZZZ 99999 BEGINNER MINOR DBADMIN An added column cannot have DEFAULT NULL and NOT NULL values at the same time.
 1133 ZZZZZ 99999 BEGINNER MINOR DBADMIN Only super ID can perform this operation.
 1134 ZZZZZ 99999 BEGINNER MINOR DBADMIN A concurrent utility or DDL operation is being performed on object $0~TableName, its parent, or one of its dependencies. That operation must complete before the requested operation can run.
@@ -179,7 +179,7 @@
 1177 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Internal error: trying to create an object with a qualified name type of $0~string0. This qualified name type is not supported. 
 1178 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Internal error: unable to find catalog associated with uid $0~string0.  This catalog is being accessed by role $1~string1.
 1179 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Internal error: inconsistent object definition for $0~TableName found for object in name space $0~string0. Object owned by $1~string1. Unable to find object details in $2~string2;
-1180 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to create an external table $0~TableName with a different schema or table name than the source table $1~TableName.  The external schema and table name must be the same as the source. 
+1180 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to create an external $0~String0 table with a different schema or table name ($1~TableName) than the source table ($2~String1).  The external schema and table name must be the same as the source. 
 1181 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to create a schema with name $0~TableName to store the definition of a native HIVE or HBASE table and the name is too long.  Maximum length supported is $0~Int0.
 1182 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $0~NSKCode was returned by the file system on resource fork $1~String0.
 1183 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $0~NSKCode was returned by the file system on metadata table $1~TableName (file name $2~String0).
@@ -825,7 +825,7 @@ $1~String1 --------------------------------
 3075 42000 99999 BEGINNER MAJOR DBADMIN The [NO]COMPRESS clause is not allowed in the ALTER INDEX ... ATTRIBUTE(S) statement.
 3076 42000 99999 BEGINNER MAJOR DBADMIN Duplicate DEALLOCATE clauses were specified.
 3077 42000 99999 BEGINNER MAJOR DBADMIN The [NO]ICOMPRESS clause is not allowed in the ALTER INDEX ... ATTRIBUTE(S) statement.
-3078 42000 99999 BEGINNER MAJOR DBADMIN The LOCKLENGTH clause is not allowed in the ALTER INDEX ... ATTRIBUTE(S) statement.
+3078 ZZZZZ 99999 BEGINNER MAJOR DBADMIN The column list for $1~TableName does not match its external table representation defined as $0~String0. 
 3079 42000 99999 BEGINNER MAJOR DBADMIN Duplicate EXTENT/MAXEXTENTS clauses were specified.
 3080 0A000 99999 BEGINNER MAJOR DBADMIN The $0~string0 clause is not supported.
 3081 42000 99999 BEGINNER MAJOR DBADMIN Duplicate ALLOCATE clauses were specified.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/common/ComMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.cpp b/core/sql/common/ComMisc.cpp
index 16bb69c..6882696 100644
--- a/core/sql/common/ComMisc.cpp
+++ b/core/sql/common/ComMisc.cpp
@@ -40,6 +40,7 @@
 #include "ComASSERT.h"
 #include "ComMisc.h"
 #include "ComDistribution.h" // enumToLiteral, literalToEnum, literalAndEnumStruct
+#include "CmpSeabaseDDL.h"
 
 // define the enum-to-literal function
 #define ComDefXLateE2L(E2L,eType,array) void E2L (const eType e, NAString &l) \
@@ -99,17 +100,74 @@ NABoolean ComIsTrafodionReservedSchemaName(
   return FALSE;
 }
 
-// schema names of pattern "_HV ... _" and "_HB_ ... _" are reserved to store
+// schema names of pattern "_HV_ ... _" and "_HB_ ... _" are reserved to store
 // external hive and hbase tables
 NABoolean ComIsTrafodionExternalSchemaName (
                                     const NAString &schName)
 {
   Int32 len (schName.length());
+
+  // check for HIVE
   Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
   if (len > prefixLen && 
-      (schName(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX || 
-       schName(0,prefixLen-1) == HBASE_EXT_SCHEMA_PREFIX) && 
-      schName(len-1) == '_' )
+     (schName(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX && 
+      schName(len-1) == '_' ))
     return TRUE;
+
+  // check for HBASE
+  prefixLen = sizeof(HBASE_EXT_SCHEMA_PREFIX);
+  if (len > prefixLen && 
+     (schName(0,prefixLen-1) == HBASE_EXT_SCHEMA_PREFIX && 
+      schName(len-1) == '_' ))
+    return TRUE;
+
   return FALSE;
 }
+
+// ----------------------------------------------------------------------------
+// function: ComConvertNativeNameToTrafName
+//
+// this fuction converts the native HIVE or HBASE object name into its
+// Trafodion external name format.
+//
+// params:
+//    catalogName - catalog name to identify HBASE or HIVE native table
+//    schemaName - external name of the HBASE or HIVE schema
+//    objectName - external name of the HBASE of HIVE table
+//
+// If it is not HIVE or HBASE, just return the qualified name
+// ----------------------------------------------------------------------------
+NAString ComConvertNativeNameToTrafName ( 
+  const NAString &catalogName,
+  const NAString &schemaName,
+  const NAString &objectName)
+{
+  // generate new schema name 
+  NAString tempSchemaName; 
+  if (catalogName == HIVE_SYSTEM_CATALOG)
+    tempSchemaName += HIVE_EXT_SCHEMA_PREFIX;
+  else if(catalogName == HBASE_SYSTEM_CATALOG)
+    tempSchemaName += HBASE_EXT_SCHEMA_PREFIX;
+  else
+    return catalogName + NAString(".") +
+           schemaName + NAString(".") +
+           objectName; 
+
+  ComAnsiNamePart externalAnsiName(schemaName, ComAnsiNamePart::EXTERNAL_FORMAT);
+  tempSchemaName += externalAnsiName.getInternalName();
+  tempSchemaName.append ("_");
+
+  // Catalog name is "TRAFODION"
+  NAString convertedName (CmpSeabaseDDL::getSystemCatalogStatic());
+  convertedName += ".";
+
+  // append transformed schema name, convert internal name to external format
+  ComAnsiNamePart internalAnsiName(tempSchemaName, ComAnsiNamePart::INTERNAL_FORMAT);
+  convertedName += internalAnsiName.getExternalName();
+
+  // object  name is appended without change
+  convertedName += NAString(".") + objectName;
+
+  return convertedName;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/common/ComMisc.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.h b/core/sql/common/ComMisc.h
index 7815e06..2a6f415 100644
--- a/core/sql/common/ComMisc.h
+++ b/core/sql/common/ComMisc.h
@@ -50,9 +50,14 @@ NABoolean ComIsTrafodionReservedSchema(
                                        const NAString &catName,
                                        const NAString &schName);
 
-// schema names of pattern "_HV ... _" and "_HB_ ... _" are reserved to store
+// schema names of pattern "_HV_ ... _" and "_HB_ ... _" are reserved to store
 // external hive and hbase tables
 NABoolean ComIsTrafodionExternalSchemaName (
-                                    const NAString &schName);
+                                            const NAString &schName);
+
+NAString ComConvertNativeNameToTrafName ( 
+                                         const NAString &catalogName,
+                                         const NAString &schemaName,
+                                         const NAString &objectName);
 
 #endif // COMMISC_H

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/common/ComObjectName.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComObjectName.h b/core/sql/common/ComObjectName.h
index 10dedbe..1bbc09d 100644
--- a/core/sql/common/ComObjectName.h
+++ b/core/sql/common/ComObjectName.h
@@ -61,6 +61,7 @@ using namespace std;
 #include "ComAnsiNamePart.h"
 #include "ComRoutineActionNamePart.h"
 #include "ComSchemaName.h"
+#include "ComMisc.h"
 
 // -----------------------------------------------------------------------
 // forward declarations
@@ -280,8 +281,8 @@ class ComObjectName : public NABasicObject
     void setIsVolatile(NABoolean v)
     { (v ? flags_ |= IS_VOLATILE : flags_ &= ~IS_VOLATILE);}
 
-    inline NABoolean isExternalHive(); 
-    inline NABoolean isExternalHbase();
+    inline NABoolean isExternalHive() const;  
+    inline NABoolean isExternalHbase() const;
 
   protected:
 
@@ -603,16 +604,12 @@ ComObjectName::isValid() const
 // returns TRUE if it is a HIVE schema
 // ----------------------------------------------------------------------------
 NABoolean
-ComObjectName::isExternalHive()
+ComObjectName::isExternalHive() const
 {
-  if (schemaNamePart_.isEmpty())
-    return FALSE;
-  
   NAString schemaName(schemaNamePart_.getInternalName());
-  Int32 len (schemaName.length());
-  if (len > sizeof(HIVE_EXT_SCHEMA_PREFIX))
-    return (schemaName(0,sizeof(HIVE_EXT_SCHEMA_PREFIX)-1) == HIVE_EXT_SCHEMA_PREFIX &&
-            schemaName(len-1) == '_');
+
+  if (ComIsTrafodionExternalSchemaName(schemaName))
+    return (schemaName(0,sizeof(HIVE_EXT_SCHEMA_PREFIX)-1) == HIVE_EXT_SCHEMA_PREFIX); 
   return FALSE;
 }
   
@@ -625,16 +622,12 @@ ComObjectName::isExternalHive()
 // returns TRUE if it is a hbase schema
 // ----------------------------------------------------------------------------
 NABoolean
-ComObjectName::isExternalHbase()
+ComObjectName::isExternalHbase() const
 {
-  if (schemaNamePart_.isEmpty())
-    return FALSE;
-
   NAString schemaName(schemaNamePart_.getInternalName());
-  Int32 len (schemaName.length());
-  if (len > sizeof(HBASE_EXT_SCHEMA_PREFIX))
-    return (schemaName(0,sizeof(HBASE_EXT_SCHEMA_PREFIX)-1) == HBASE_EXT_SCHEMA_PREFIX &&
-            schemaName(len-1) == '_');
+
+  if (ComIsTrafodionExternalSchemaName(schemaName))
+    return (schemaName(0,sizeof(HBASE_EXT_SCHEMA_PREFIX)-1) == HBASE_EXT_SCHEMA_PREFIX); 
   return FALSE;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/common/ComSmallDefs.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSmallDefs.h b/core/sql/common/ComSmallDefs.h
index 7fe3a73..028ca1b 100644
--- a/core/sql/common/ComSmallDefs.h
+++ b/core/sql/common/ComSmallDefs.h
@@ -1072,6 +1072,7 @@ enum ComRowFormat {  COM_UNKNOWN_FORMAT_TYPE
                      , COM_ALIGNED_FORMAT_TYPE
                      , COM_HBASE_FORMAT_TYPE
                      , COM_HIVE_EXTERNAL_FORMAT_TYPE
+                     , COM_HBASE_EXTERNAL_FORMAT_TYPE
 };
 
 #define COM_ROWFORMAT_LIT_LEN                2

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/common/OperTypeEnum.h
----------------------------------------------------------------------
diff --git a/core/sql/common/OperTypeEnum.h b/core/sql/common/OperTypeEnum.h
index 17eb793..d6bb8cf 100644
--- a/core/sql/common/OperTypeEnum.h
+++ b/core/sql/common/OperTypeEnum.h
@@ -1009,7 +1009,6 @@ enum OperatorTypeEnum {
                         // of class ElemDDLFileAttr.
                         ELM_FILE_ATTR_LIST,
                         ELM_PARTN_ATTR_LIST,
-                        ELM_FILE_ATTR_LOCK_LENGTH_ELEM,
                         ELM_FILE_ATTR_MAX_SIZE_ELEM,
                         ELM_FILE_ATTR_NO_LABEL_UPDATE_ELEM,
                         ELM_FILE_ATTR_OWNER_ELEM,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index 7cb7b05..2d400bb 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -1569,12 +1569,11 @@ NATable *BindWA::getNATable(CorrName& corrName,
       ((QualifiedName&)(table->getTableName())).setIsVolatile(TRUE);
     }
       
-  // For now, do not allow access through the Trafodion external name created for
-  // the HIVE object unless the inDDL flag is set.  inDDL is set for drop 
-  // table and SHOWDDL statements.  
-  // TDB - may want to merge the Trafodion version with the HIVE version.
-  // TDB - similar operation may be needed for external HBase tables
-  if ((table) && (table->isExternalTable() && (! bindWA->inDDL())))
+  // For now, don't allow access through the Trafodion external name created for
+  // native HIVE or HBASE objects unless the allowExternalTables flag is set.  
+  // allowExternalTables is set for drop table and SHOWDDL statements.  
+  // TDB - may want to merge the Trafodion version with the native version.
+  if ((table) && (table->isExternalTable() && (! bindWA->allowExternalTables())))
     {
       *CmpCommon::diags() << DgSqlCode(-4258)
                           << DgTableName(table->getTableName().getQualifiedNameAsAnsiString());
@@ -1582,18 +1581,45 @@ NATable *BindWA::getNATable(CorrName& corrName,
       bindWA->setErrStatus();
       return NULL;
     }
+  
+  // If the table is a native table and has an associated external table, 
+  // check to see if the external table structure still matches the native table
+  // If not, return an error
+  if ((table) && table->hasExternalTable()) 
+    {
+      NAString adjustedName = ComConvertNativeNameToTrafName 
+           (table->getTableName().getCatalogName(),
+            table->getTableName().getUnqualifiedSchemaNameAsAnsiString(),
+            table->getTableName().getUnqualifiedObjectNameAsAnsiString()); 
+        
+      // Get a description of the associated Trafodion table
+      Int32 numNameParts = 3;
+      QualifiedName adjustedQualName(adjustedName,numNameParts,STMTHEAP, bindWA);
+      CorrName externalCorrName(adjustedQualName, STMTHEAP);
+      NATable *externalNATable = bindWA->getSchemaDB()->getNATableDB()->
+                                  get(externalCorrName, bindWA, inTableDescStruct);
+  
+      // Should always have an external table, the hasExternalTable() flag indicates
+      // that it exists.
+      CMPASSERT(externalNATable);
 
+       // Compare column lists
+       // TBD - return what mismatches
+       if (!(table->getNAColumnArray() == externalNATable->getNAColumnArray()))
+         {
+           *CmpCommon::diags() << DgSqlCode(-3078)
+                               << DgString0(adjustedName)
+                               << DgTableName(table->getTableName().getQualifiedNameAsAnsiString());
+           bindWA->setErrStatus();
+           externalNATable->setRemoveFromCacheBNC(TRUE);
+           return NULL;
+         }
+    }
     
   HostVar *proto = corrName.getPrototype();
   if (proto && proto->isPrototypeValid())
     corrName.getPrototype()->bindNode(bindWA);
 
-  // Solution 10-040518-6149: When we bind the view as part of the compound
-  // create schema statement, we need to reset referenceCount_ of the base
-  // table to zero.  Otherwise, error 1109 would be reported.
-  if ( bindWA->isCompoundCreateSchema() && bindWA->inViewDefinition() )
-    table->resetReferenceCount();
-
   // This test is not "inAnyConstraint()" because we DO want to increment
   // the count for View With Check Option constraints.
   if (!getCurrentScope()->context()->inTableCheckConstraint() &&

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/BindWA.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindWA.cpp b/core/sql/optimizer/BindWA.cpp
index 3d3a23d..ce83134 100644
--- a/core/sql/optimizer/BindWA.cpp
+++ b/core/sql/optimizer/BindWA.cpp
@@ -131,7 +131,7 @@ BindWA::BindWA(SchemaDB *schemaDB, CmpContext* cmpContext, NABoolean inDDL)
   //     , inRIMaint_(FALSE)
      , inViewWithCheckOption_(NULL)
      , viewCount_(0)
-     , compoundCreateSchema_(FALSE)
+     , allowExternalTables_(FALSE)
      , errFlag_(FALSE)
      , uniqueNum_(0)
      , uniqueIudNum_(0) //++Triggers,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/BindWA.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindWA.h b/core/sql/optimizer/BindWA.h
index 8894593..11b1fdd 100644
--- a/core/sql/optimizer/BindWA.h
+++ b/core/sql/optimizer/BindWA.h
@@ -1480,8 +1480,8 @@ public:
 
   short &viewCount()			   { return viewCount_; }
 
-  NABoolean isCompoundCreateSchema() const { return compoundCreateSchema_; }
-  void setCompoundCreateSchema(NABoolean t) { compoundCreateSchema_ = t; }
+  NABoolean allowExternalTables() const { return allowExternalTables_; }
+  void setAllowExternalTables(NABoolean t) { allowExternalTables_ = t; }
 
   LIST(OptSqlTableOpenInfo *) &getStoiList()  { return stoiList_; }
   LIST(OptUdrOpenInfo *) &getUdrStoiList()  { return udrStoiList_; }
@@ -1818,15 +1818,10 @@ private:
   short viewCount_;
 
   // --------------------------------------------------------------------
-  // Flag to indicate we are compiling a compound create schema statement.
-  // When we bind the view as part of the compound create schema statement,
-  // we need to reset referenceCount_ of the base table to zero.  The
-  // base table is of class NATable.  Otherwise, error 1109 would be           
-  // reported.  The referencCount_ is reset in BindWA:getNATable,
-  // BindRelExpr.cpp.  This flag is introduced for this purpose to fix
-  // solution 10-040518-6149.
+  // Flag to indicate we are accessing an object which is defined in an
+  // external (native) hive or hbase.
   // --------------------------------------------------------------------
-  NABoolean compoundCreateSchema_;
+  NABoolean allowExternalTables_;
 
   // points to a class used by RowSets code.
   HostArraysWA *hostArraysArea_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/NAFileSet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.cpp b/core/sql/optimizer/NAFileSet.cpp
index ee9e7a4..36a72e8 100644
--- a/core/sql/optimizer/NAFileSet.cpp
+++ b/core/sql/optimizer/NAFileSet.cpp
@@ -53,7 +53,6 @@ NAFileSet::NAFileSet(const QualifiedName & fileSetName,
 		     Lng32 numberOfFiles,
 		     Cardinality estimatedNumberOfRecords,
 		     Lng32 recordLength,
-		     Lng32 lockLength,
 		     Lng32 blockSize,
 		     Int32 indexLevels,
 		     const NAColumnArray & allColumns,
@@ -89,7 +88,6 @@ NAFileSet::NAFileSet(const QualifiedName & fileSetName,
            countOfFiles_(numberOfFiles),
 	   estimatedNumberOfRecords_(estimatedNumberOfRecords),
 	   recordLength_(recordLength),
-	   lockLength_(lockLength),
 	   blockSize_(blockSize),
 	   indexLevels_(indexLevels),
            allColumns_(allColumns, h), 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/NAFileSet.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.h b/core/sql/optimizer/NAFileSet.h
index d4ed3f2..5999a6a 100644
--- a/core/sql/optimizer/NAFileSet.h
+++ b/core/sql/optimizer/NAFileSet.h
@@ -93,7 +93,6 @@ public:
 	    Lng32 countOfFiles,
 	    Cardinality estimatedNumberOfRecords,
 	    Lng32 recordLength,
-	    Lng32 lockLength,
 	    Lng32 blockSize,
 	    Int32 indexLevels,
 	    const NAColumnArray & allColumns,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index 1074a0f..5a68aa8 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -3588,7 +3588,9 @@ NAType* getSQColTypeForHive(const char* hiveType, NAMemory* heap)
                                    TRUE, // allow NULL
                                    FALSE, // not upshifted
                                    FALSE, // not case-insensitive
-                                   CharInfo::getCharSetEnum(hiveCharset));
+                                   CharInfo::getCharSetEnum(hiveCharset),
+                                   CharInfo::DefaultCollation,
+                                   CharInfo::IMPLICIT);
     }
   
   if ( !strcmp(hiveType, "float"))
@@ -4341,8 +4343,7 @@ NABoolean createNAFileSets(desc_struct * table_desc       /*IN*/,
 		  isSystemTable,
 		  numberOfFiles,
 		  MAXOF(table_desc->body.table_desc.rowcount,0),
-		  indexes_desc->body.indexes_desc.record_length,
-		  files_desc ? files_desc->body.files_desc.lockLength : 0,
+                  indexes_desc->body.indexes_desc.record_length,
                   blockSize,
 		  indexLevels,
 		  allColumns,
@@ -4674,9 +4675,7 @@ NABoolean createNAFileSets(hive_tbl_desc* hvt_desc        /*IN*/,
 
                   // HIVE-TBD
 		  Cardinality(estimatedRC),
-		  Lng32(estimatedRecordLength), 
-
-		  0, // lock length
+                  Lng32(estimatedRecordLength),
 
 		  //hvt_desc->getBlockSize(), 
 		  (Lng32)hiveHDFSTableStats->getEstimatedBlockSize(), 
@@ -4846,6 +4845,51 @@ ULng32 hashColPosList(const CollIndexSet &colSet)
 }
 
 
+// ----------------------------------------------------------------------------
+// method: lookupObjectUid
+//
+// Calls DDL manager to get the object UID for the specified object
+//
+// params:
+//    qualName - name of object to lookup
+//    objectType - type of object
+//
+// returns:
+//   -1 -> error found trying to read metadata including object not found
+//   UID of found object
+//
+// the diags area contains details of any error detected
+//
+// *** recent change - move this function up in this file and move resetting
+//     of ComDiagsArea to the caller ***
+// ----------------------------------------------------------------------------      
+Int64 lookupObjectUid( const QualifiedName& qualName
+                     , ComObjectType objectType
+                     )
+{
+  ExeCliInterface cliInterface(STMTHEAP);
+  Int64 objectUID = 0;
+
+  CmpSeabaseDDL cmpSBD(STMTHEAP);
+  if (cmpSBD.switchCompiler(CmpContextInfo::CMPCONTEXT_TYPE_META))
+    {
+      if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) == 0)
+        *CmpCommon::diags() << DgSqlCode( -4400 );
+
+      return -1;
+    }
+
+  objectUID = cmpSBD.getObjectUID(&cliInterface,
+                                  qualName.getCatalogName().data(),
+                                  qualName.getSchemaName().data(),
+                                  qualName.getObjectName().data(),
+                                  comObjectTypeLit(objectType));
+
+  cmpSBD.switchBackCompiler();
+
+  return objectUID;
+}
+
 // -----------------------------------------------------------------------
 // NATable::NATable() constructor
 // -----------------------------------------------------------------------
@@ -5080,6 +5124,36 @@ NATable::NATable(BindWA *bindWA,
   schemaUID_ = uint32ArrayToInt64(table_desc->body.table_desc.schemaUID);
   objectUID_ = uint32ArrayToInt64(table_desc->body.table_desc.objectUID);
 
+  // Set the objectUID_ for hbase Cell and Row tables, if the table has
+  // been defined in Trafodion use this value, otherwise, set to 0
+  if (isHbaseCell_ || isHbaseRow_)
+    {
+      NAString adjustedName = ComConvertNativeNameToTrafName
+         (corrName.getQualifiedNameObj().getCatalogName(),
+          corrName.getQualifiedNameObj().getUnqualifiedSchemaNameAsAnsiString(),
+          corrName.getQualifiedNameObj().getUnqualifiedObjectNameAsAnsiString());
+      QualifiedName extObjName (adjustedName, 3, STMTHEAP);
+
+      Lng32 diagsMark = CmpCommon::diags()->mark();
+      objectUID_ = ::lookupObjectUid(extObjName, COM_BASE_TABLE_OBJECT);
+
+      // If the objectUID is not found, then the table is not externally defined
+      // in Trafodion, set the objectUID to 0
+      // If an unexpected error occurs, then return with the error
+      if (objectUID_ <= 0)
+        {
+          if (CmpCommon::diags()->contains(-1389))
+            {
+              CmpCommon::diags()->rewind(diagsMark);
+              objectUID_ = 0;
+            }
+          else
+            return;
+        }
+      else
+        setHasExternalTable(TRUE);
+    }
+
   if (table_desc->body.table_desc.owner)
     {
       Int32 userInfo (table_desc->body.table_desc.owner);
@@ -5558,51 +5632,6 @@ NATable::NATable(BindWA *bindWA,
 #pragma warn(770)  // warning elimination
 
 
-// ----------------------------------------------------------------------------
-// method: lookupObjectUid
-//
-// Calls DDL manager to get the object UID for the specified object
-//
-// params:
-//    qualName - name of object to lookup
-//    objectType - type of object
-//
-// returns:
-//   -1 -> error found trying to read metadata including object not found
-//   UID of found object
-//
-// the diags area contains details of any error detected
-//
-// *** recent change - move this function up in this file and move resetting
-//     of ComDiagsArea to the caller ***
-// ----------------------------------------------------------------------------      
-Int64 lookupObjectUid( const QualifiedName& qualName
-                     , ComObjectType objectType
-                     )
-{
-  ExeCliInterface cliInterface(STMTHEAP);
-  Int64 objectUID = 0;
-
-  CmpSeabaseDDL cmpSBD(STMTHEAP);
-  if (cmpSBD.switchCompiler(CmpContextInfo::CMPCONTEXT_TYPE_META))
-    {
-      if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) == 0)
-        *CmpCommon::diags() << DgSqlCode( -4400 );
-
-      return -1;
-    }
-
-  objectUID = cmpSBD.getObjectUID(&cliInterface,
-                                  qualName.getCatalogName().data(),
-                                  qualName.getSchemaName().data(),
-                                  qualName.getObjectName().data(),
-                                  comObjectTypeLit(objectType));
-
-  cmpSBD.switchBackCompiler();
-
-  return objectUID;
-}
-
 // Constructor for a Hive table
 NATable::NATable(BindWA *bindWA,
                  const CorrName& corrName,
@@ -5752,10 +5781,11 @@ NATable::NATable(BindWA *bindWA,
   // If the HIVE table has been registered in Trafodion, get the objectUID
   // from Trafodion, otherwise, set it to 0.
   // TBD - does getQualifiedNameObj handle delimited names correctly?
-  QualifiedName extObjName (corrName.getQualifiedNameObj().getObjectName(),
-                            corrName.getQualifiedNameObj().getSchemaName(),
-                            TRAFODION_SYSCAT_LIT,
-                            STMTHEAP);
+  NAString adjustedName = ComConvertNativeNameToTrafName 
+                            ( corrName.getQualifiedNameObj().getCatalogName(),
+                              corrName.getQualifiedNameObj().getSchemaName(),
+                              corrName.getQualifiedNameObj().getObjectName()); 
+  QualifiedName extObjName (adjustedName, 3, STMTHEAP);
 
   Lng32 diagsMark = CmpCommon::diags()->mark();
   objectUID_ = ::lookupObjectUid(extObjName, COM_BASE_TABLE_OBJECT);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/ObjectNames.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.h b/core/sql/optimizer/ObjectNames.h
index 5889b18..d7f15cf 100644
--- a/core/sql/optimizer/ObjectNames.h
+++ b/core/sql/optimizer/ObjectNames.h
@@ -276,6 +276,9 @@ public:
 		     size_t *lenArray /* array[5] */) const;
   const NAString  getQualifiedNameAsAnsiNTFilenameString() const;
   const NAString& getObjectName() const		{ return objectName_; }
+  const NAString  getUnqualifiedObjectNameAsAnsiString() const
+                                { return ToAnsiIdentifier(objectName_); }
+
   ComAnsiNameSpace getObjectNameSpace() const { return objectNameSpace_; }
 
 
@@ -690,12 +693,6 @@ public:
     flagbits_(0)
   {
     setIsExternal(ComIsTrafodionExternalSchemaName(schemaName));
-    //Int32 len (schemaName.length());
-    //Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
-    //if (len > prefixLen)
-    //  setIsExternal(schemaName(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX &&
-    //                schemaName(len-1) == '_' );
-
     setLocationName (locName) ;
   }
 
@@ -715,12 +712,6 @@ public:
     flagbits_(0)
   {
     setIsExternal(ComIsTrafodionExternalSchemaName(qualName.getSchemaName()));
-    //Int32 len (qualName.getSchemaName().length());
-    //Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
-    //if (len > prefixLen)
-    //  setIsExternal(qualName.getSchemaName()(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX &&
-    //                qualName.getSchemaName()(len-1) == '_');
-
     setLocationName (locName) ;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index 728b31f..55a5210 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -3814,23 +3814,21 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
 
       qualObjName_ = dropTableNode->getTableNameAsQualifiedName();
 
-      // Hive tables can only be specified as external and must be created
-      // with the FOR clause
-      if (qualObjName_.isHive())
-      {
-        if (dropTableNode->isExternal())
+      // Drops of Hive and HBase external tables are allowed 
+      if (qualObjName_.isHive() || (qualObjName_.isHbase()))
         {
-          isHbase_ = TRUE;
-          externalTable = TRUE;
-        }
-        else
-        {
-          *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("DDL");
-          bindWA->setErrStatus();
-          return NULL;
+          if (dropTableNode->isExternal())
+            {
+              isHbase_ = TRUE;
+              externalTable = TRUE;
+            }
+          else
+            {
+              *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("DDL");
+              bindWA->setErrStatus();
+              return NULL;
+            }
         }
-
-      }
     }
     else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropHbaseTable())
     {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/AllElemDDLFileAttr.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/AllElemDDLFileAttr.h b/core/sql/parser/AllElemDDLFileAttr.h
index 2b46148..84308f5 100644
--- a/core/sql/parser/AllElemDDLFileAttr.h
+++ b/core/sql/parser/AllElemDDLFileAttr.h
@@ -56,7 +56,6 @@
 #include "ElemDDLFileAttrDeallocate.h"
 #include "ElemDDLFileAttrDCompress.h"
 #include "ElemDDLFileAttrICompress.h"
-#include "ElemDDLFileAttrLockLength.h"
 #include "ElemDDLFileAttrPOS.h"
 #include "ElemDDLFileAttrMaxSize.h"
 #include "ElemDDLFileAttrRangeLog.h"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ElemDDLFileAttr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLFileAttr.cpp b/core/sql/parser/ElemDDLFileAttr.cpp
index a76143e..b8bf860 100644
--- a/core/sql/parser/ElemDDLFileAttr.cpp
+++ b/core/sql/parser/ElemDDLFileAttr.cpp
@@ -758,38 +758,6 @@ NAString ElemDDLFileAttrICompress::getSyntax() const
 
 
 // -----------------------------------------------------------------------
-// methods for class ElemDDLFileAttrLockLength
-// -----------------------------------------------------------------------
-
-// virtual destructor
-ElemDDLFileAttrLockLength::~ElemDDLFileAttrLockLength()
-{
-}
-
-// cast
-ElemDDLFileAttrLockLength *
-ElemDDLFileAttrLockLength::castToElemDDLFileAttrLockLength()
-{
-  return this;
-}
-
-// trace
-
-const NAString
-ElemDDLFileAttrLockLength::getText() const
-{
-  return "ElemDDLFileAttrLockLength";
-}
-
-const NAString
-ElemDDLFileAttrLockLength::displayLabel1() const
-{
-  char buffer[80];
-  sprintf(buffer, "%d", getLockLength());
-  return NAString("Lock length: ") + NAString(buffer);
-}
-
-// -----------------------------------------------------------------------
 // methods for class ElemDDLFileAttrRangeLog
 // -----------------------------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ElemDDLNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.cpp b/core/sql/parser/ElemDDLNode.cpp
index 102f683..3e9b21b 100644
--- a/core/sql/parser/ElemDDLNode.cpp
+++ b/core/sql/parser/ElemDDLNode.cpp
@@ -381,12 +381,6 @@ ElemDDLNode::castToElemDDLPartnAttrList()
   return NULL;
 }
 
-ElemDDLFileAttrLockLength *
-ElemDDLNode::castToElemDDLFileAttrLockLength()
-{
-  return NULL;
-}
-
 ElemDDLFileAttrMaxSize *
 ElemDDLNode::castToElemDDLFileAttrMaxSize()
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ElemDDLNode.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.h b/core/sql/parser/ElemDDLNode.h
index ad4932d..e1d540a 100644
--- a/core/sql/parser/ElemDDLNode.h
+++ b/core/sql/parser/ElemDDLNode.h
@@ -100,7 +100,6 @@ class ElemDDLFileAttrDeallocate;
 class ElemDDLFileAttrICompress;
 class ElemDDLFileAttrList;
 class ElemDDLPartnAttrList;
-class ElemDDLFileAttrLockLength;
 class ElemDDLFileAttrMaxSize;
 class ElemDDLFileAttrExtents;
 class ElemDDLFileAttrMaxExtents;
@@ -419,7 +418,6 @@ public:
   virtual ElemDDLFileAttrICompress      * castToElemDDLFileAttrICompress();
   virtual ElemDDLFileAttrList           * castToElemDDLFileAttrList();
   virtual ElemDDLPartnAttrList          * castToElemDDLPartnAttrList();
-  virtual ElemDDLFileAttrLockLength     * castToElemDDLFileAttrLockLength();
   virtual ElemDDLFileAttrMaxSize        * castToElemDDLFileAttrMaxSize();
   virtual ElemDDLFileAttrExtents        * castToElemDDLFileAttrExtents();
   virtual ElemDDLFileAttrMaxExtents     * castToElemDDLFileAttrMaxExtents();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ParDDLFileAttrs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParDDLFileAttrs.cpp b/core/sql/parser/ParDDLFileAttrs.cpp
index 609dbb1..74a4b99 100644
--- a/core/sql/parser/ParDDLFileAttrs.cpp
+++ b/core/sql/parser/ParDDLFileAttrs.cpp
@@ -423,19 +423,6 @@ ParDDLFileAttrsAlterIndex::setFileAttr(ElemDDLFileAttr * pFileAttr)
     *SqlParser_Diags << DgSqlCode(-3077);
     break;
 
-  case ELM_FILE_ATTR_LOCK_LENGTH_ELEM :
-    //
-    // The grammar productions allow the locklength phrase
-    // to appear within an Alter Index ... Attribute(s)
-    // statement (syntactically).  Enforces the restriction
-    // by using semantic actions.
-    //
-
-    // LOCKLENGTH phrase not allowed in an Alter Index ... Attribute(s) 
-    // statement.
-    *SqlParser_Diags << DgSqlCode(-3078);
-    break;
-
   case ELM_FILE_ATTR_EXTENT_ELEM :
 	// DOnt allow EXTENT in ALTER statements
     *SqlParser_Diags << DgSqlCode(-3194);
@@ -729,10 +716,6 @@ ParDDLFileAttrsAlterTable::copy(const ParDDLFileAttrsAlterTable &rhs)
   // DEALLOCATE
   isDeallocateSpec_     = rhs.isDeallocateSpec_;
 
-  // LOCKLENGTH
-  isLockLengthSpec_     = rhs.isLockLengthSpec_;
-  lockLength_           = rhs.lockLength_;
-
   // MAXSIZE
   isMaxSizeSpec_        = rhs.isMaxSizeSpec_;
   isMaxSizeUnbounded_   = rhs.isMaxSizeUnbounded_;
@@ -820,13 +803,6 @@ ParDDLFileAttrsAlterTable::initializeDataMembers()
   //   no other data members besides isDeallocateSpec_
   //
 
-  // LOCKLENGTH
-  //
-  //   The following data member has no meaning when the
-  //   LockLength phrase does not appear.
-  //
-  lockLength_           = 0;
-
   // MAXSIZE
   //
   //   The following data members have no meanings when the
@@ -899,9 +875,6 @@ ParDDLFileAttrsAlterTable::resetAllIsSpecDataMembers()
   // DEALLOCATE
   isDeallocateSpec_             = FALSE;
 
-  // LOCKLENGTH
-  isLockLengthSpec_             = FALSE;
-
   // MAXSIZE
   isMaxSizeSpec_                = FALSE;
 
@@ -1060,18 +1033,6 @@ ParDDLFileAttrsAlterTable::setFileAttr(ElemDDLFileAttr * pFileAttr)
     *SqlParser_Diags << DgSqlCode(-3089);
     break;
 
-  case ELM_FILE_ATTR_LOCK_LENGTH_ELEM :
-    if (isLockLengthSpec_)
-    {
-      // Duplicate LOCKLENGTH phrases.
-      *SqlParser_Diags << DgSqlCode(-3090);
-    }
-    ComASSERT(pFileAttr->castToElemDDLFileAttrLockLength() NEQ NULL);
-    lockLength_ = pFileAttr->castToElemDDLFileAttrLockLength()->
-      getLockLength();
-    isLockLengthSpec_ = TRUE;
-    break;
-
   case ELM_FILE_ATTR_EXTENT_ELEM :
 	// Dont allow EXTENT in ALTER statements.
     *SqlParser_Diags << DgSqlCode(-3194);
@@ -1270,19 +1231,6 @@ ParDDLFileAttrsAlterTable::getDetailInfo() const
     detailTextList.append("deallocate not spec");
   }
 
-  // LOCKLENGTH
-
-  if (isLockLengthSpecified())
-  {
-    detailText = "locklen:       ";
-    detailText += LongToNAString((Lng32)getLockLength());
-    detailTextList.append(detailText);
-  }
-  else
-  {
-    detailTextList.append("locklength not spec");
-  }
-
   // MAXSIZE
 
   if (isMaxSizeSpecified())
@@ -1414,10 +1362,6 @@ ParDDLFileAttrsCreateIndex::copy(const ParDDLFileAttrsCreateIndex &rhs)
   isICompressSpec_      = rhs.isICompressSpec_;
   isICompress_          = rhs.isICompress_;
 
-  // LOCKLENGTH
-  isLockLengthSpec_     = rhs.isLockLengthSpec_;
-  lockLength_           = rhs.lockLength_;
-
   // MAXSIZE
   isMaxSizeSpec_        = rhs.isMaxSizeSpec_;
   isMaxSizeUnbounded_   = rhs.isMaxSizeUnbounded_;
@@ -1518,14 +1462,6 @@ ParDDLFileAttrsCreateIndex::initializeDataMembers()
   //
   isICompress_          = FALSE;
 
-  // LOCKLENGTH
-  //
-  //   Sets number of bytes in key to use for
-  //   generic locks.  Default is 0 which means
-  //   using the entire key.
-  //
-  lockLength_           = 0;
-
   // MAXSIZE
   isMaxSizeUnbounded_   = FALSE;
   ParSetDefaultMaxSize(maxSize_, maxSizeUnit_);
@@ -1583,9 +1519,6 @@ ParDDLFileAttrsCreateIndex::resetAllIsSpecDataMembers()
   // [ NO ] ICOMPRESS
   isICompressSpec_              = FALSE;
 
-  // LOCKLENGTH
-  isLockLengthSpec_             = FALSE;
-
   // MAXSIZE
   isMaxSizeSpec_                = FALSE;
 
@@ -1730,18 +1663,6 @@ ParDDLFileAttrsCreateIndex::setFileAttr(ElemDDLFileAttr * pFileAttr)
     isICompressSpec_ = TRUE;
     break;
 
-  case ELM_FILE_ATTR_LOCK_LENGTH_ELEM :
-    if (isLockLengthSpec_)
-    {
-      // Duplicate LOCKLENGTH phrases.
-      *SqlParser_Diags << DgSqlCode(-3090);
-    }
-    ComASSERT(pFileAttr->castToElemDDLFileAttrLockLength() NEQ NULL);
-    lockLength_ = pFileAttr->castToElemDDLFileAttrLockLength()->
-      getLockLength();
-    isLockLengthSpec_ = TRUE;
-    break;
-
   case ELM_FILE_ATTR_EXTENT_ELEM :
     if (isExtentSpec_)
     {
@@ -1882,10 +1803,6 @@ ParDDLFileAttrsCreateIndex::getDetailInfo() const
   detailText += YesNo(getIsICompress());
   detailTextList.append(detailText);
 
-  detailText = "locklen:       ";
-  detailText += LongToNAString((Lng32)getLockLength());
-  detailTextList.append(detailText);
-
   detailText = "maxsizunbound? ";
   detailText += YesNo(isMaxSizeUnbounded());
   detailTextList.append(detailText);
@@ -2180,7 +2097,6 @@ ParDDLFileAttrsCreateTable::setFileAttr(ElemDDLFileAttr * pFileAttr)
   case ELM_FILE_ATTR_CLEAR_ON_PURGE_ELEM :
   case ELM_FILE_ATTR_D_COMPRESS_ELEM     :
   case ELM_FILE_ATTR_I_COMPRESS_ELEM     :
-  case ELM_FILE_ATTR_LOCK_LENGTH_ELEM    :
   case ELM_FILE_ATTR_EXTENT_ELEM         :
   case ELM_FILE_ATTR_MAXEXTENTS_ELEM     :
   case ELM_FILE_ATTR_UID_ELEM  :

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ParDDLFileAttrsAlterTable.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParDDLFileAttrsAlterTable.h b/core/sql/parser/ParDDLFileAttrsAlterTable.h
index ccc7edf..843b235 100644
--- a/core/sql/parser/ParDDLFileAttrsAlterTable.h
+++ b/core/sql/parser/ParDDLFileAttrsAlterTable.h
@@ -137,12 +137,6 @@ public:
   inline ComCompressionType getCompressionType() const;
      // Returns the value of COMPRESSION TYPE
 
-  inline unsigned short getLockLength() const;
-
-       // Returns the unsigned number appearing in the specified
-       // LockLength phrase.  The return value has no meanings when
-       // the LockLength phrase is not specified.
-
   inline ULng32 getMaxSize() const;
 
        // Returns the value appearing in the specified MaxSize phrase.
@@ -220,11 +214,6 @@ public:
        // Returns TRUE if the Deallocate phrase appears;
        // returns FALSE otherwise.
 
-  inline NABoolean isLockLengthSpecified() const;
-
-       // Returns TRUE if the LockLength phrase appears;
-       // returns FALSE otherwise.
-
   inline NABoolean isMaxSizeSpecified() const;
 
        // Returns TRUE if the MaxSize phrase appears;
@@ -332,10 +321,6 @@ private:
   // DEALLOCATE
   NABoolean       isDeallocateSpec_;
   
-  // LOCKLENGTH
-  NABoolean       isLockLengthSpec_;
-  unsigned short  lockLength_;
-
   // MAXSIZE
   NABoolean       isMaxSizeSpec_;
   NABoolean       isMaxSizeUnbounded_;
@@ -420,12 +405,6 @@ ParDDLFileAttrsAlterTable::getIsClearOnPurge() const
   return isClearOnPurge_;
 }
 
-inline unsigned short
-ParDDLFileAttrsAlterTable::getLockLength() const
-{
-  return lockLength_;
-}
-
 inline ULng32
 ParDDLFileAttrsAlterTable::getMaxSize() const
 {
@@ -510,13 +489,6 @@ ParDDLFileAttrsAlterTable::isDeallocateSpecified() const
   return isDeallocateSpec_;
 }
 
-// is the LockLength phrase specified?
-inline NABoolean
-ParDDLFileAttrsAlterTable::isLockLengthSpecified() const
-{
-  return isLockLengthSpec_;
-}
-
 // is the MaxSize phrase specified?
 inline NABoolean
 ParDDLFileAttrsAlterTable::isMaxSizeSpecified() const

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ParDDLFileAttrsCreateIndex.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParDDLFileAttrsCreateIndex.h b/core/sql/parser/ParDDLFileAttrsCreateIndex.h
index 089caba..7c8eaa5 100644
--- a/core/sql/parser/ParDDLFileAttrsCreateIndex.h
+++ b/core/sql/parser/ParDDLFileAttrsCreateIndex.h
@@ -157,12 +157,6 @@ public:
         // For Create Table statements, the default value is FALSE (no
         // compression).
 
-  inline unsigned short getLockLength() const;
-
-        // Returns the unsigned number appearing in the specified
-        // LockLength phrase.  Returns 0 (the default value) when
-        // the LockLength phrase is not specified.
-
   inline ULng32 getMaxSize() const;
 
         // Returns the value specified in the MaxSize clause.
@@ -260,11 +254,6 @@ public:
         // Returns TRUE if the ICompress phrase appears;
         // returns FALSE otherwise.
 
-  inline NABoolean isLockLengthSpecified() const;
-
-        // Returns TRUE if the LockLength phrase appears;
-        // returns FALSE otherwise.
-
   inline NABoolean isMaxSizeSpecified() const;
 
         // Returns TRUE if the MaxSize phrase appears;
@@ -354,10 +343,6 @@ private:
   NABoolean       isICompressSpec_;
   NABoolean       isICompress_;
 
-  // LOCKLENGTH
-  NABoolean       isLockLengthSpec_;
-  unsigned short  lockLength_;
-
   // MAXSIZE
   NABoolean       isMaxSizeSpec_;
   NABoolean       isMaxSizeUnbounded_;
@@ -443,12 +428,6 @@ ParDDLFileAttrsCreateIndex::getIsICompress() const
   return isICompress_;
 }
 
-inline unsigned short
-ParDDLFileAttrsCreateIndex::getLockLength() const
-{
-  return lockLength_;
-}
-
 inline ULng32
 ParDDLFileAttrsCreateIndex::getMaxSize() const
 {
@@ -578,13 +557,6 @@ ParDDLFileAttrsCreateIndex::isICompressSpecified() const
   return isICompressSpec_;
 }
 
-// is the LockLength phrase specified?
-inline NABoolean
-ParDDLFileAttrsCreateIndex::isLockLengthSpecified() const
-{
-  return isLockLengthSpec_;
-}
-
 // is the MaxSize phrase specified?
 inline NABoolean
 ParDDLFileAttrsCreateIndex::isMaxSizeSpecified() const

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/ParKeyWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp
index e766f19..9824f70 100644
--- a/core/sql/parser/ParKeyWords.cpp
+++ b/core/sql/parser/ParKeyWords.cpp
@@ -603,7 +603,6 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("LOCATOR",            TOK_LOCATOR,     COMPAQ_|RESWORD_),
   ParKeyWord("LOCK",               TOK_LOCK,        FIRST_|NONRESTOKEN_),
   ParKeyWord("LOCKING",            TOK_LOCKING,     NONRESTOKEN_),
-  ParKeyWord("LOCKLENGTH",         TOK_LOCKLENGTH,  NONRESTOKEN_),
   ParKeyWord("LOCKONREFRESH",      TOK_LOCKONREFRESH, FLAGSNONE_),
   ParKeyWord("LOG",                TOK_LOG,         NONRESTOKEN_),
   ParKeyWord("LOG10",              TOK_LOG10,       NONRESTOKEN_),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/StmtDDLAlter.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLAlter.cpp b/core/sql/parser/StmtDDLAlter.cpp
index bd1fc16..b599ae7 100644
--- a/core/sql/parser/StmtDDLAlter.cpp
+++ b/core/sql/parser/StmtDDLAlter.cpp
@@ -2521,7 +2521,6 @@ StmtDDLAlterMV::checkFileAttribute(ElemDDLFileAttr * pFileAttr)
 	case ELM_FILE_ATTR_I_COMPRESS_ELEM		:
 	case ELM_FILE_ATTR_MAX_SIZE_ELEM		:
 	case ELM_FILE_ATTR_ALLOCATE_ELEM		:
-	case ELM_FILE_ATTR_LOCK_LENGTH_ELEM		:
 	case ELM_FILE_ATTR_AUDIT_ELEM			:
 	case ELM_FILE_ATTR_DEALLOCATE_ELEM		:
 	case ELM_FILE_ATTR_RANGE_LOG_ELEM		:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/StmtDDLCreate.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreate.cpp b/core/sql/parser/StmtDDLCreate.cpp
index 2763446..7dcd4a2 100644
--- a/core/sql/parser/StmtDDLCreate.cpp
+++ b/core/sql/parser/StmtDDLCreate.cpp
@@ -6470,10 +6470,6 @@ StmtDDLCreateMV::checkFileAttribute(ElemDDLFileAttr * pFileAttr)
 		*SqlParser_Diags << DgSqlCode(-12047); 
 		break;
 
-	case ELM_FILE_ATTR_LOCK_LENGTH_ELEM    :
-		*SqlParser_Diags << DgSqlCode(-12048); 
-		break;
-
 	case ELM_FILE_ATTR_AUDIT_ELEM :
 		*SqlParser_Diags << DgSqlCode(-12050); 
 		break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/StmtDDLDrop.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLDrop.cpp b/core/sql/parser/StmtDDLDrop.cpp
index a49af03..938831b 100644
--- a/core/sql/parser/StmtDDLDrop.cpp
+++ b/core/sql/parser/StmtDDLDrop.cpp
@@ -561,7 +561,8 @@ StmtDDLDropSchema::StmtDDLDropSchema(//const SchemaName & schemaName,
   // If the schema name specified is reserved name, users cannot drop them.
   // They can only be dropped internally.
   if ((! Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)) &&
-      (ComIsTrafodionReservedSchemaName(schemaQualName_.getSchemaName())))
+      (ComIsTrafodionReservedSchemaName(schemaQualName_.getSchemaName())) &&
+      (!ComIsTrafodionExternalSchemaName(schemaQualName_.getSchemaName())))
     {
       // error.
       *SqlParser_Diags << DgSqlCode(-1430)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2e0b1ddf/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 72a5317..31ed1be 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -1306,7 +1306,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_LABEL_PURGEDATA
 %token <tokval> TOK_LOCATION            /* Tandem extension */
 %token <tokval> TOK_LOCKING             /* TD extension that HP wants to ignore */
-%token <tokval> TOK_LOCKLENGTH          /* Tandem extension */
 %token <tokval> TOK_LOCKONREFRESH		// MV
 %token <tokval> TOK_M                   /* Tandem extension */
 %token <tokval> TOK_MOVE                /* Tandem extension */
@@ -2621,7 +2620,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <pElemDDL>  		file_attribute_deallocate_clause
 %type <pElemDDL>  		file_attribute_icompress_clause
 %type <pElemDDL>  		file_attribute_list
-%type <pElemDDL>                file_attribute_lock_length_clause
 %type <pElemDDL>                file_attribute_compression_clause
 %type <pElemDDL>  		file_attribute_extent_clause
 %type <pElemDDL>  		file_attribute_maxextent_clause
@@ -25790,7 +25788,6 @@ file_attribute :        file_attribute_allocate_clause
 /* not yet supported: | file_attribute_dcompress_clause		***/
                       | file_attribute_deallocate_clause
                       | file_attribute_icompress_clause
-                      | file_attribute_lock_length_clause
 /* not supported anymore | file_attribute_max_size_clause       ***/
 					  | file_attribute_extent_clause
 					  | file_attribute_maxextent_clause
@@ -25938,15 +25935,6 @@ file_attribute_icompress_clause : TOK_ICOMPRESS
                                 }
 
 /* type pElemDDL */
-file_attribute_lock_length_clause : TOK_LOCKLENGTH unsigned_smallint
-                                {
-                                  $$ = new (PARSERHEAP())
-				    ElemDDLFileAttrLockLength(
-                                       $2 /*unsigned_smallint*/);
-                                }
-
-
-/* type pElemDDL */
 file_attribute_extent_clause : TOK_EXTENT file_attribute_extent
                                 {
                                   $$ = $2 /*file_attribute_extent*/;
@@ -32724,7 +32712,6 @@ nonreserved_word :      TOK_ABORT
                       | TOK_LOCK
                       | TOK_LOCK_ROW
                       | TOK_LOCKING
-                      | TOK_LOCKLENGTH
 		      | TOK_LOCKONREFRESH // MV
 		      | TOK_LOGGABLE //++ MV
                       | TOK_LOGON


[4/4] incubator-trafodion git commit: Merge remote branch 'origin/pr/74/head' into mrg_43

Posted by su...@apache.org.
Merge remote branch 'origin/pr/74/head' into mrg_43


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

Branch: refs/heads/master
Commit: cef0573818fbafa46c041ab97e81346df1e138fc
Parents: e0b7601 569045b
Author: Suresh Subbiah <su...@apache.org>
Authored: Tue Sep 8 19:32:53 2015 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Tue Sep 8 19:32:53 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   6 +-
 core/sql/common/ComMisc.cpp                     |  66 +++-
 core/sql/common/ComMisc.h                       |   9 +-
 core/sql/common/ComObjectName.h                 |  29 +-
 core/sql/common/ComSmallDefs.h                  |   1 +
 core/sql/common/OperTypeEnum.h                  |   1 -
 core/sql/optimizer/BindRelExpr.cpp              |  50 ++-
 core/sql/optimizer/BindWA.cpp                   |   2 +-
 core/sql/optimizer/BindWA.h                     |  15 +-
 core/sql/optimizer/NAFileSet.cpp                |   2 -
 core/sql/optimizer/NAFileSet.h                  |   1 -
 core/sql/optimizer/NATable.cpp                  | 140 +++++----
 core/sql/optimizer/ObjectNames.h                |  15 +-
 core/sql/optimizer/RelExeUtil.cpp               |  28 +-
 core/sql/parser/AllElemDDLFileAttr.h            |   1 -
 core/sql/parser/ElemDDLFileAttr.cpp             |  32 --
 core/sql/parser/ElemDDLNode.cpp                 |   6 -
 core/sql/parser/ElemDDLNode.h                   |   2 -
 core/sql/parser/ParDDLFileAttrs.cpp             |  84 -----
 core/sql/parser/ParDDLFileAttrsAlterTable.h     |  28 --
 core/sql/parser/ParDDLFileAttrsCreateIndex.h    |  28 --
 core/sql/parser/ParKeyWords.cpp                 |   1 -
 core/sql/parser/StmtDDLAlter.cpp                |   1 -
 core/sql/parser/StmtDDLCreate.cpp               |   4 -
 core/sql/parser/StmtDDLDrop.cpp                 |   3 +-
 core/sql/parser/sqlparser.y                     |  13 -
 core/sql/regress/hive/EXPECTED009               | 311 ++++++++++++++++++-
 core/sql/regress/hive/TEST009                   | 106 ++++++-
 .../hive/TEST009_create_hbase_objects.hbase     |  55 ++++
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h          |   2 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |  11 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   8 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         | 242 ++++++++-------
 34 files changed, 848 insertions(+), 465 deletions(-)
----------------------------------------------------------------------