Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/74#discussion_r38962436
  
    --- Diff: core/sql/regress/hive/EXPECTED009 ---
    @@ -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.
    --- End diff --
    
    I actually toyed with this and could not decide whether this was an error 
or warning.
    
    When I was testing, I discovered that the information I stored in the 
metadata did not match the information returned in the hive_tbl_desc.  This 
actually pointed to a couple of errors in the code.  There is also an issue 
when a mismatch does occur, that an error is returned and you have no idea what 
the issue is.  I had to add debug code to figure it out.
    
    So this area can be handled better.  I can go either way - error or warning.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to