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/08/25 05:44:16 UTC

[2/7] incubator-trafodion git commit: Fixes for Jira's trafodion-19 & trafodion-29

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/regress/executor/TEST106
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST106 b/core/sql/regress/executor/TEST106
index eedee69..4c32630 100755
--- a/core/sql/regress/executor/TEST106
+++ b/core/sql/regress/executor/TEST106
@@ -64,7 +64,7 @@ obey TEST106(clnup);
 log LOG106 clear;
 
 create table T106_interleaved_log (
-                   ts time(6) not null,
+                   ts timestamp(6) not null,
                    msg char(60) ) no partition;
  
 
@@ -235,36 +235,36 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -290,28 +290,28 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2, execute s1, start');
 
 ------- long running, cpu-bound select query -------
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2, execute s1, finished');
 
 obey TEST106(synch_cancel);
@@ -329,36 +329,36 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'update_test1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'update_test1, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values 
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'update_test1, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'update_test1, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -372,36 +372,36 @@ prepare s1 from delete from t106a;
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'delete_test1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'delete_test1, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values 
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'delete_test1, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'delete_test1, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -414,36 +414,36 @@ prepare s1 from insert into t106c select * from t106a;
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test1, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values 
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test1, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test1, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -474,36 +474,36 @@ prepare s1 from insert into t106c
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test2, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test2, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values 
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test2, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'insert_test2, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -535,36 +535,36 @@ upsert using load into t106c
 obey TEST106(make_cancel_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'upsert_test1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'upsert_test1, launch canceler, finish');
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values 
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'upsert_test1, execute, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'upsert_test1, execute, finished');
 
 obey TEST106(synch_cancel);
@@ -583,26 +583,26 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps, execute s1, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps, execute s1, finished');
 
 obey TEST106(synch_cancel);
@@ -623,27 +623,27 @@ control query default COMP_INT_39 'reset';
 obey TEST106(make_cancel_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1, execute s1, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1, execute s1, finished');
 
 obey TEST106(synch_cancel);
@@ -746,27 +746,27 @@ c10k, c1k, c100, c10, c1, uniq
 obey TEST106(make_cancel_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'ustats_test, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'ustats_test, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'ustats_test, execute s1, start');
 
 execute s1;
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6),
+(CURRENT_TIMESTAMP (6),
 'ustats_test, execute s1, finished');
 
 obey TEST106(synch_cancel);
@@ -792,37 +792,37 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_nid_pid_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_nid_pid, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_nid_pid)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_nid_pid, launch canceler, finished');
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_nid_pid, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_nid_pid, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -847,29 +847,29 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_nid_pid_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_nid_pid, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_nid_pid)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_nid_pid, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_nid_pid, execute s1, start');
 
 ------- long running, cpu-bound select query -------
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_nid_pid, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -887,28 +887,28 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_nid_pid_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_nid_pid, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_nid_pid)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_nid_pid, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_nid_pid, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_nid_pid, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -928,28 +928,28 @@ control query default COMP_INT_39 'reset';
 obey TEST106(make_cancel_nid_pid_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_nid_pid, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_nid_pid)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_nid_pid, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_nid_pid, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_nid_pid, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -974,37 +974,37 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_pname_stmt);
 
 select 'subject launch canceler - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_pname, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_pname)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_pname, launch canceler, finished');
 
 select 'subject synch cancel - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
 select 'subject execute s1 - FUNKY_OPT_UNIQUE',
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_pname, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test1_pname, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -1029,29 +1029,29 @@ control query default QUERY_LIMIT_SQL_PROCESS_CPU 'reset';
 obey TEST106(make_cancel_pname_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_pname, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_pname)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_pname, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_pname, execute s1, start');
 
 ------- long running, cpu-bound select query -------
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'positive_test2_pname, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -1075,22 +1075,22 @@ insert into T106_interleaved_log values
 sh sqlci -i"TEST106(do_cancel_pname)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_pname, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_pname, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'cpu_bound_esps_pname, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -1110,28 +1110,28 @@ control query default COMP_INT_39 'reset';
 obey TEST106(make_cancel_pname_stmt);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_pname, launch canceler, start');
 
 sh sqlci -i"TEST106(do_cancel_pname)" & ;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_pname, launch canceler, finished');
 
 obey TEST106(synch_cancel);
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_pname, execute s1, start');
 
 execute s1;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'escalation1_pname, execute s1, finished');
 
-select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'subject - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 obey TEST106(synch_cancel);
 
@@ -1319,19 +1319,19 @@ obey cancel_cmd;
 ?section synch_cancel
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'foreground awaits synch_cancel');
 
 -- wait until other mxci is ready
 sh sh $scriptsdir/executor/synch_106.ksh;
 
 select 'done with synch_cancel - FUNKY_OPT_UNIQUE', 
-       CURRENT_TIME (6) from (values (1)) as t1;
+       CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 log;
 sh rm ${REGRRUNDIR}/test106_synch ; 
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'foreground finished synch_cancel');
 
 log LOG106;
@@ -1343,18 +1343,18 @@ log CANCEL_LOG106 clear;
 ------ Contents of cancel session --------;
 ------------------------------------------;
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel has begun');
 
 sh touch ${REGRRUNDIR}/test106_synch;
 
 select 'canceler going to sleep - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 sh sleep 13;
 
 select 'canceler woke up - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 set session default CANCEL_ESCALATION_INTERVAL '5';
 log;
@@ -1367,16 +1367,16 @@ sh grep "Execute End Time" GET_STATS106 >> CANCEL_LOG106;
 log CANCEL_LOG106;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel will cancel');
 
 obey cancel_cmd;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel has canceled');
 
-select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 log;
 sh cat CANCEL_LOG106 >> cancel_log106_all;
 
@@ -1390,18 +1390,18 @@ log CANCEL_LOG106 clear;
 ------ Contents of cancel session --------;
 ------------------------------------------;
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_pname has begun');
 
 sh touch ${REGRRUNDIR}/test106_synch;
 
 select 'canceler going to sleep - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 sh sleep 13;
 
 select 'canceler woke up - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 set session default CANCEL_ESCALATION_INTERVAL '5';
 log;
@@ -1413,16 +1413,16 @@ sh grep "Execute End Time" GET_STATS106 >> CANCEL_LOG106;
 log CANCEL_LOG106;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_pname will cancel');
 
 obey cancel_pname_cmd;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_pname has canceled');
 
-select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 log;
 sh cat CANCEL_LOG106 >> cancel_log106_all;
 
@@ -1436,18 +1436,18 @@ log CANCEL_LOG106 clear;
 ------ Contents of cancel session --------;
 ------------------------------------------;
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_nid_pid has begun');
 
 sh touch ${REGRRUNDIR}/test106_synch;
 
 select 'canceler going to sleep - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 sh sleep 13;
 
 select 'canceler woke up - FUNKY_OPT_UNIQUE', 
-CURRENT_TIME (6) from (values (1)) as t1;
+CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 
 set session default CANCEL_ESCALATION_INTERVAL '5';
 log;
@@ -1459,16 +1459,16 @@ sh grep "Execute End Time" GET_STATS106 >> CANCEL_LOG106;
 log CANCEL_LOG106;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_nid_pid will cancel');
 
 obey cancel_nid_pid_cmd;
 
 insert into T106_interleaved_log values
-(CURRENT_TIME (6), 
+(CURRENT_TIMESTAMP (6), 
 'do_cancel_nid_pid has canceled');
 
-select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIME (6) from (values (1)) as t1;
+select 'canceler - FUNKY_OPT_UNIQUE', CURRENT_TIMESTAMP (6) from (values (1)) as t1;
 log;
 sh cat CANCEL_LOG106 >> cancel_log106_all;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/regress/hive/EXPECTED009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED009 b/core/sql/regress/hive/EXPECTED009
new file mode 100644
index 0000000..89c004a
--- /dev/null
+++ b/core/sql/regress/hive/EXPECTED009
@@ -0,0 +1,275 @@
+>>obey TEST009(set_up);
+>>prepare get_hv_schemas from
++>select schema_name from "_MD_".objects
++>where schema_name like '_HV_%' 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;
+>>
+>>-- make sure no external hive schema exist in Trafodion
+>>execute get_hv_schemas;
+
+--- 0 row(s) selected.
+>>
+>>obey TEST009(tests);
+>>-- create external tables for precreated tables
+>>create external table customer for hive.hive.customer;
+
+--- SQL operation complete.
+>>create external table item for hive.hive.item;
+
+--- SQL operation complete.
+>>create external table promotion for hive.hive.promotion;
+
+--- SQL operation complete.
+>>
+>>-- should create an schema called "_HV_HIVE_"
+>>execute get_hv_schemas;
+
+SCHEMA_NAME
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+_HV_HIVE_                                                                                                                                                                                                                                                       
+
+--- 1 row(s) selected.
+>>
+>>-- Verify tables were created
+>>showddl trafodion."_HV_HIVE_".customer;
+
+CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".CUSTOMER
+  (
+    C_CUSTOMER_SK                    INT DEFAULT NULL
+  , C_CUSTOMER_ID                    VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_CURRENT_CDEMO_SK               INT DEFAULT NULL
+  , C_CURRENT_HDEMO_SK               INT DEFAULT NULL
+  , C_CURRENT_ADDR_SK                INT DEFAULT NULL
+  , C_FIRST_SHIPTO_DATE_SK           INT DEFAULT NULL
+  , C_FIRST_SALES_DATE_SK            INT DEFAULT NULL
+  , C_SALUTATION                     VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_FIRST_NAME                     VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_LAST_NAME                      VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_PREFERRED_CUST_FLAG            VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_BIRTH_DAY                      INT DEFAULT NULL
+  , C_BIRTH_MONTH                    INT DEFAULT NULL
+  , C_BIRTH_YEAR                     INT DEFAULT NULL
+  , C_BIRTH_COUNTRY                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_LOGIN                          VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_EMAIL_ADDRESS                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , C_LAST_REVIEW_DATE               VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>showddl trafodion."_HV_HIVE_".item;
+
+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_ITEM_DESC                      VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_CURRENT_PRICE                  REAL DEFAULT NULL
+  , I_WHOLESALE_COST                 REAL DEFAULT NULL
+  , I_BRAND_ID                       INT DEFAULT NULL
+  , I_BRAND                          VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_CLASS_ID                       INT DEFAULT NULL
+  , I_CLASS                          VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_CATEGORY_ID                    INT DEFAULT NULL
+  , I_CATEGORY                       VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_MANUFACT_ID                    INT DEFAULT NULL
+  , I_MANUFACT                       VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_SIZE                           VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_FORMULATION                    VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_COLOR                          VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_UNITS                          VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_CONTAINER                      VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , I_MANAGER_ID                     INT DEFAULT NULL
+  , I_PRODUCT_NAME                   VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>showddl trafodion."_HV_HIVE_".promotion;
+
+CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".PROMOTION
+  (
+    P_PROMO_SK                       INT DEFAULT NULL
+  , P_PROMO_ID                       VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_START_DATE_SK                  INT DEFAULT NULL
+  , P_END_DATE_SK                    INT DEFAULT NULL
+  , P_ITEM_SK                        INT DEFAULT NULL
+  , P_COST                           REAL DEFAULT NULL
+  , P_RESPONSE_TARGET                INT DEFAULT NULL
+  , P_PROMO_NAME                     VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_DMAIL                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_EMAIL                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_CATALOG                VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_TV                     VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_RADIO                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_PRESS                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_EVENT                  VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_DEMO                   VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_CHANNEL_DETAILS                VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_PURPOSE                        VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  , P_DISCOUNT_ACTIVE                VARCHAR(32000 BYTES) CHARACTER SET UTF8
+      COLLATE DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>
+>>-- create external tables from hive schema sch_t009
+>>create external table t009t1 for hive.sch_t009.t009t1;
+
+--- SQL operation complete.
+>>create external table t009t2 for hive.sch_t009.t009t2;
+
+--- SQL operation complete.
+>>
+>>execute get_hv_schemas;
+
+SCHEMA_NAME
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+_HV_HIVE_                                                                                                                                                                                                                                                       
+_HV_SCH_T009_                                                                                                                                                                                                                                                   
+
+--- 2 row(s) selected.
+>>showddl trafodion."_HV_SCH_T009_".t009t1;
+
+CREATE EXTERNAL TABLE TRAFODION."_HV_SCH_T009_".T009T1
+  (
+    A                                INT DEFAULT NULL
+  , B                                INT DEFAULT NULL
+  , C                                INT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>showddl trafodion."_HV_SCH_T009_".t009t2;
+
+CREATE EXTERNAL TABLE TRAFODION."_HV_SCH_T009_".T009T2
+  (
+    A                                INT DEFAULT NULL
+  , B                                INT DEFAULT NULL
+  , C                                INT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>
+>>select count(*) from hive.hive.customer;
+
+(EXPR)              
+--------------------
+
+              100000
+
+--- 1 row(s) selected.
+>>select count(*) from hive.hive.item;
+
+(EXPR)              
+--------------------
+
+               18000
+
+--- 1 row(s) selected.
+>>select count(*) from hive.hive.promotion;
+
+(EXPR)              
+--------------------
+
+                 300
+
+--- 1 row(s) selected.
+>>
+>>select * from hive.sch_t009.t009t1;
+
+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.
+>>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.
+>>
+>>-- accesses to the external name should be 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.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>drop external table "_HV_HIVE_".customer;
+
+--- SQL operation complete.
+>>drop external table item for hive.hive.item;
+
+--- SQL operation complete.
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/regress/hive/TEST009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST009 b/core/sql/regress/hive/TEST009
new file mode 100755
index 0000000..292ac65
--- /dev/null
+++ b/core/sql/regress/hive/TEST009
@@ -0,0 +1,106 @@
+-- ============================================================================
+-- TEST009 - tests external tables for hive
+--
+-- @@@ START COPYRIGHT @@@
+--
+--  Licensed 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 @@@
+--
+-- This tests the following commands:
+--
+--   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 
+-- exist:
+--     customer
+--     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);
+log;
+obey TEST009(clean_up);
+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;
+
+-- remove data from hdfs
+sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
+sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t2/*;
+
+
+?section 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;
+
+-- make sure no external hive schema exist in Trafodion
+execute get_hv_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
+-- create external tables for precreated tables
+create external table customer for hive.hive.customer;
+create external table item for hive.hive.item;
+create external table promotion for hive.hive.promotion;
+
+-- should create an schema called "_HV_HIVE_"
+execute get_hv_schemas;
+
+-- Verify tables were created
+showddl trafodion."_HV_HIVE_".customer;
+showddl trafodion."_HV_HIVE_".item;
+showddl trafodion."_HV_HIVE_".promotion;
+
+-- create external tables from hive schema sch_t009
+create external table t009t1 for hive.sch_t009.t009t1;
+create external table t009t2 for hive.sch_t009.t009t2;
+
+execute get_hv_schemas;
+showddl trafodion."_HV_SCH_T009_".t009t1;
+showddl trafodion."_HV_SCH_T009_".t009t2;
+
+select count(*) from hive.hive.customer;
+select count(*) from hive.hive.item;
+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
+select * from trafodion."_HV_SCH_T009_".t009t1;
+
+drop external table "_HV_HIVE_".customer;
+drop external table item for hive.hive.item;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/regress/hive/TEST009_a.hive.sql
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST009_a.hive.sql b/core/sql/regress/hive/TEST009_a.hive.sql
new file mode 100644
index 0000000..38a8563
--- /dev/null
+++ b/core/sql/regress/hive/TEST009_a.hive.sql
@@ -0,0 +1,64 @@
+-- @@@ START COPYRIGHT @@@
+--  Licensed 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 @@@
+
+-- ============================================================================
+-- All tables are created as EXTERNAL in a location already setup by 
+-- install_local_hadoop. The EXTERNAL keyword lets you create a table and 
+-- provide a LOCATION so that Hive does not use the default location 
+-- specified by the configuration property hive.metastore.warehouse.dir.
+-- ============================================================================
+
+-- Our version of HIVE does not support special characters.  This test should 
+-- be changed to use delimited names once we upgrade HIVE.
+
+create schema if not exists sch_t009;
+use sch_t009;
+drop table t009t1;
+create external table t009t1
+(
+    a int,
+    b int, 
+    c int
+)
+row format delimited fields terminated by '|'
+location '/user/hive/exttables/t009t1';
+
+-- Our version of HIVE does not support insert ... VALUES clause, so use the
+-- load command from an existing table.
+insert into table t009t1
+select c_customer_sk, c_birth_day, c_birth_month
+from default.customer
+limit 10;
+
+select * from t009t1;
+
+drop table t009t2;
+create external table t009t2
+(
+    a int,
+    b int,
+    c int
+)
+row format delimited fields terminated by '|'
+location '/user/hive/exttables/t009t2';
+
+insert into table t009t2
+select c_customer_sk, c_birth_day, c_birth_month
+from default.customer
+limit 10;
+
+select * from t009t2;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcat/desc.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcat/desc.h b/core/sql/sqlcat/desc.h
index ff0a6fe..3e98d6c 100644
--- a/core/sql/sqlcat/desc.h
+++ b/core/sql/sqlcat/desc.h
@@ -126,6 +126,7 @@ struct table_desc_struct {
   char * snapshotName;
   char * default_col_fam;
   char * all_col_fams;
+  Int64 tableFlags;
   desc_struct *columns_desc;
   desc_struct *indexes_desc;
   desc_struct *constrnts_desc;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
index 05a4f80..e3ad51e 100644
--- a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
+++ b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
@@ -214,8 +214,8 @@ enum CatErrorCode { CAT_FIRST_ERROR = 1000
                   //
                   // 1150-1180  Queuing and publish/subscribe errors
                   //
-                  , CAT_SUBVOLUME_MISMATCH                        = 1180
-                  , CAT_DROP_LABEL_ERROR                          = 1181
+                  , CAT_EXTERNAL_NAME_MISMATCH                    = 1180
+                  , CAT_EXTERNAL_SCHEMA_NAME_TOO_LONG             = 1181
                   , CAT_RFORK_SQL_ERROR                           = 1182
                   , CAT_METADATA_SQL_ERROR                        = 1183
                   , CAT_INSUFFICIENT_PRIV_ON_COLUMN               = 1184

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index a886b7f..dc590fc 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -2282,7 +2282,8 @@ static short cmpDisplayColumn(const NAColumn *nac,
                               Space &space, char * buf,
                               Lng32 &ii,
                               NABoolean namesOnly,
-                              NABoolean &identityCol)
+                              NABoolean &identityCol,
+                              NABoolean isExternalTable)
 {
   identityCol = FALSE;
   
@@ -2291,7 +2292,8 @@ static short cmpDisplayColumn(const NAColumn *nac,
 
   NAString colFam;
   if ((nac->getNATable()->isSQLMXAlignedTable()) || 
-      (nac->getHbaseColFam() == SEABASE_DEFAULT_COL_FAMILY))
+      (nac->getHbaseColFam() == SEABASE_DEFAULT_COL_FAMILY) ||
+      isExternalTable)
     colFam = "";
   else if (nac->getNATable()->isSeabaseTable())
     {
@@ -2436,6 +2438,7 @@ short cmpDisplayColumns(const NAColumnArray & naColArr,
                         NABoolean displaySystemCols,
                         NABoolean namesOnly,
                         Lng32 &identityColPos,
+                        NABoolean isExternalTable,
                         char * inColName = NULL,
                         NABoolean isAdd = FALSE,
                         const NAColumn * nacol = NULL)
@@ -2461,7 +2464,7 @@ short cmpDisplayColumns(const NAColumnArray & naColArr,
             continue;
         }
       
-       if (cmpDisplayColumn(nac, type, space, buf, ii, namesOnly, identityCol))
+       if (cmpDisplayColumn(nac, type, space, buf, ii, namesOnly, identityCol, isExternalTable))
         return -1;
 
       if (identityCol)
@@ -2472,7 +2475,7 @@ short cmpDisplayColumns(const NAColumnArray & naColArr,
 
   if ((inColName) && (isAdd) && (nacol))
     {
-      if (cmpDisplayColumn(nacol, type, space, buf, ii, namesOnly, identityCol))
+      if (cmpDisplayColumn(nacol, type, space, buf, ii, namesOnly, identityCol, isExternalTable))
         return -1;
     }
 
@@ -2566,7 +2569,8 @@ short CmpDescribeSeabaseTable (
   const NAString& tableName =
     dtName.getQualifiedNameObj().getQualifiedNameAsAnsiString(TRUE);
  
-  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  // set inDDL to try to allow Hive External tables to be described
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), TRUE/*inDDL*/);
   NATable *naTable = bindWA.getNATable((CorrName&)dtName); 
   TableDesc *tdesc = NULL;
   if (naTable == NULL || bindWA.errStatus())
@@ -2582,6 +2586,7 @@ short CmpDescribeSeabaseTable (
     return -1;
 
   NABoolean isVolatile = naTable->isVolatileTable();
+  NABoolean isExternalTable = naTable->isExternalTable();
 
   char * buf = new (heap) char[15000];
   CMPASSERT(buf);
@@ -2714,14 +2719,14 @@ short CmpDescribeSeabaseTable (
       else
         sprintf(buf,  "-- Definition of Trafodion%stable %s\n"
                 "-- Definition current  %s",
-                (isVolatile ? " volatile " : " "), 
+                (isVolatile ? " volatile " : isExternalTable ? " external " : " "), 
                 tableName.data(), ctime(&tp));
       outputShortLine(space, buf);
     }
   else if (type == 2)
     {
       sprintf(buf,  "CREATE%sTABLE %s",
-              (isVolatile ? " VOLATILE " : " "),
+              (isVolatile ? " VOLATILE " : isExternalTable ? " EXTERNAL " : " "), 
               tableName.data());
       outputShortLine(space, buf);
     }
@@ -2733,6 +2738,7 @@ short CmpDescribeSeabaseTable (
 		    displaySystemCols, 
 		    FALSE,
                     identityColPos,
+                    isExternalTable,
                     colName, isAdd, nacol);
 
   Int32 nonSystemKeyCols = 0;
@@ -3056,7 +3062,8 @@ short CmpDescribeSeabaseTable (
                                 type, space, buf,
 				displaySystemCols,
 				(type == 2),
-                                dummy);
+                                dummy,
+                                isExternalTable);
 	      outputShortLine(space, "  )");
 	      
 	      sprintf(buf,  "  PRIMARY KEY ");
@@ -3428,7 +3435,7 @@ bool CmpDescribeIsAuthorized(
            break;
         case COM_PRIVATE_SCHEMA_OBJECT:
         case COM_SHARED_SCHEMA_OBJECT:
-           break;
+          break;
         case COM_VIEW_OBJECT:
         case COM_BASE_TABLE_OBJECT:
         default:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index 6ff59e2..1146e01 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -177,6 +177,10 @@ class CmpSeabaseDDL
                                            const NAString &catName,
                                            const NAString &schName);
  
+  static NABoolean isSeabaseExternalSchema(
+                                           const NAString &catName,
+                                           const NAString &schName);
+
   NABoolean isAuthorizationEnabled();
 
   short existsInHbase(const NAString &objName,
@@ -343,15 +347,16 @@ class CmpSeabaseDDL
                      NABoolean lookInObjectsIdx = FALSE,
                      NABoolean reportErrorNow = TRUE);
 
-   Int64 getObjectUIDandOwners(
+   Int64 getObjectInfo(
                      ExeCliInterface * cliInterface,
                      const char * catName,
                      const char * schName,
                      const char * objName,
                      const ComObjectType objectType,
-		     Int32 & objectOwner,
-		     Int32 & schemaOwner,
-		     bool reportErrorNow = true,
+                     Int32 & objectOwner,
+                     Int32 & schemaOwner,
+                     Int64 & objectFlags,
+                     bool reportErrorNow = true,
                      NABoolean checkForValidDef = FALSE);
   
    short getObjectName(
@@ -606,6 +611,7 @@ class CmpSeabaseDDL
                                     const char * validDef, 
                                     Int32 objOwnerID,
                                     Int32 schemaOwnerID,
+                                    Int64 objectFlags,
                                     Int64 & inUID);
                                     
   short getAllIndexes(ExeCliInterface *cliInterface,
@@ -627,8 +633,6 @@ class CmpSeabaseDDL
 			     const ComTdbVirtTableKeyInfo * keyInfo,
 			     Lng32 numIndexes,
 			     const ComTdbVirtTableIndexInfo * indexInfo,
-                             Int32 objOwnerID,
-                             Int32 schemaOwnerID,
                              Int64 &inUID);
 
   short deleteFromSeabaseMDTable(
@@ -892,7 +896,13 @@ class CmpSeabaseDDL
   void createSeabaseTableLike(
 			      StmtDDLCreateTable                  * createTableNode,
 			      NAString &currCatName, NAString &currSchName);
-  
+
+  short createSeabaseTableExternalHive(
+                                       ExeCliInterface &cliInterface,
+                                       StmtDDLCreateTable * createTableNode,
+                                       NAString &currCatName,
+                                       NAString &currSchName);
+
   short dropSeabaseTable2(
                           ExeCliInterface *cliInterface,
                           StmtDDLDropTable * dropTableNode,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index bd86f9b..593df87 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -1012,6 +1012,23 @@ NABoolean CmpSeabaseDDL::isSeabaseReservedSchema(
   return isSeabaseReservedSchema(catName, schName);
 }
 
+NABoolean CmpSeabaseDDL::isSeabaseExternalSchema(
+                                  const NAString &catName,
+                                  const NAString &schName)
+{
+  if (catName.isNull())
+    return FALSE;
+
+  NAString seabaseDefCatName = "";
+  CmpCommon::getDefault(SEABASE_CATALOG, seabaseDefCatName, FALSE);
+  seabaseDefCatName.toUpper();
+
+  if (catName != seabaseDefCatName)
+    return FALSE;
+
+  return ComIsTrafodionExternalSchemaName(schName);
+}
+ 
 // ----------------------------------------------------------------------------
 // Method:  isUserUpdatableSeabaseMD
 //
@@ -3394,7 +3411,7 @@ Int64 CmpSeabaseDDL::getObjectUID(
   return objUID;
 }
 
-Int64 CmpSeabaseDDL::getObjectUIDandOwners(
+Int64 CmpSeabaseDDL::getObjectInfo(
                                    ExeCliInterface *cliInterface,
                                    const char * catName,
                                    const char * schName,
@@ -3402,6 +3419,7 @@ Int64 CmpSeabaseDDL::getObjectUIDandOwners(
                                    const ComObjectType objectType,
                                    Int32 & objectOwner,
                                    Int32 & schemaOwner,
+                                   Int64 & objectFlags,
                                    bool reportErrorNow,
                                    NABoolean checkForValidDef)
 {
@@ -3422,7 +3440,7 @@ Int64 CmpSeabaseDDL::getObjectUIDandOwners(
     strcpy(cfvd, " and valid_def = 'Y' ");
 
   char buf[4000];
-  str_sprintf(buf, "select object_uid, object_owner, schema_owner from %s.\"%s\".%s where catalog_name = '%s' and schema_name = '%s' and object_name = '%s'  and object_type = '%s' %s ",
+  str_sprintf(buf, "select object_uid, object_owner, schema_owner, flags from %s.\"%s\".%s where catalog_name = '%s' and schema_name = '%s' and object_name = '%s'  and object_type = '%s' %s ",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catName, quotedSchName.data(), quotedObjName.data(),
               objectTypeLit, cfvd);
@@ -3451,15 +3469,23 @@ Int64 CmpSeabaseDDL::getObjectUIDandOwners(
 
   char * ptr = NULL;
   Lng32 len = 0;
+
+  // return object_uid
   cliInterface->getPtrAndLen(1, ptr, len);
   Int64 objUID = *(Int64*)ptr;
 
+  // return object_owner
   cliInterface->getPtrAndLen(2, ptr, len);
   objectOwner = *(Int32*)ptr;
 
+  // return schema_owner
   cliInterface->getPtrAndLen(3, ptr, len);
   schemaOwner = *(Int32*)ptr;
 
+  // return flags
+  cliInterface->getPtrAndLen(4, ptr, len);
+  objectFlags = *(Int64*)ptr;
+
   cliInterface->fetchRowsEpilogue(NULL, TRUE);
 
   return objUID;
@@ -4191,6 +4217,7 @@ short CmpSeabaseDDL::updateSeabaseMDObjectsTable(
                                          const char * validDef, 
                                          Int32 objOwnerID,
                                          Int32 schemaOwnerID,
+                                         Int64 objectFlags,
                                          Int64 &inUID)
 {
 
@@ -4223,7 +4250,7 @@ short CmpSeabaseDDL::updateSeabaseMDObjectsTable(
   NAString quotedObjName;
   ToQuotedString(quotedObjName, NAString(objName), FALSE);
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, 0 )",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, %Ld )",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catName, quotedSchName.data(), quotedObjName.data(),
               objectTypeLit,
@@ -4233,7 +4260,8 @@ short CmpSeabaseDDL::updateSeabaseMDObjectsTable(
               validDef,
               COM_NO_LIT,
               objOwnerID,
-              schemaOwnerID);
+              schemaOwnerID,
+              objectFlags);
   cliRC = cliInterface->executeImmediate(buf);
   
   if (cliRC < 0)
@@ -4310,8 +4338,6 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
                                          const ComTdbVirtTableKeyInfo * keyInfo,
                                          Lng32 numIndexes,
                                          const ComTdbVirtTableIndexInfo * indexInfo,
-                                         Int32 objOwnerID,
-                                         Int32 schemaOwnerID,
                                          Int64 &inUID)
 {
   NABoolean useRWRS = FALSE;
@@ -4320,8 +4346,12 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
       useRWRS = TRUE;
     }
 
+  Int32 objOwnerID = (tableInfo) ? tableInfo->objOwnerID : SUPER_USER;
+  Int32 schemaOwnerID = (tableInfo) ? tableInfo->schemaOwnerID : SUPER_USER;
+  Int64 objectFlags = (tableInfo) ? tableInfo->objectFlags : 0;
+  
   if (updateSeabaseMDObjectsTable(cliInterface,catName,schName,objName,objectType,
-                                  validDef,objOwnerID,schemaOwnerID,inUID))
+                                  validDef,objOwnerID, schemaOwnerID, objectFlags, inUID))
     return -1;
     
   Int64 objUID = inUID;
@@ -4680,8 +4710,8 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
       if (!insertPrivMgrInfo(objUID,
                              fullName,
                              objectType,
-                             objOwnerID,
-                             schemaOwnerID,
+                             tableInfo->objOwnerID,
+                             tableInfo->schemaOwnerID,
                              ComUser::getCurrentUser()))
         {
           *CmpCommon::diags()
@@ -4758,17 +4788,30 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
   NAString quotedSpjObjName;
   ToQuotedString(quotedSpjObjName, NAString(routineInfo->routine_name), FALSE);
   Int64 objUID = -1;
+
+  ComTdbVirtTableTableInfo * tableInfo = new(STMTHEAP) ComTdbVirtTableTableInfo[1];
+  tableInfo->tableName = NULL,
+  tableInfo->createTime = 0;
+  tableInfo->redefTime = 0;
+  tableInfo->objUID = 0;
+  tableInfo->objOwnerID = ownerID;
+  tableInfo->schemaOwnerID = schemaOwnerID;
+  tableInfo->isAudited = 1;
+  tableInfo->validDef = 1;
+  tableInfo->hbaseCreateOptions = NULL;
+  tableInfo->numSaltPartns = 0;
+  tableInfo->rowFormat = COM_UNKNOWN_FORMAT_TYPE;
+  tableInfo->objectFlags = 0;
+
   if (updateSeabaseMDTable(cliInterface, 
                            catalogNamePart, schemaNamePart, quotedSpjObjName,
                            COM_USER_DEFINED_ROUTINE_OBJECT,
                            "Y",
-                           NULL,
+                           tableInfo,
                            numCols,
                            colInfo,
                            0, NULL,
                            0, NULL, 
-                           ownerID,
-                           schemaOwnerID,
                            objUID))
     {
       return -1;
@@ -6228,10 +6271,11 @@ short CmpSeabaseDDL::dropSeabaseObject(ExpHbaseInterface * ehi,
         //   than to do an extra I/O.
         Int32 objOwnerID = 0;
         Int32 schemaOwnerID = 0;
-        Int64 objUID = getObjectUIDandOwners(&cliInterface,
-                                             catalogNamePart.data(), schemaNamePart.data(),
-                                             objectNamePart.data(), objType,
-                                             objOwnerID,schemaOwnerID);
+        Int64 objectFlags = 0;
+        Int64 objUID = getObjectInfo(&cliInterface,
+                                     catalogNamePart.data(), schemaNamePart.data(),
+                                     objectNamePart.data(), objType,
+                                     objOwnerID,schemaOwnerID,objectFlags);
 
         if (objUID < 0 || objOwnerID == 0)
           { //TODO: Internal error?
@@ -6379,6 +6423,7 @@ void CmpSeabaseDDL::initSeabaseMD()
   Lng32 cliRC = 0;
   NABoolean xnWasStartedHere = FALSE;
   Int64 schemaUID = -1;  
+  Int64 objectFlags = 0;
 
   Lng32 numTables = sizeof(allMDtablesInfo) / sizeof(MDTableInfo);
 
@@ -6394,6 +6439,8 @@ void CmpSeabaseDDL::initSeabaseMD()
 
   const char* sysCat = ActiveSchemaDB()->getDefaults().getValue(SEABASE_CATALOG);
 
+  ComTdbVirtTableTableInfo * tableInfo = new(STMTHEAP) ComTdbVirtTableTableInfo[1];
+ 
   Lng32 hbaseErrNum = 0;
   NAString hbaseErrStr;
   Lng32 errNum = validateVersions(&ActiveSchemaDB()->getDefaults(), ehi,
@@ -6471,11 +6518,12 @@ void CmpSeabaseDDL::initSeabaseMD()
       goto label_error;
     }
 
+
   // Create Seabase system schema
   if (updateSeabaseMDObjectsTable(&cliInterface,sysCat,SEABASE_SYSTEM_SCHEMA,
                                   SEABASE_SCHEMA_OBJECTNAME,
                                   COM_SHARED_SCHEMA_OBJECT,"Y",SUPER_USER,
-                                  SUPER_USER,schemaUID))
+                                  SUPER_USER,objectFlags,schemaUID))
   {
     goto label_error;
   }
@@ -6485,7 +6533,7 @@ void CmpSeabaseDDL::initSeabaseMD()
   if (updateSeabaseMDObjectsTable(&cliInterface,sysCat,SEABASE_MD_SCHEMA,
                                   SEABASE_SCHEMA_OBJECTNAME,
                                   COM_PRIVATE_SCHEMA_OBJECT,"Y",SUPER_USER,
-                                  SUPER_USER,schemaUID))
+                                  SUPER_USER,objectFlags, schemaUID))
   {
     goto label_error;
   }
@@ -6511,8 +6559,6 @@ void CmpSeabaseDDL::initSeabaseMD()
                                mddi.newKeyInfo,
                                mddi.numIndexes,
                                mddi.indexInfo,
-                               SUPER_USER,
-                               SUPER_USER,
                                objUID))
         {
           goto label_error;
@@ -6529,19 +6575,30 @@ void CmpSeabaseDDL::initSeabaseMD()
       if (NOT mdti.isIndex)
         continue;
 
+      tableInfo->tableName = NULL,
+      tableInfo->createTime = 0;
+      tableInfo->redefTime = 0;
+      tableInfo->objUID = 0;
+      tableInfo->objOwnerID = SUPER_USER;
+      tableInfo->schemaOwnerID = SUPER_USER;
+      tableInfo->isAudited = 1;
+      tableInfo->validDef = 1;
+      tableInfo->hbaseCreateOptions = NULL;
+      tableInfo->numSaltPartns = 0;
+      tableInfo->rowFormat = COM_UNKNOWN_FORMAT_TYPE;
+      tableInfo->objectFlags = 0;
+
       Int64 objUID = -1;
       if (updateSeabaseMDTable(&cliInterface, 
                                sysCat, SEABASE_MD_SCHEMA, mdti.newName,
                                COM_INDEX_OBJECT,
                                "Y",
-                               NULL,
+                               tableInfo,
                                mddi.numNewCols,
                                mddi.newColInfo,
                                mddi.numNewKeys,
                                mddi.newKeyInfo,
                                0, NULL,
-                               SUPER_USER,
-                               SUPER_USER,
                                objUID))
         {
           goto label_error;
@@ -7071,10 +7128,11 @@ void  CmpSeabaseDDL::alterSeabaseSequence(StmtDDLCreateSequence  * alterSequence
 
   Int32 objectOwnerID = 0;
   Int32 schemaOwnerID = 0;
-  Int64 seqUID = getObjectUIDandOwners(&cliInterface,
-                                       catalogNamePart.data(), schemaNamePart.data(),
-                                       seqNamePart.data(), COM_SEQUENCE_GENERATOR_OBJECT,
-                                       objectOwnerID,schemaOwnerID);
+  Int64 objectFlags = 0;
+  Int64 seqUID = getObjectInfo(&cliInterface,
+                               catalogNamePart.data(), schemaNamePart.data(),
+                               seqNamePart.data(), COM_SEQUENCE_GENERATOR_OBJECT,
+                               objectOwnerID,schemaOwnerID,objectFlags);
   
   // Check for error getting metadata information
   if (seqUID == -1 || objectOwnerID == 0)
@@ -7219,10 +7277,11 @@ void  CmpSeabaseDDL::dropSeabaseSequence(StmtDDLDropSequence  * dropSequenceNode
     {
       Int32 objectOwnerID = 0;
       Int32 schemaOwnerID = 0;
-      Int64 seqUID = getObjectUIDandOwners(&cliInterface,
-                                           catalogNamePart.data(), schemaNamePart.data(),
-                                           objectNamePart.data(), COM_SEQUENCE_GENERATOR_OBJECT,
-                                           objectOwnerID,schemaOwnerID);
+      Int64 objectFlags = 0;
+      Int64 seqUID = getObjectInfo(&cliInterface,
+                                   catalogNamePart.data(), schemaNamePart.data(),
+                                   objectNamePart.data(), COM_SEQUENCE_GENERATOR_OBJECT,
+                                   objectOwnerID,schemaOwnerID,objectFlags);
   
       // Check for error getting metadata information
       if (seqUID == -1 || objectOwnerID == 0)
@@ -8932,10 +8991,11 @@ ComObjectType objectType;
       return CAT_INTERNAL_EXCEPTION_ERROR;
    }
 
-// For private schemas, the objects are always owned by the schema owner.   
-   schemaClass = COM_SCHEMA_CLASS_PRIVATE;
+   // For private schemas, the objects are always owned by the schema owner.
+   schemaClass = COM_SCHEMA_CLASS_PRIVATE; 
    objectOwner = schemaOwner;
 
+
 // Root user is authorized for all create operations in private schemas.  For 
 // installations with no authentication, all users are mapped to root database  
 // user, so all users have full DDL create authority.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
index c2e62b9..7beec72 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
@@ -906,8 +906,6 @@ void CmpSeabaseDDL::createSeabaseIndex(
 			 keyInfoArray,
 			 1, // numIndex
                          ii,
-                         tableInfo->objOwnerID,
-                         tableInfo->schemaOwnerID,
                          objUID))
     {
       goto label_error;
@@ -1763,10 +1761,11 @@ void CmpSeabaseDDL::alterSeabaseTableDisableOrEnableIndex(
   Int64 btUID;
   Int32 btObjOwner = 0;
   Int32 btSchemaOwner = 0;
-  if ((getObjectUIDandOwners(&cliInterface,
-                             btCatName, btSchName, btObjName, 
-                             COM_BASE_TABLE_OBJECT,
-                             btObjOwner, btSchemaOwner)) < 0)
+  Int64 btObjectFlags = 0;
+  if ((getObjectInfo(&cliInterface,
+                     btCatName, btSchName, btObjName, 
+                     COM_BASE_TABLE_OBJECT,
+                     btObjOwner, btSchemaOwner, btObjectFlags)) < 0)
     {
       processReturn();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpSeabaseDDLmd.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLmd.h b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
index 822e420..006bdcb 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLmd.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
@@ -238,6 +238,16 @@ static const QString seabaseObjectsUniqIdxDDL[] =
   {" ; "}
 };
 
+enum SeabaseObjectsFlags {
+  SEABASE_OBJECT_IS_EXTERNAL_HIVE  = 0x0000000000000001, // set if this object
+                                                         // references external
+                                                         // HIVE table
+  SEABASE_OBJECT_IS_EXTERNAL_HBASE  = 0x0000000000000002 // set if this object
+                                                         // references external
+                                                         // HBASE table
+
+};
+
 static const QString seabaseRefConstraintsDDL[] =
 {
   {" create table "SEABASE_REF_CONSTRAINTS" "},

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index d3a7aa7..7983e5b 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -348,20 +348,32 @@ void CmpSeabaseDDL::createSeabaseLibrary(
       processReturn();
       return;
     }
+
+  ComTdbVirtTableTableInfo * tableInfo = new(STMTHEAP) ComTdbVirtTableTableInfo[1];
+  tableInfo->tableName = NULL,
+  tableInfo->createTime = 0;
+  tableInfo->redefTime = 0;
+  tableInfo->objUID = 0;
+  tableInfo->objOwnerID = objectOwnerID;
+  tableInfo->schemaOwnerID = schemaOwnerID;
+  tableInfo->isAudited = 1;
+  tableInfo->validDef = 1;
+  tableInfo->hbaseCreateOptions = NULL;
+  tableInfo->numSaltPartns = 0;
+  tableInfo->rowFormat = COM_UNKNOWN_FORMAT_TYPE;
+  tableInfo->objectFlags = 0;
   
   Int64 objUID = -1;
   if (updateSeabaseMDTable(&cliInterface, 
 			   catalogNamePart, schemaNamePart, objectNamePart,
 			   COM_LIBRARY_OBJECT,
 			   "N",
-			   NULL,
+			   tableInfo,
 			   0,
 			   NULL,
 			   0,			       
 			   NULL,
 			   0, NULL,
-                           objectOwnerID,
-                           schemaOwnerID,
                            objUID))
     {
       deallocEHI(ehi); 
@@ -460,10 +472,11 @@ void CmpSeabaseDDL::dropSeabaseLibrary(StmtDDLDropLibrary * dropLibraryNode,
 
   Int32 objectOwnerID = 0;
   Int32 schemaOwnerID = 0;
-  Int64 objUID = getObjectUIDandOwners(&cliInterface,
+  Int64 objectFlags = 0;
+  Int64 objUID = getObjectInfo(&cliInterface,
 			      catalogNamePart.data(), schemaNamePart.data(), 
 			      objectNamePart.data(), COM_LIBRARY_OBJECT,
-                              objectOwnerID,schemaOwnerID);
+                              objectOwnerID,schemaOwnerID,objectFlags);
   if (objUID < 0 || objectOwnerID == 0 || schemaOwnerID == 0)
     {
       deallocEHI(ehi); 
@@ -1009,18 +1022,30 @@ void CmpSeabaseDDL::createSeabaseRoutine(
       return;
     }
 
+  ComTdbVirtTableTableInfo * tableInfo = new(STMTHEAP) ComTdbVirtTableTableInfo[1];
+  tableInfo->tableName = NULL,
+  tableInfo->createTime = 0;
+  tableInfo->redefTime = 0;
+  tableInfo->objUID = 0;
+  tableInfo->objOwnerID = objectOwnerID;
+  tableInfo->schemaOwnerID = schemaOwnerID;
+  tableInfo->isAudited = 1;
+  tableInfo->validDef = 1;
+  tableInfo->hbaseCreateOptions = NULL;
+  tableInfo->numSaltPartns = 0;
+  tableInfo->rowFormat = COM_UNKNOWN_FORMAT_TYPE;
+  tableInfo->objectFlags = 0;
+
   Int64 objUID = -1;
   if (updateSeabaseMDTable(&cliInterface, 
 			   catalogNamePart, schemaNamePart, objectNamePart,
 			   COM_USER_DEFINED_ROUTINE_OBJECT,
 			   "N",
-			   NULL,
+			   tableInfo,
 			   numParams,
 			   colInfoArray,
 			   0, NULL,
 			   0, NULL,
-                           objectOwnerID,
-                           schemaOwnerID,
                            objUID))
     {
       deallocEHI(ehi); 
@@ -1166,6 +1191,7 @@ void CmpSeabaseDDL::dropSeabaseRoutine(StmtDDLDropRoutine * dropRoutineNode,
   Int64 objUID = 0;
   Int32 objectOwnerID = 0;
   Int32 schemaOwnerID = 0;
+  Int64 objectFlags = 0;
 
   // see if routine is cached
   BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
@@ -1182,10 +1208,10 @@ void CmpSeabaseDDL::dropSeabaseRoutine(StmtDDLDropRoutine * dropRoutineNode,
     }
   else
     {
-      objUID = getObjectUIDandOwners(&cliInterface,
+      objUID = getObjectInfo(&cliInterface,
 			      catalogNamePart.data(), schemaNamePart.data(), 
 			      objectNamePart.data(), COM_USER_DEFINED_ROUTINE_OBJECT,
-                              objectOwnerID,schemaOwnerID);
+                              objectOwnerID,schemaOwnerID,objectFlags);
     if (objUID < 0 || objectOwnerID == 0 || schemaOwnerID == 0)
       {
         deallocEHI(ehi);