You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/04/01 00:16:12 UTC

[01/50] [abbrv] incubator-trafodion git commit: Update uncomment_string

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master e1c12dd31 -> 19f236f25


Update uncomment_string

add copyright

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

Branch: refs/heads/master
Commit: 2155c3dd1d9d48ddfb3cd86ec28dafcb4d3f3233
Parents: e314529
Author: mashengchen <ma...@gmail.com>
Authored: Tue Mar 1 09:41:32 2016 +0800
Committer: mashengchen <ma...@gmail.com>
Committed: Tue Mar 1 09:41:32 2016 +0800

----------------------------------------------------------------------
 .../sqf/src/seatrans/hbase-trx/uncomment_string | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2155c3dd/core/sqf/src/seatrans/hbase-trx/uncomment_string
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/uncomment_string b/core/sqf/src/seatrans/hbase-trx/uncomment_string
index dffcd83..a36d80f 100755
--- a/core/sqf/src/seatrans/hbase-trx/uncomment_string
+++ b/core/sqf/src/seatrans/hbase-trx/uncomment_string
@@ -1,3 +1,25 @@
+#
+# @@@ 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 @@@
+#
 #!/bin/bash
 
 if [[ -z $1 ]]; then


[04/50] [abbrv] incubator-trafodion git commit: add .tmpl file to .gitignore

Posted by db...@apache.org.
add .tmpl file to .gitignore


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

Branch: refs/heads/master
Commit: e7b1691013976b0c57b51a20496e9adc1bc7d5e8
Parents: 4c9cfe4
Author: mashengchen <ma...@gmail.com>
Authored: Tue Mar 1 03:12:30 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Tue Mar 1 03:12:30 2016 +0000

----------------------------------------------------------------------
 core/sqf/src/seatrans/.gitignore | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e7b16910/core/sqf/src/seatrans/.gitignore
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/.gitignore b/core/sqf/src/seatrans/.gitignore
index 794f239..2d5d6f9 100644
--- a/core/sqf/src/seatrans/.gitignore
+++ b/core/sqf/src/seatrans/.gitignore
@@ -2,3 +2,13 @@ hbase-trx/target/
 tm/hbasetmlib2/target/
 tm/hbasetmlib2/testrun
 *.jar.mf
+hbase-trx/src/main/java/org/apache/hadoop/hbase/client/PatchClientScanner.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalScanner.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SsccRegionEndpoint.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/KeyValueListScanner.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java
+hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java


[45/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/parser/StmtDDLCreate.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreate.cpp b/core/sql/parser/StmtDDLCreate.cpp
index 7dcd4a2..1ff6542 100644
--- a/core/sql/parser/StmtDDLCreate.cpp
+++ b/core/sql/parser/StmtDDLCreate.cpp
@@ -4418,9 +4418,9 @@ StmtDDLCreateTable::synthesize()
 	  col->setColumnAttribute(pk);
 
 	  ElemDDLNode * pColAttrList = NULL;
-	  if (col->getChild(1))
+	  if (col->getChild(ElemDDLColDef::INDEX_ELEM_DDL_COL_ATTR_LIST))
 	    pColAttrList =
-	      col->getChild(1)->castToElemDDLNode(); //INDEX_ELEM_DDL_COL_ATTR_LIST);
+	      col->getChild(ElemDDLColDef::INDEX_ELEM_DDL_COL_ATTR_LIST)->castToElemDDLNode();
 	  
 	  ElemDDLNode * newColAttrList = NULL;
 	  if (pColAttrList)
@@ -4428,7 +4428,8 @@ StmtDDLCreateTable::synthesize()
 	      new (PARSERHEAP()) ElemDDLList(pColAttrList, pk);
 	  else
 	    newColAttrList = pk;
-	  col->setChild(1 /*INDEX_ELEM_DDL_COL_ATTR_LIST*/, newColAttrList);
+	  col->setChild(ElemDDLColDef::INDEX_ELEM_DDL_COL_ATTR_LIST, 
+                        newColAttrList);
 
 	  userSpecifiedPKey = TRUE;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index dc1a323a..637c0ab 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -2553,7 +2553,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <pElemDDL>  		column_attributes
 %type <pElemDDL>  		column_attribute
 %type <tokval>    		constraints_keyword
-%type <pElemDDL>  		optional_col_def_default_clause
 %type <pElemDDL>  		col_def_default_clause
 %type <pElemDDL>  		col_def_default_clause_argument
 %type <pElemDDL>                alter_col_default_clause_arg
@@ -24930,8 +24929,7 @@ reset_in_column_defn :
                   }
 
 /* type pElemDDL */
-column_definition : qualified_name data_type optional_col_def_default_clause
-                                optional_column_attributes
+column_definition : qualified_name data_type optional_column_attributes
                                 {
                                   NAType * type = $2;
 
@@ -24995,8 +24993,7 @@ column_definition : qualified_name data_type optional_col_def_default_clause
                                          colFam /* column family */,
                                          colNam /*column_name*/,
                                          type /*data_type*/,
-                                         $3 /*optional_col_def_default_clause*/,
-                                         $4 /*optional_column_attributes*/);
+                                         $3 /*optional_column_attributes*/);
                                   delete $1 /*column_name*/;
                                 }
 
@@ -25030,7 +25027,6 @@ column_definition : qualified_name
 				    ElemDDLColDef(
                                          colFam /* column family */,
                                          colNam /*column_name*/,
-                                          NULL,
                                          NULL,
                                          NULL);
                                   delete $1 /*column_name*/;
@@ -25040,14 +25036,6 @@ column_definition : qualified_name
 column_name : identifier
 
 /* type pElemDDL */
-optional_col_def_default_clause : empty
-                                {
-                                  $$ = NULL;
-                                }
-
-                      | col_def_default_clause
-
-/* type pElemDDL */
 col_def_default_clause : TOK_DEFAULT enableCharsetInferenceInColDefaultVal col_def_default_clause_argument
 				{
 				  $$ = $3 /*col_def_default_clause_argument*/;
@@ -25164,6 +25152,7 @@ column_attribute : column_constraint_definition
                     | optional_lobattrs
                     | heading
                     | serialized
+                    | col_def_default_clause
 
 /* type pElemDDL */
 column_constraint_definition :  constraint_name_definition

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/core/EXPECTED131
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED131 b/core/sql/regress/core/EXPECTED131
index c5a3fb5..57a464d 100644
--- a/core/sql/regress/core/EXPECTED131
+++ b/core/sql/regress/core/EXPECTED131
@@ -51,6 +51,18 @@
 
 --- SQL operation complete.
 >>
+>>-- setup for test_native
+>>grant role DB__HIVEROLE to SQL_USER4;
+
+--- SQL operation complete.
+>>showddl role DB__HIVEROLE;
+
+CREATE ROLE "DB__HIVEROLE";
+
+--- SQL operation complete.
+>>create external table item for hive.hive.item;
+
+--- SQL operation complete.
 >>
 >>log;
 >>
@@ -308,9 +320,9 @@ SQL_USER7
 >>
 >>-- expect error 8031 since the query is not running.
 >>obey cancel_cmd;
->>control query cancel qid MXID11000006223212317056413926129000000000206U3334000_52_S1;
+>>control query cancel qid MXID11000007219212324915937583329000000000206U3335600_52_S1;
 
-*** ERROR[8031] Server declined cancel request for query ID MXID11000006223212317056413926129000000000206U3334000_52_S1. The query is not in OPEN or FETCH or EXECUTE state.
+*** ERROR[8031] Server declined cancel request for query ID MXID11000007219212324915937583329000000000206U3335600_52_S1. The query is not in OPEN or FETCH or EXECUTE state.
 
 --- SQL operation failed with errors.
 >>
@@ -450,6 +462,65 @@ End of MXCI Session
 
 End of MXCI Session
 
+>>sh sqlci -i"TEST131(test_native)" -u sql_user3;
+>>values(user);
+
+(EXPR)
+---------------------------------------------------------------------------------------------------------------------------------
+
+SQL_USER3                                                                                                                        
+
+--- 1 row(s) selected.
+>>
+>>-- user3 has no privs
+>>select count(*) from hive.hive.item;
+
+*** ERROR[4481] The user does not have SELECT privilege on table or view HIVE.HIVE.ITEM.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-- grant privs to user3, now user3 can execute dml
+>>sh sqlci -i"TEST131(grant_hive_privs)" -u"SQL_User4"  ;
+>>grant select on hive.hive.item to sql_user3;
+
+--- SQL operation complete.
+>>
+>>exit;
+
+End of MXCI Session
+
+>>select count(*) from hive.hive.item;
+
+(EXPR)              
+--------------------
+
+               18000
+
+--- 1 row(s) selected.
+>>
+>>-- revoke privs from user3, user3 can no longer perform dml
+>>-- verify that query invalidate works as designed
+>>sh sqlci -i"TEST131(revoke_hive_privs)" -u"SQL_User4"  ;
+>>revoke select on hive.hive.item from sql_user3;
+
+--- SQL operation complete.
+>>
+>>exit;
+
+End of MXCI Session
+
+>>select count(*) from hive.hive.item;
+
+*** ERROR[4481] The user does not have SELECT privilege on table or view HIVE.HIVE.ITEM.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>exit;
+
+End of MXCI Session
+
 >>
 >>obey TEST131(clnup);
 >>
@@ -487,5 +558,19 @@ End of MXCI Session
 
 --- SQL operation failed with errors.
 >>
+>>-- cleanup for test_native
+>>drop external table item for hive.hive.item;
+
+--- SQL operation complete.
+>>revoke role DB__HIVEROLE from SQL_USER4;
+
+--- SQL operation complete.
+>>showddl role DB__HIVEROLE;
+
+CREATE ROLE "DB__HIVEROLE";
+  -- GRANT ROLE "DB__HIVEROLE" TO "DB__ROOT" WITH ADMIN OPTION;
+
+--- SQL operation complete.
+>>
 >>
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/core/TEST131
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST131 b/core/sql/regress/core/TEST131
index 75eb331..bffa4be 100755
--- a/core/sql/regress/core/TEST131
+++ b/core/sql/regress/core/TEST131
@@ -33,8 +33,10 @@ log LOG131 ;
 -- run the test in sqlci sessions which start after authorization
 -- is enabled.
 log;
+cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
 sh sqlci -i"TEST131(test_session1)";
 log LOG131 ;
+sh sqlci -i"TEST131(test_native)" -u sql_user3;
 
 obey TEST131(clnup);
 
@@ -74,6 +76,11 @@ revoke component privilege QUERY_CANCEL on sql_operations from SQL_USER7;
 revoke role role131  from sql_user7;
 revoke component privilege QUERY_CANCEL on SQL_OPERATIONS from role131;
 drop role role131;
+ 
+-- cleanup for test_native
+drop external table item for hive.hive.item;
+revoke role DB__HIVEROLE from SQL_USER4;
+showddl role DB__HIVEROLE;
 
 ?section setup
 
@@ -111,6 +118,10 @@ grant all on t131a to SQL_USER7;
 grant all on t131b to SQL_USER7;
 grant all on t131c to SQL_USER7;
 
+-- setup for test_native
+grant role DB__HIVEROLE to SQL_USER4;
+showddl role DB__HIVEROLE;
+create external table item for hive.hive.item;
 
 ?section dml
 
@@ -361,5 +372,34 @@ revoke role role131  from sql_user7;
 revoke component privilege QUERY_CANCEL on SQL_OPERATIONS from role131;
 drop role role131;
 
+?section test_native
+-- user3
+log LOG131;
+values(user);
+ 
+-- user3 has no privs
+select count(*) from hive.hive.item;
+
+-- grant privs to user3, now user3 can execute dml
+sh sqlci -i"TEST131(grant_hive_privs)" -u"SQL_User4"  ;
+select count(*) from hive.hive.item;
+
+-- revoke privs from user3, user3 can no longer perform dml
+-- verify that query invalidate works as designed
+sh sqlci -i"TEST131(revoke_hive_privs)" -u"SQL_User4"  ;
+select count(*) from hive.hive.item;
+
+?section grant_hive_privs
+-- user4 who has been granted DB__HIVEROLE
+values (user);
+log LOG131;
+grant select on hive.hive.item to sql_user3;
+
+?section revoke_hive_privs
+-- user4, has been granted DB__HIVEROLE
+values (user);
+log LOG131;
+revoke select on hive.hive.item from sql_user3;
+
 ?section end_of_test
 -- end of test.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/privs1/EXPECTED133
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/EXPECTED133 b/core/sql/regress/privs1/EXPECTED133
index 6edbc65..c20d1a0 100644
Binary files a/core/sql/regress/privs1/EXPECTED133 and b/core/sql/regress/privs1/EXPECTED133 differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/privs1/TEST133
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/TEST133 b/core/sql/regress/privs1/TEST133
index d630bda..0b1899f 100755
--- a/core/sql/regress/privs1/TEST133
+++ b/core/sql/regress/privs1/TEST133
@@ -35,9 +35,9 @@
 --   authorized - runs authorization tests
 -- ============================================================================
 
+cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
 obey TEST133(clean_up);
 log LOG133 clear;
-obey TEST133(create_db);
 obey TEST133(tests);
 sh sqlci -i "TEST133(authorized)" -u sql_user4;
 log;
@@ -46,11 +46,14 @@ initialize authorization;
 exit;
 
 ?section clean_up
-set schema "_PRIVMGR_MD_";
 drop sequence t133sch.team_number_sequence;
 -- drop database
 drop schema t133sch cascade;
 
+set parserflags 131072;
+drop schema "_HV_HIVE_" cascade;
+reset parserflags 131072;
+
 ?section create_db
 create schema t133sch;
 set schema t133sch;
@@ -64,13 +67,6 @@ create table teams
 
 alter table teams add constraint valid_team_no check (team_number > 0);
 
-insert into teams values
-   (1, 'White Socks', 'Sam','4082282222'),
-   (2, 'Giants', 'Joe', '5102839483'),
-   (3, 'Cardinals', 'Stella', '9513849384'),
-   (4, 'Indians', 'Matt', '5128383748'),
-   (5, 'Tigers', 'Ronit', '6198273827');
-
 create table team_statistics
   (team_number int not null primary key,
    num_players int not null)
@@ -83,7 +79,6 @@ create table games
      game_time timestamp not null,
      game_location varchar(50) not null)
   ;
---create index home_games on games (home_team_number);
 
 alter table games add constraint valid_game_number check (game_number > 0);
 
@@ -93,18 +88,6 @@ create table standings
      loses int default 0,
      last_updated timestamp default current_timestamp)
 ;
-insert into standings (team_number)
-  select team_number from teams;
-
-insert into games values
-   (1, 2, 1, timestamp '2009-04-23 19:30:00', 'California'),
-   (1, 3, 2, timestamp '2009-04-24 19:30:00', 'California'),
-   (1, 4, 3, timestamp '2009-04-25 10:00:00', 'Oklahoma'),
-   (2, 3, 4, timestamp '2009-04-25 13:30:00', 'Michigan'),
-   (1, 5, 5, timestamp '2009-04-25 15:00:00', 'Oklahoma'),
-   (2, 5, 6, timestamp '2009-04-27 17:00:00', 'New York'),
-   (3, 4, 7, timestamp '2009-04-28 17:00:00', 'Florida'),
-   (4, 2, 8, current_timestamp, 'Missouri');
 
 create view home_teams_games as
   select t.team_number, g.game_number, g.game_time
@@ -122,20 +105,6 @@ create table players
    primary key (player_number, player_team_number))
   no partition;
 
-insert into players values
-   (1, 'Tom', 1, '4083948394', null),
-   (2, 'Bob', 1, '4089483948', null),
-   (3, 'Toby',1, '4082938493', 'pitcher'),
-   (3, 'Toby',2, '4082938493', null),
-   (4, 'Julie', 2, '5108394839', 'catcher'),
-   (5, 'Joanne', 2, '5103849384', null),
-   (6, 'Pete', 2, '5102839483', null),
-   (6, 'Pete', 3, '5102839483', 'third base'),
-   (7, 'Jared',4, '9518293849', 'short stop'),
-   (8, 'Zachary', 4, '9518293840', null),
-   (9, 'Lynne', 5, '9518293892', 'pitcher'),
-   (10, 'Omar', 5, '5128394893', null);
-
 alter table players add constraint valid_player_number check(player_number > 0);
 
 create view players_on_team as
@@ -143,7 +112,6 @@ create view players_on_team as
   from teams t, players p
   where p.player_team_number = t.team_number
   order by t.team_name;
-select * from players_on_team;
 
 create view games_by_player as
   select player_name, game_time
@@ -155,12 +123,6 @@ create view games_by_player as
 alter table players add constraint players_teams
    foreign key (player_team_number) references teams (team_number);
 
-insert into team_statistics
-  select team_number, count (player_number)
-   from teams t, players p
-   where t.team_number = p.player_team_number
-   group by team_number;
-
 create volatile table home_games as
   select home_team_number, visitor_team_number, game_number,  game_location
   from games
@@ -171,22 +133,34 @@ create volatile table home_games as
 
 create sequence team_number_sequence;
 
+-- create function to display bitmaps as a bitmap rather than longs
+sh rm -f ./etest141.dll;
+sh sh $$scriptsdir$$/tools/dll-compile.ksh etest141.cpp
+  2>&1 | tee LOG133-SECONDARY;
+set pattern $$DLL$$ etest141.dll;
+set pattern $$QUOTE$$ '''';
+
+create library t133_l1 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$ ;
+create function translateBitmap(bitmap largeint) returns (bitmap_string char (20))
+language c parameter style sql external name 'translateBitmap'
+library t133_l1
+deterministic no sql final call allow any parallelism state area size 1024 ;
+
 ?section set_up
 set schema "_PRIVMGR_MD_";
 prepare get_owner_privs from
 select distinct
    substring (object_name,1,40) as object_name,
    object_type as type,
+   substring(authname(grantor_id),1,10) as grantor,
    substring(authname(grantee_id),1,10) as grantee,
-   privileges_bitmap,
-   grantable_bitmap
-from object_privileges 
-where grantor_id = -2
-    and object_uid in 
+   t133sch.translateBitmap(privileges_bitmap) as granted_privs,
+   t133sch.translateBitmap(grantable_bitmap) as grantable_privs
+from "_PRIVMGR_MD_".object_privileges
+where object_uid in
      (select object_uid
       from "_MD_".objects
-      where object_type in ('VI','BT','LB','UR')
-        and schema_name in ('_PRIVMGR_MD_', 'T133SCH'))
+      where schema_name in ('_PRIVMGR_MD_', 'T133SCH', '_HV_HIVE_'))
   order by 1, 2, 3, 4, 5
 ;
 
@@ -195,26 +169,40 @@ where grantor_id = -2
 -- this set of tests run basic initialize authorization tests
 -- =================================================================
 
+obey TEST133(create_db);
 set schema "_PRIVMGR_MD_";
 get tables;
 
+-- verify can't create an object in "_PRIVMGR_MD_" schema
 create table t133_t1 (c1 int not null primary key, c2 int);
-create view t133_v1 as select * from t133_t1;
-create index t133_i1 on t133_t1(c2);
-create table t133_t2 like t133_t1;
 
 obey TEST133(set_up);
-get tables;
 execute get_owner_privs;
 
 initialize authorization, drop;
 get tables;
+
+-- owner s/b db__root
+create external table customer for hive.hive.customer;
+create external table item for hive.hive.item;
+create external table promotion for hive.hive.promotion;
+select schema_owner, object_owner, substring (object_name,1,20) as object_name 
+from "_MD_".objects where schema_name = '_HV_HIVE_';
+
 initialize authorization;
 get tables;
 select count (*) from components;
 select count (*) from component_operations;
 select count (*) from component_privileges;
+
+-- external Hive schema now owned by DB__HIVEROLE
+select schema_owner, object_owner, substring (object_name,1,20) as object_name 
+from "_MD_".objects where schema_name = '_HV_HIVE_';
+
+-- External hive table show owner as DB__HIVEROLE
 execute get_owner_privs;
+
+-- drop role_usage and make sure initialize authorization recreates
 set parserflags 131072;
 drop table role_usage;
 get tables;
@@ -223,6 +211,7 @@ initialize authorization;
 get tables;
 execute get_owner_privs;
 
+-- drop components and make sure initialize authorization recreates
 drop table components;
 get tables;
 initialize authorization, drop;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/seabase/EXPECTED010
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED010 b/core/sql/regress/seabase/EXPECTED010
index c6f739f..052b722 100644
--- a/core/sql/regress/seabase/EXPECTED010
+++ b/core/sql/regress/seabase/EXPECTED010
@@ -10383,7 +10383,7 @@ _SALT_      A            B           C            D
 >>drop table if exists minotaur.events_load75;
 
 --- SQL operation complete.
->>create schema minotaur;
+>>create schema if not exists minotaur;
 
 --- SQL operation complete.
 >>CREATE TABLE if not exists TRAFODION.MINOTAUR.EVENTS_LOAD75

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/seabase/EXPECTED027
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED027 b/core/sql/regress/seabase/EXPECTED027
index 2465664..c4a7920 100644
--- a/core/sql/regress/seabase/EXPECTED027
+++ b/core/sql/regress/seabase/EXPECTED027
@@ -12,7 +12,7 @@
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:58:49 2016
+-- Definition current  Mon Mar 21 01:06:26 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -40,7 +40,7 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:58:59 2016
+-- Definition current  Mon Mar 21 01:06:35 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -69,7 +69,7 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:05 2016
+-- Definition current  Mon Mar 21 01:06:41 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -101,7 +101,7 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:14 2016
+-- Definition current  Mon Mar 21 01:06:46 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -131,7 +131,7 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:16 2016
+-- Definition current  Mon Mar 21 01:06:54 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -196,7 +196,7 @@ A            B            C
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:22 2016
+-- Definition current  Mon Mar 21 01:06:59 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -234,7 +234,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:26 2016
+-- Definition current  Mon Mar 21 01:07:06 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -274,7 +274,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:31 2016
+-- Definition current  Mon Mar 21 01:07:11 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -312,7 +312,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Sat Mar 12 02:59:32 2016
+-- Definition current  Mon Mar 21 01:07:12 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -352,7 +352,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Sat Mar 12 02:59:40 2016
+-- Definition current  Mon Mar 21 01:07:15 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -397,7 +397,7 @@ A            B            C            E            D
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Sat Mar 12 02:59:43 2016
+-- Definition current  Mon Mar 21 01:07:19 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -437,7 +437,7 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Sat Mar 12 02:59:53 2016
+-- Definition current  Mon Mar 21 01:07:28 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -472,7 +472,7 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Sat Mar 12 02:59:57 2016
+-- Definition current  Mon Mar 21 01:07:32 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -504,7 +504,7 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t03;
 
 -- Definition of Trafodion volatile table T027T03
--- Definition current  Sat Mar 12 03:00:03 2016
+-- Definition current  Mon Mar 21 01:07:38 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -536,7 +536,7 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t03;
 
 -- Definition of Trafodion volatile table T027T03
--- Definition current  Sat Mar 12 03:00:24 2016
+-- Definition current  Mon Mar 21 01:07:58 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -585,7 +585,7 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t02;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T02
--- Definition current  Sat Mar 12 03:00:45 2016
+-- Definition current  Mon Mar 21 01:08:18 2016
 
   (
     "cf".SYSKEY                      LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -637,7 +637,7 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t03;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T03
--- Definition current  Sat Mar 12 03:01:07 2016
+-- Definition current  Mon Mar 21 01:08:40 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -674,7 +674,7 @@ A            B            C            D
 >>invoke t027t02;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T02
--- Definition current  Sat Mar 12 03:01:20 2016
+-- Definition current  Mon Mar 21 01:08:53 2016
 
   (
     OBJECT_UID                       LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -787,7 +787,7 @@ create index t027t01i2 on t027t01("cf2".b);
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:01:46 2016
+-- Definition current  Mon Mar 21 01:09:19 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -819,7 +819,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:01:54 2016
+-- Definition current  Mon Mar 21 01:09:28 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -840,7 +840,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:02:19 2016
+-- Definition current  Mon Mar 21 01:09:51 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -861,7 +861,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:02:42 2016
+-- Definition current  Mon Mar 21 01:10:14 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -883,7 +883,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:03:05 2016
+-- Definition current  Mon Mar 21 01:10:35 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -904,7 +904,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:03:25 2016
+-- Definition current  Mon Mar 21 01:10:55 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -925,7 +925,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:03:42 2016
+-- Definition current  Mon Mar 21 01:11:16 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -946,7 +946,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:04:05 2016
+-- Definition current  Mon Mar 21 01:11:35 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -967,7 +967,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:04:25 2016
+-- Definition current  Mon Mar 21 01:12:03 2016
 
   (
     A                                INT DEFAULT NULL /*altered_col*/
@@ -988,7 +988,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:04:44 2016
+-- Definition current  Mon Mar 21 01:12:26 2016
 
   (
     A                                SMALLINT DEFAULT 0 NOT NULL NOT DROPPABLE
@@ -1025,7 +1025,7 @@ A       B   C       Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:05:07 2016
+-- Definition current  Mon Mar 21 01:12:50 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1057,7 +1057,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:05:32 2016
+-- Definition current  Mon Mar 21 01:13:16 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -1086,7 +1086,7 @@ A                     B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:05:57 2016
+-- Definition current  Mon Mar 21 01:13:44 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -1113,7 +1113,7 @@ A                     C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:06:00 2016
+-- Definition current  Mon Mar 21 01:13:51 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -1142,7 +1142,7 @@ A                     C                 Z            B
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:06:25 2016
+-- Definition current  Mon Mar 21 01:14:16 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -1177,7 +1177,7 @@ SCH027.T027V1
 >>invoke t027v1;
 
 -- Definition of Trafodion view TRAFODION.SCH027.T027V1
--- Definition current  Sat Mar 12 03:06:33 2016
+-- Definition current  Mon Mar 21 01:14:24 2016
 
   (
     A                                LARGEINT DEFAULT NULL
@@ -1193,7 +1193,7 @@ SCH027.T027V1
 >>invoke t027v1;
 
 -- Definition of Trafodion view TRAFODION.SCH027.T027V1
--- Definition current  Sat Mar 12 03:07:06 2016
+-- Definition current  Mon Mar 21 01:14:58 2016
 
   (
     A                                SMALLINT DEFAULT NULL
@@ -1266,7 +1266,7 @@ SCH027.T027V1
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:09:01 2016
+-- Definition current  Mon Mar 21 01:17:02 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1295,7 +1295,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:09:12 2016
+-- Definition current  Mon Mar 21 01:17:13 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1324,7 +1324,7 @@ A            BB  C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Sat Mar 12 03:09:24 2016
+-- Definition current  Mon Mar 21 01:17:28 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1534,10 +1534,10 @@ SCH027.T027V122
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Thu Mar 17 14:48:27 2016
+-- Definition current  Mon Mar 21 01:21:43 2016
 
   (
-    SYSKEY                           INT NO DEFAULT NOT NULL NOT DROPPABLE 
+    SYSKEY                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "_SALT_"                         INT DEFAULT NULL /*altered_col*/
   , "_DIVISION_1"                    INT DEFAULT NULL /*added_col*/
   )
@@ -1545,6 +1545,83 @@ SCH027.T027V122
 
 --- SQL operation complete.
 >>
+>>-- not null and default clause can appear in any order
+>>drop table if exists t027t1 cascade;
+
+--- SQL operation complete.
+>>create table t027t1 (a int, b int not null, c int default 10,
++>   d int default 10 not null, e int not null default 10, 
++>   f int not null default 10 check (f > 0),
++>   g int not null not droppable default 10);
+
+--- SQL operation complete.
+>>invoke t027t1;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T1
+-- Definition current  Mon Mar 21 01:21:53 2016
+
+  (
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
+  , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                INT DEFAULT 10
+  , D                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , E                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , F                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , G                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
+>>insert into t027t1 (b) values (10);
+
+--- 1 row(s) inserted.
+>>select * from t027t1;
+
+A            B            C            D            E            F            G
+-----------  -----------  -----------  -----------  -----------  -----------  -----------
+
+          ?           10           10           10           10           10           10
+
+--- 1 row(s) selected.
+>>alter table t027t1 add column h int not null default 10;
+
+--- SQL operation complete.
+>>invoke t027t1;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T1
+-- Definition current  Mon Mar 21 01:22:00 2016
+
+  (
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
+  , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                INT DEFAULT 10
+  , D                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , E                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , F                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , G                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+  , H                                INT DEFAULT 10 NOT NULL NOT DROPPABLE
+      /*added_col*/
+  )
+
+--- SQL operation complete.
+>>select * from t027t1;
+
+A            B            C            D            E            F            G            H
+-----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------
+
+          ?           10           10           10           10           10           10           10
+
+--- 1 row(s) selected.
+>>
+>>--should give error
+>>create table t027t2 (a int default 10 not null default 20);
+
+*** ERROR[3052] Duplicate DEFAULT clauses were specified in column definition A.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
 >>-- cleanup
 >>?section clean_up
 >>drop table if exists t027t7 cascade;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/seabase/TEST010
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST010 b/core/sql/regress/seabase/TEST010
index 4efc187..7848bd6 100644
--- a/core/sql/regress/seabase/TEST010
+++ b/core/sql/regress/seabase/TEST010
@@ -281,7 +281,7 @@ select "_SALT_", * from table(table t010t3, partition number from 1 to 3);
 
 ?section otherMdam
 drop table if exists minotaur.events_load75;
-create schema minotaur;
+create schema if not exists minotaur;
 CREATE TABLE if not exists TRAFODION.MINOTAUR.EVENTS_LOAD75
   (
     SRCIP                            CHAR(45) CHARACTER SET ISO88591 COLLATE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/regress/seabase/TEST027
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST027 b/core/sql/regress/seabase/TEST027
index b3d2710..41d2b79 100644
--- a/core/sql/regress/seabase/TEST027
+++ b/core/sql/regress/seabase/TEST027
@@ -308,6 +308,22 @@ alter table t027t7 add column "_DIVISION_1" int;
 alter table t027t7 alter column b rename to "_SALT_";
 invoke t027t7;
 
+-- not null and default clause can appear in any order
+drop table if exists t027t1 cascade;
+create table t027t1 (a int, b int not null, c int default 10,
+   d int default 10 not null, e int not null default 10, 
+   f int not null default 10 check (f > 0),
+   g int not null not droppable default 10);
+invoke t027t1;
+insert into t027t1 (b) values (10);
+select * from t027t1;
+alter table t027t1 add column h int not null default 10;
+invoke t027t1;
+select * from t027t1;
+
+--should give error
+create table t027t2 (a int default 10 not null default 20);
+
 -- cleanup
 ?section clean_up
 drop table if exists t027t7 cascade;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index 6edcb51..c45ac0a 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -1176,6 +1176,7 @@ class CmpSeabaseDDL
   short createLibmgrProcs(ExeCliInterface * cliInterface);
   short grantLibmgrPrivs(ExeCliInterface *cliInterface);
 
+  short adjustHiveExternalSchemas(ExeCliInterface *cliInterface);
 
   void createSeabaseSequence(StmtDDLCreateSequence  * createSequenceNode,
 			     NAString &currCatName, NAString &currSchName);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index e89f3e3..cb7325c 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -5727,7 +5727,7 @@ short CmpSeabaseDDL::buildColInfoArray(
       ElemDDLParamDef *paramNode = (*paramArray)[index];
       ElemDDLColDef colNode(NULL, &paramNode->getParamName(), 
                             paramNode->getParamDataType(),
-                            NULL, NULL, STMTHEAP);
+                            NULL, STMTHEAP);
 
       NAString colFamily;
       NAString colName;
@@ -7726,6 +7726,15 @@ short CmpSeabaseDDL::initSeabaseAuthorization(
      for (short i = 0; i < GetCliGlobals()->currContext()->getNumArkcmps(); i++)
        GetCliGlobals()->currContext()->getArkcmp(i)->endConnection();
 
+     // Adjust hive external table ownership - if someone creates external 
+     // tables before initializing authorization, the external schemas are 
+     // owned by DB__ROOT -> change to DB__HIVEROLE.  
+     // Also if you have initialized authorization and created external tables 
+     // before the fix for JIRA 1895, rerunning initialize authorization will 
+     // fix the metadata inconsistencies
+     if (adjustHiveExternalSchemas(cliInterface) != 0)
+       return -1;
+
      // If someone initializes trafodion with library management but does not 
      // initialize authorization, then the role DB__LIBMGRROLE has not been 
      // granted to LIBMGR procedures.  Do this now

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 158ab70..88832f2 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -1184,6 +1184,99 @@ short CmpSeabaseDDL::createHistogramTables(
 
 // *****************************************************************************
 // *                                                                           *
+// * Function: adjustHiveExternalSchemas                                       *
+// *                                                                           *
+// *    Changes the ownership and privilege grants to DB__HIVEROLE             *
+// *                                                                           *
+// *****************************************************************************
+// *                                                                           *
+// *  Parameters:                                                              *
+// *                                                                           *
+// *  <cliInterface>                  ExeCliInterface *               In       *
+// *    is a reference to an Executor CLI interface handle.                    *
+// *****************************************************************************
+// *                                                                           *
+// * Returns: Int32                                                            *
+// *                                                                           *
+// *            0: Adjustment was successful                                   *
+// *           -1: Adjustment failed                                           *
+// *                                                                           *
+// *****************************************************************************
+short CmpSeabaseDDL::adjustHiveExternalSchemas(ExeCliInterface *cliInterface)
+{
+  char buf[sizeof(SEABASE_MD_SCHEMA) + 
+           sizeof(SEABASE_OBJECTS) + 
+           strlen(getSystemCatalog()) + 300];
+
+  // get all the objects in special hive schemas
+  sprintf(buf, "SELECT catalog_name, schema_name, object_name, object_uid, object_type, object_owner "
+               " from %s.\"%s\".%s WHERE schema_name like '_HV_%c_'",
+               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS, '%');
+
+   Queue * objectsQueue = NULL;
+   Int32 cliRC = cliInterface->fetchAllRows(objectsQueue, buf, 0, FALSE, FALSE, TRUE);
+   if (cliRC < 0)
+   {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return -1;
+   }
+
+   // adjust owner and privilege information for external hive objects
+   objectsQueue->position();
+   for (size_t i = 0; i < objectsQueue->numEntries(); i++)
+   {
+     OutputInfo * vi = (OutputInfo*)objectsQueue->getNext();
+     NAString catName = vi->get(0);
+     NAString schName = vi->get(1);
+     NAString objName = vi->get(2);
+     Int64 objUID     = *(Int64*)vi->get(3);
+     NAString objectTypeLit = vi->get(4);
+     Int32 objOwner   = *(Int32*)vi->get(5);
+     ComObjectType objType = PrivMgr::ObjectLitToEnum(objectTypeLit.data());
+
+     // If object owner is already the HIVE_ROLE_ID, then we are done.
+     if (objOwner == HIVE_ROLE_ID)
+       continue;
+     else
+     {
+       // only need to adjust privileges on securable items
+       if (PrivMgr::isSecurableObject(objType))
+       {
+         ComObjectName tblName(catName, schName, objName, COM_TABLE_NAME, 
+                               ComAnsiNamePart::INTERNAL_FORMAT, STMTHEAP);
+
+         NAString extTblName = tblName.getExternalName(TRUE);
+
+         // remove existing privs on object
+         if (!deletePrivMgrInfo(extTblName, objUID, objType))
+           return -1;
+
+         // add owner privs
+         if (!insertPrivMgrInfo(objUID, extTblName, objType, 
+                                HIVE_ROLE_ID, HIVE_ROLE_ID, ComUser::getCurrentUser()))
+           return -1;
+       }
+
+       // update schema_owner and objectOwner for object
+       sprintf(buf,"UPDATE %s.\"%s\".%s SET object_owner = %d "
+                   ", schema_owner = %d WHERE object_uid = %ld ",
+                   getSystemCatalog(),SEABASE_MD_SCHEMA,SEABASE_OBJECTS, 
+                   HIVE_ROLE_ID, HIVE_ROLE_ID, objUID);
+       cliRC = cliInterface->executeImmediate(buf);
+       if (cliRC < 0)
+       {
+         cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+         return -1;
+       }
+     }
+  }
+
+  return 0;
+}
+//********************* End of adjustHiveExternalTables ************************
+
+// *****************************************************************************
+// *                                                                           *
 // * Function: dropOneTable                                                    *
 // *                                                                           *
 // *    Drops a table and all its dependent objects.                           *
@@ -1337,17 +1430,19 @@ NAString privMgrMDLoc;
 PrivMgrCommands privInterface(std::string(privMgrMDLoc.data()),CmpCommon::diags());
    
 std::vector<UIDAndOwner> objectRows;
-std::string whereClause(" WHERE catalogName = ");
+std::string whereClause(" WHERE catalog_name = '");
    
    whereClause += catalogName;
-   whereClause += " AND schema_name = ";
+   whereClause += "' AND schema_name = '";
    whereClause += schemaName;
+   whereClause += "'";
    
 std::string orderByClause(" ORDER BY OBJECT_OWNER");
 std::string metadataLocation(systemCatalogName);  
       
-   metadataLocation += ".";
+   metadataLocation += ".\"";
    metadataLocation += SEABASE_MD_SCHEMA;
+   metadataLocation += "\"";
       
 PrivMgrObjects objects(metadataLocation,CmpCommon::diags());
    

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index d6325e7..5b9174d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -485,7 +485,7 @@ short CmpSeabaseDDL::createSeabaseTableExternal(
 
   if (isAuthorizationEnabled())
     {
-      if (srcTableName.isExternalHive())
+      if (tgtTableName.isExternalHive())
         {
           tableInfo->objOwnerID = HIVE_ROLE_ID;
           tableInfo->schemaOwnerID = HIVE_ROLE_ID;
@@ -1548,7 +1548,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
 
   NAString syskeyColName("SYSKEY");
   SQLLargeInt * syskeyType = new(STMTHEAP) SQLLargeInt(TRUE, FALSE, STMTHEAP);
-  ElemDDLColDef syskeyColDef(NULL, &syskeyColName, syskeyType, NULL, NULL,
+  ElemDDLColDef syskeyColDef(NULL, &syskeyColName, syskeyType, NULL,
                              STMTHEAP);
   ElemDDLColRef edcr("SYSKEY", COM_ASCENDING_ORDER);
   CollIndex numSysCols = 0;
@@ -1688,7 +1688,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
              ElemDDLColDefault::COL_COMPUTED_DEFAULT);
       saltDef->setComputedDefaultExpr(saltExprText);
       ElemDDLColDef * saltColDef =
-        new(STMTHEAP) ElemDDLColDef(NULL, &saltColName, saltType, saltDef, NULL,
+        new(STMTHEAP) ElemDDLColDef(NULL, &saltColName, saltType, saltDef,
                                     STMTHEAP);
 
       ElemDDLColRef * edcrs = 
@@ -1866,7 +1866,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
               boundDivExpr->unparse(divExprText, PARSER_PHASE, COMPUTED_COLUMN_FORMAT);
               divColDefault->setComputedDefaultExpr(divExprText);
               ElemDDLColDef * divColDef =
-                new(STMTHEAP) ElemDDLColDef(NULL, &divColName, divColType, divColDefault, NULL,
+                new(STMTHEAP) ElemDDLColDef(NULL, &divColName, divColType, divColDefault,
                                             STMTHEAP);
 
               ElemDDLColRef * edcrs = 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
index 34ea07c..958b96d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
@@ -234,7 +234,6 @@ short CmpSeabaseDDL::buildViewColInfo(StmtDDLCreateView * createViewParseNode,
       colDefArray->insert(new (STMTHEAP) ElemDDLColDef
 			  ( NULL, &viewColDefArray[i]->getColumnName()
 			    , (NAType *)&valIdList[i].getType()
-			    , NULL    // default value (n/a for view def)
 			    , NULL    // col attr list (not needed)
 
 			    , STMTHEAP));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index c323865..84ee7d0 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -5671,7 +5671,7 @@ Lng32 HSGlobalsClass::CollectStatistics()
                                           /* sampled UEC -> est UEC          */
                                           /* sampled ROWCOUNT -> est ROWCOUNT*/
                                           /*=================================*/
-        if (sampleRowCount > 0 && actualRowCount > sampleRowCount)
+        if (samplingUsed && sampleRowCount > 0 && actualRowCount > sampleRowCount)
           {
             LM->StartTimer("fix sample row counts");
             retcode = FixSamplingCounts(group);
@@ -5681,6 +5681,24 @@ Lng32 HSGlobalsClass::CollectStatistics()
           }
         group = group->next;
       }
+
+    // If we used cqd USTAT_ESTIMATE_HBASE_ROW_COUNT 'ON', then actualRowCount
+    // is the estimate of the row count given by HBase. If we also did not do
+    // sampling, we know the true row count; this is in sampleRowCount. We
+    // take the opportunity here to correct the actualRowCount in this case.
+    if (!samplingUsed && isHbaseTable &&
+        CmpCommon::getDefault(USTAT_ESTIMATE_HBASE_ROW_COUNT) == DF_ON)
+      {
+        if (LM->LogNeeded())
+          {
+            sprintf(LM->msg, "Correcting actualRowCount (was " PF64 ") from sampleRowCount (" PF64 ")",
+                             actualRowCount,sampleRowCount);
+            LM->Log(LM->msg);
+          }
+        actualRowCount = sampleRowCount;
+      }
+         
+
     if (singleGroup && LM->LogNeeded())
       LM->StopTimer();
 
@@ -5712,7 +5730,7 @@ Lng32 HSGlobalsClass::CollectStatistics()
 
         LM->StartTimer("MC: fix MC stats");
 
-        if (sampleRowCount > 0 && actualRowCount > sampleRowCount)
+        if (samplingUsed && sampleRowCount > 0 && actualRowCount > sampleRowCount)
           {
             group = multiGroup;
             while (group != NULL)
@@ -11414,7 +11432,7 @@ Lng32 HSGlobalsClass::createStatsForColumn(HSColGroupStruct *group, Int64 rowsAl
     }
 
     // Upscale rowcounts and estimate UECs when sampling.
-    if (sampleRowCount > 0 && actualRowCount > sampleRowCount)
+    if (samplingUsed && sampleRowCount > 0 && actualRowCount > sampleRowCount)
     {
       retcode = FixSamplingCounts(group);
       HSHandleError(retcode);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/SQuirrel.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/SQuirrel.adoc b/docs/client_install/src/asciidoc/_chapters/SQuirrel.adoc
index 0d11df5..3c3315f 100644
--- a/docs/client_install/src/asciidoc/_chapters/SQuirrel.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/SQuirrel.adoc
@@ -27,8 +27,8 @@ These configuration instructions apply to Trafodion Release 1.3.*_n_* and subseq
 
 Make sure that you have this software installed on your workstation:
 
-* Java Runtime Environment (JRE) 1.7 or higher. See <<jdbct4_JRE, Install Java Runtime Environment (JRE)>>.
-* Trafodion JDBC Type-4 Driver. See <<jdbct4_install, JDBC Type-4 Installation>>.
+* Java Runtime Environment (JRE) 1.7 or higher. See <<jdbct4-java-environment, Java Environment>> in the <<jdbct4, Install JDBC Type-4 Driver>> chapter above.
+* Trafodion JDBC Type-4 Driver. See <<jdbct4,Install JDBC Type-4 Driver>> above.
 * SQuirreL SQL Client 3.5.0. See the http://squirrel-sql.sourceforge.net/[_SQuirreL SQL Client website_].
 
 <<<
@@ -44,7 +44,7 @@ Use the *Add Driver* function and register the Trafodion JDBC Type-4 Driver:
 image:{images}/Add_Driver_SQuirreL.jpg[alt="SQuirreL Add Driver Dialog Box"]
 +
 * Name: `Trafodion`
-* Example URL: `jdbc:t4jdbc://_host-name or ip-address_:37800/:`
+* Example URL: `jdbc:t4jdbc://_host-name or ip-address_:37800/:` (Default port number: *23400*)
 
 <<<
 === Connect to Trafodion
@@ -55,6 +55,8 @@ image:{images}/Add_Alias_SQuirreL.jpg[alt="SQuirreL Add Alias Dialog Box"]
 
 1. Edit the connection *URL* to match your Trafodion system's host name and port number:
 +
+*Example*
++
 ```
 jdbc:t4jdbc://<host-name or ip-address>:37800/:
 ```

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/about.adoc b/docs/client_install/src/asciidoc/_chapters/about.adoc
index e29d926..1f42ab3 100644
--- a/docs/client_install/src/asciidoc/_chapters/about.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/about.adoc
@@ -30,7 +30,7 @@ This manual describes how to install and configure client applications that enab
 This manual is intended for users who want to connect to and use a Trafodion database.
 
 == New and Changed Information
-This manual shows updated versions for Trafodion Release 1.3.0. It also provides instructions on how to download and install <<odb,Trafodion odb>>, a
+This manual shows updated versions for Trafodion Release {project-version}. It also provides instructions on how to download and install <<odb,Trafodion odb>>, a
 new multi-threaded, ODBC-based command-line tool for parallel data loading and extracting.
 
 == Notation Conventions
@@ -133,6 +133,7 @@ For example:
 "{" module-name [, module-name] ... "}"
 ```
 
+<<<
 * Item Spacing
 +
 Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma.
@@ -147,7 +148,6 @@ If there is no space between two items, spaces are not permitted. In this exampl
 myfile.sh
 ```
 
-<<<
 * Line Spacing
 +
 If the syntax of a command is too long to fit on a single line, each continuation line is indented three spaces and is separated from the preceding line by a blank line.
@@ -159,13 +159,6 @@ match-value [NOT] LIKE _pattern
    [ESCAPE esc-char-expression] 
 ```
 
-== Publishing History
-[cols="2*",options="header"]
-|===
-| Product Version | Publication Date
-| Trafodion Release 1.3.0 | To be announced.
-|===
-
 == Comments Encouraged
 The Trafodion community encourages your comments concerning this document. We are committed to providing documentation that meets your
 needs. Send any errors found, suggestions for improvement, or compliments to:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/dbviz.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/dbviz.adoc b/docs/client_install/src/asciidoc/_chapters/dbviz.adoc
index 127af27..b355cfb 100644
--- a/docs/client_install/src/asciidoc/_chapters/dbviz.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/dbviz.adoc
@@ -21,19 +21,16 @@
 ////
 
 = Configure DbVisualizer
-These configuration instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of Trafodion until otherwise indicated.
 
 == Prerequisite Software
 
 Make sure that you have this software installed on your workstation:
 
-* Java Runtime Environment (JRE) 1.7 or higher.
-+
-See <<jdbct4_JRE, Install Java Runtime Environment (JRE)>>.
+* Java Runtime Environment (JRE) 1.7 or higher. See <<jdbct4-java-environment, Java Environment>> in the <<jdbct4, Install JDBC Type-4 Driver>> chapter above.
 +
 In addition, see DbVisualizer’s FAQ “How to” page:
 http://confluence.dbvis.com/pages/viewpage.action?pageId=3146120[_How do I change the Java version that DbVisualizer uses?_]
-* Trafodion JDBC Type-4 Driver. See <<jdbct4_install, JDBC Type-4 Installation>>.
+* Trafodion JDBC Type-4 Driver. See <<jdbct4,Install JDBC Type-4 Driver>> above.
 * DbVisualizer 9.x.x. See the http://www.dbvis.com/[_DbVisualizer website_].
 
 == Configuration Instructions
@@ -51,9 +48,9 @@ dbvis.generic.-ConnectionValidationSelect=disabled
 ==== DbVisualizer 9.2 (or a later version)
 Set the *Physical Connection* property to keep your connections alive. Follow these steps:
 
-1.  For the database connection, select the *Properties* tab.
+1.  Double-click the database connection, select the *Properties* tab.
 2.  In the left navigation tree, expand the *Generic* connection properties, and select *Physical Connection*.
-3.  Under *Validation SQL*, enter `values(current_timestamp)`.
+3.  Under *Validation SQL*, enter `values(current_timestamp)` and click *Apply*.
 +
 <<<
 image:{images}/Physical_Connection.jpg[width=600,height=600,alt="DbVisualizer Physical Connection"]
@@ -69,14 +66,16 @@ image:{images}/DbVisualizer_Driver_Manager.jpg[image]
 * Use the JDBC URL format:
 +
 ```
-jdbc:t4jdbc://<host-name or ip-address>:37800/:
+jdbc:t4jdbc://<host-name or ip-address>:23400/:
 ```
++
+*NOTE*: This example uses a modified port number (*37800*) rather than the default port number (*23400*).
 
 <<<
 === Connect to Trafodion
 
 Create a new connection by selecting the Trafodion JDBC Type-4 Driver and filling in the connection parameters. Edit the database URL to match
-your Trafodion system’s host name and port number: `jdbc:t4jdbc://<host-name or ip-address>:37800/:`
+your Trafodion system’s host name and port number; for example: `jdbc:t4jdbc://<host-name or ip-address>:37800/:` (default is: *23400*).
 
 image:{images}/Database_Connection_in_DbVisualizer.jpg[image]
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/introduction.adoc b/docs/client_install/src/asciidoc/_chapters/introduction.adoc
index c347335..0d88d72 100644
--- a/docs/client_install/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/introduction.adoc
@@ -20,30 +20,128 @@
  */
 ////
 
-= Trafodion Client Products
+[[introduction]]
+= Introduction
 This manual describes how to install and configure the following client applications, which enable you to connect to and use a Trafodion
 database.
 
 == Client Summary
-The following table lists the clients supported by Trafodion.
-[cols="30%h,70%",options="header"]
+
+=== JDBC-Based Clients
+
+The following table lists JDBC-based clients supported by Trafodion.
+[cols="30%,70%",options="header"]
 |===
 | Client Name | Description
-| Trafodion ODBC Driver for Windows | A driver that enables applications, which were developed for the Microsoft Open Database Connectivity (ODBC) application programming
-interface (API) and which run on a Windows workstation, to connect to a Trafodion database.
-| Trafodion ODBC Driver for Linux | A driver that enables applications, which were developed for the Microsoft ODBC API and run on a Linux workstation, to connect to a
+| *Trafodion JDBC Type 4 Driver* | A driver that enables Java applications that run on a client workstation to connect to a Trafodion database. +
+ +
+*NOTE:* The Trafodion Command Interface (TrafCI), DbVisualizer, and SQuirreL SQL Client require this driver to be installed on the client
+workstation.
+| *Trafodion Command Interface (TrafCI)* | A command-line interface that allows you to connect to a Trafodion database and run SQL statements and other commands interactively or from
+script files. For more information, see the http://trafodion.incubator.apache.org/docs/command_interface/index.html[Trafodion Command Interface Guide].
+| *DbVisualizer* | A third-party database tool that allows you to connect to a Trafodion database. For more information, see the http://www.dbvis.com/[DbVisualizer website].
+| *SQuirreL SQL Client* | A third-party database tool that allows you to connect to a Trafodion database. For more information, see the 
+http://squirrel-sql.sourceforge.net/[SQuirreL SQL Client website].
+|===
+
+=== ODBC-Based Clients
+
+The following table lists ODBC-based clients supported by Trafodion.
+[cols="30%,70%",options="header"]
+|===
+| Client Name | Description
+| *Trafodion ODBC Driver for Linux* | A driver that enables applications, which were developed for the Microsoft ODBC API and run on a Linux workstation, to connect to a
 Trafodion database.
-| Trafodion JDBC Type 4 Driver | A driver that enables Java applications that run on a client workstation to connect to a Trafodion database.
+| *Trafodion ODBC Driver for Windows* | *[Not included in this release]*^1^ +
+ +
+A driver that enables applications, which were developed for the Microsoft Open Database Connectivity (ODBC) application programming
+interface (API) and which run on a Windows workstation, to connect to a Trafodion database.
+| *Trafodion odb tool* | A multi-threaded, ODBC-based command-line tool for parallel data loading and extracting. For more information, see the
+http://trafodion.incubator.apache.org/docs/odb_user/index.html[Trafodion odb User Guide].
+|===
 
-NOTE: The Trafodion Command Interface (TrafCI), DbVisualizer, and SQuirreL SQL Client require this driver to be installed on the client
-workstation.
-| Trafodion Command Interface (TrafCI) | A command-line interface that allows you to connect to a Trafodion database and run SQL statements and other commands interactively or from
-script files. For more information, see the http://trafodion.incubator.apache.org/docs/command_interface/index.html[_Trafodion Command Interface Guide_].
-| Trafodion odb tool | A multi-threaded, ODBC-based command-line tool for parallel data loading and extracting. For more information, see the
-http://trafodion.incubator.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
-| DbVisualizer | A third-party database tool that allows you to connect to a Trafodion database. For more information, see the http://www.dbvis.com/[_DbVisualizer website_].
-| SQuirreL SQL Client | A third-party database tool that allows you to connect to a Trafodion database. For more information, see the 
-http://squirrel-sql.sourceforge.net/[_SQuirreL SQL Client website_].
+^1^ License issues prevent us from including the ODBC Driver for Windows in this release. Contact the
+Trafodion user e-mail list (user@trafodion.incubator.apache.org) for help obtaining the driver.
+
+<<<
+[[introduction-download]]
+== Download Installation Package
+The Trafodion client software is available from the http://http://trafodion.apache.org/download.html[Trafodion Download] page. There is one
+`Trafodion Clients` package per release listed under *<version> Binaries*.
+
+The `Trafodion Clients` package consists of a zipped tar file that contains the Trafodion Clients tar file. The Trafodion Client
+binaries are located in the Clients folder, which contains the following files:
+
+[cols="30%l,70%", options="header"]
 |===
+| File                             | Usage
+| odbc64_linux.tar.gz              | Trafodion odb tool.
+| TFODBC64-*.exe                   | *[Not included in this release]*^1^ Trafodion ODBC Driver for Windows.
+| TRAF_ODBC_Linux_Driver_64.tar.gz | Trafodion ODBC driver for Linux.
+| trafci.zip                       | The Trafodion command interpreter `trafci`.
+| JDBCT4.zip                       | Trafodion JDBC Type 4 Driver.
+|===
+
+^1^ License issues prevent us from including the ODBC Driver for Windows in this release. Contact the
+Trafodion user e-mail list (user@trafodion.incubator.apache.org) for help obtaining the driver.
+
+[[introduction-windows-download]]
+=== Windows Download
+
+Do the following:
+
+1.  Create a download folder on the client workstation. For example, `Trafodion Downloads`.
+
+2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
+
+3.  Orient yourself to the binaries for the release you're installing.
+Click on the `Trafodion Clients` link to start downloading the Trafodion clients tar file to your workstation.
+
+4.  Place the `apache-trafodion-clients-*.tar.gz` file into the download folder.
+
+5.  Unpack the `apache-trafodion-clients-\*.tar.gz` file using an unzip program of your choice. This creates
+an `apache-trafodion-clients-*.tar` file.
+
+6. Unpack the `apache-trafodion-clients-*.tar` file using an unzip program of your choice. This creates
+the `clients` folder, which has the following content:
++
+```
+JDBCT4.zip odb64_linux.tar.gz trafci.zip TRAF_ODBC_Linux_Driver_64.tar.gz
+```
++
+You use these files to install the different Trafodion clients.
+
+[[introduction-linux-download]]
+=== Linux Download
+
+Do the following:
+
+1. Create a download directory on the client workstation. For example, `$HOME/trafodion-downloads`.
+
+2. Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
+
+3.  Orient yourself to the binaries for the release you're installing.
+Right-click on the `Trafodion Clients` link and select *Copy link address*.
+
+4.  Go to the download directory on the client workstation and use `wget` to download the client package
+using the link address you copied in step 3 above.
+
+5.  Unpack the `apache-trafodion-clients-*.tar.gz` using `tar`.
++
+*Example*
++
+```
+$ mkdir $HOME/trafodion-downloads
+$ cd $HOME/trafodion-downloads
+$ wget <link to package>
+$ tar -xzf apache-trafodion-clients-1.3.0-incubating-bin.tar.gz
+$ cd clients
+$ ls
+JDBCT4.zip  odb64_linux.tar.gz  trafci.zip  TRAF_ODBC_Linux_Driver_64.tar.gz
+$
+```
++
+You use these files to install the different Trafodion clients.
+
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/jdbct4.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/jdbct4.adoc b/docs/client_install/src/asciidoc/_chapters/jdbct4.adoc
index a2c2e34..74b68c2 100644
--- a/docs/client_install/src/asciidoc/_chapters/jdbct4.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/jdbct4.adoc
@@ -20,61 +20,24 @@
  * 
 ////
 
+[[jdbct4]]
 = Install JDBC Type-4 Driver
-These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
-
-== Installation Package
-
-The distribution file for the Trafodion JDBC Type 4 Driver is packaged within the Trafodion clients tar file, `clients-1.3.*_n_*.tar.gz`,
-on the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
-
-Use this distribution file to install the Trafodion JDBC Type 4 Driver:
-
-[cols="35%l,35%,30%",options="header"]
-|===
-| Distribution File | Description | Client Operating System
-| JDBCT4.zip        | Zip file   | Windows or Linux
-|===
-
-By default, a new version of the JDBC Type 4 driver will be installed in this directory and its folders unless you specify a
-different directory during installation:
-
-[cols="65%,35%",options="header"]
-|===
-| Default Installation Directory                                  | Client Operating System
-| _<user-specified directory>_ (For example: /usr/local/jdbc)     | Windows or Linux
-|===
-
-[cols="30%l,25%l,45%",options="header"]
-|===
-| Installation Folder                | Files                          | Description
-| /lib                               | jdbcT4.jar                   | Product JAR file.
-| /samples                           | t4jdbc.properties            | Properties file that you can configure for your application environment.
-|                                    | README                       | Readme file that explains how to use the common sample set.
-| /samples/common                    | sampleUtils.java             | Sample source code for creating, populating, and dropping sample tables.
-| /samples/DBMetaSample              | DBMetaSample.java            | Sample source code for getting metadata about the sample tables.
-|                                    | README                       | Readme file that explains how to use this sample set.
-| /samples/PreparedStatementSample   | PreparedStatementSample.java | Sample code for simple or parameterized SELECT statements that are prepared.
-|                                    | README                       | Readme file that explains how to use this sample set.
-| /samples/ResultSetSample           | README                       | Readme file that explains how to use this sample set.
-|                                    | ResultSetSample.java         | Sample source code for fetching rows from a result set.
-| /samples/StatementSample           | README                       | Readme file that explains how to use this sample set.
-|                                    | StatementSample.java         | Sample source code for fetching rows from a simple SELECT statement.
-|===
 
+[[jdbct4-installation-requirements]]
 == Installation Requirements
 
 The Trafodion JDBC Type 4 Driver requires a Java-enabled platform that supports the Java Development Kit (JDK) 1.7 or higher.
 
-To determine the Java version that you have installed on your client workstation and to install a supported version, please refer to
-<<jdbct4_JRE, Install Java Runtime Environment (JRE)>> below.
-
-[[jdbct4_JRE]]
-=== Install Java Runtime Environment (JRE)
+[[jdbct4-java-environment]]
+=== Java Environment
 
 The Trafodion JDBC Type 4 Driver requires that a compatible Java version be installed on the client workstation and that the Java path be set to
 the correct location. The supported Java version is 1.7 or higher.
 
+NOTE: If you plan to do Java-based development, install the Java Development Kit (JDK) rather than the Java Runtime Environment (JRE).
+These examples use JRE.
+
+[[jdbct4-verify-java-version]]
 ==== Verify Java Version
 
 To display the Java version of the client workstation on the screen, enter:
@@ -93,7 +56,7 @@ C:\>
 ```
 
 The Java version should be *1.7* or higher. If the returned version is not supported, please refer to
-<<jdbct4_install_java, Installing a Supported Java Version>> below.
+<<jdbct4-install-java, Installing a Supported Java Version>> below.
 
 <<<
 If you see this message:
@@ -105,10 +68,10 @@ If you see this message:
 It indicates that the Java PATH is not set. Follow one of these sets of instructions, depending on the operating system of your client
 workstation:
 
-* <<jdbct4_path_windows, Setting the PATH to a Supported Java Version on Windows>>
-* <<jdbct4_path_linux, Setting the PATH to a Supported Java Version on Linux>>
+* <<jdbct4-path-windows, Setting the PATH to a Supported Java Version on Windows>>
+* <<jdbct4-path-linux, Setting the PATH to a Supported Java Version on Linux>>
 
-[[jdbct4_install_java]]
+[[jdbct4-install-java]]
 ==== Install Supported Java Version
 
 The supported Java version is 1.7 or higher. To install one of the supported Java versions on the client workstation,
@@ -117,16 +80,42 @@ go to this link: http://www.java.com/en/download
 After installing the Java version, proceed with setting the Java path. Follow one of these sets of instructions, depending on the operating
 system of your client workstation:
 
-* <<jdbct4_path_windows, Setting the PATH to a Supported Java Version on Windows>>
-* <<jdbct4_path_linux, Setting the PATH to a Supported Java Version on Linux>>
+* <<jdbct4-path-windows, Setting the PATH to a Supported Java Version on Windows>>
+* <<jdbct4-path-linux, Setting the PATH to a Supported Java Version on Linux>>
 
-[[jdbct4_path_windows]]
+[[jdbct4-path-windows]]
 ==== Set Windows PATH Variable
 
-1.  Right-click the *Computer* icon on your desktop, and then select *Properties*. The *Control Panel > System and Security > System* window
+===== Windows 10
+
+1. Right-click on the Windows icon on the menu bar. Select *System*.
+
+2. Click on *Advanced System Settings*.
+
+3.  In the *System Properties* dialog box, click the *Advanced* tab.
+4.  Click the *Environment Variables* button.
+5.  Under *System* variables, select the variable named *Path*, and then click *Edit. . .*:
++
+image:{images}/win10_edit_path.jpg[Windows 10 Edit Path Variable]
+
+6.  Click *Browse. . .*. Find the directory where you installed Java and select it.
++
+image:{images}/win10_select_java.jpg[image]
+
+7.  Click *OK* to close the browse window. Click *OK* to close the edit window.
+8.  Verify that the updated *Path* appears under *System* variables, and click *OK*.
+9.  In the *System Properties* dialog box, click *OK* to accept the changes.
+
+
+===== Windows 8
+
+1.  Open system Right-click the *Computer* icon on your desktop, and then select *Properties*. The *Control Panel > System and Security > System* window
 appears.
-2.  In the left navigation bar, click the *Advanced* system settings link.
+
+2. In the left navigation bar, click the *Advanced* system settings link.
+
 3.  In the *System Properties* dialog box, click the *Environment Variables* button.
+
 4.  Under *System* variables, select the variable named *Path*, and then click *Edit*:
 +
 image:{images}/path2.jpg[image]
@@ -148,7 +137,7 @@ path in double quotes (") before the semicolon.
 7.  Verify that the updated *Path* appears under *System* variables, and click *OK*.
 8.  In the *System Properties* dialog box, click *OK* to accept the changes.
 
-[[jdbct4_path_linux]]
+[[jdbct4-path_linux]]
 ==== Set Linux PATH Variable
 
 1.  Open the user profile (`.profile` or `.bash_profile` for the Bash shell) in the `$HOME` directory.
@@ -174,46 +163,189 @@ use the setenv command instead of export.
 . .profile
 ```
 
-<<<
-[[jdbct4_install]]
+[[jdbct4-install-instructions]]
 == Installation Instructions
 
-[[jdbct4_download]]
-=== Download JDBC Type-4 Driver
+You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
 
-1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
-3.  Click on the `clients-1.3.*_n_*.tar.gz` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `clients-1.3.*_n_*.tar.gz` file into the download folder.
-5.  Unpack the `clients-1.3.*_n_*.tar.gz` file.
+[[jdbct4-install-driver]]
+=== Install JDBC Type-4 Driver
+
+1.  Change the directory to the `clients` subdirectory.
+2.  Extract the contents of the `JDBCT4.zip` file by using the unzip command (or the extract function of your compression software):
++
+*Example*
 +
 ```
-tar -xzf clients-1.3.0.tar.gz
+unzip JDBCT4.zip -d $HOME/jdbc
 ```
-+
-The package file contains the `JDBCT4.zip` distribution file, which is extracted to the clients subdirectory.
 
-6.  Proceed with <<jdbct4_install_zip, Installing the Trafodion JDBC Type 4 Driver From the Zip File>> below.
+The content of the target directory is as follows:
 
-[[jdbct4_install_zip]]
-=== Install JDBC Type-4 Driver
+[cols="33%l,30%l,37%",options="header"]
+|===
+| Installation Folder                | Files                        | Description
+| /lib                               | jdbcT4.jar                   | Product JAR file.
+| /samples                           | t4jdbc.properties            | Properties file that you can configure for your application environment.
+|                                    | README                       | Readme file that explains how to use the common sample set.
+| /samples/common                    | sampleUtils.java             | Sample source code for creating, populating, and dropping sample tables.
+| /samples/DBMetaSample              | DBMetaSample.java            | Sample source code for getting metadata about the sample tables.
+|                                    | README                       | Readme file that explains how to use this sample set.
+| /samples/PreparedStatementSample   | PreparedStatementSample.java | Sample code for simple or parameterized SELECT statements that are prepared.
+|                                    | README                       | Readme file that explains how to use this sample set.
+| /samples/ResultSetSample           | README                       | Readme file that explains how to use this sample set.
+|                                    | ResultSetSample.java         | Sample source code for fetching rows from a result set.
+| /samples/StatementSample           | README                       | Readme file that explains how to use this sample set.
+|                                    | StatementSample.java         | Sample source code for fetching rows from a simple SELECT statement.
+|===
+
+[[jdbct4-setup-env]]
+== Set Up Client Environment
+
+=== Java Development
+
+If you plan to write and run Java applications that use the Trafodion JDBC Type 4 Driver to connect to a Trafodion database, then set these
+environment variables on the client workstation, replacing `_jdk-directory_` with the location of your Java Development Kit and
+replacing `_jdbc-installation-directory_` with the name of the directory where you downloaded the JDBC Type 4 driver:
+
+[cols="20%l,40%l,40%l",options="header"]
+|===
+| Environment Variable | On Windows                                                              | On Linux
+| JAVA_HOME            | set JAVA_HOME="_jdk-directory_"^1^                                      | export JAVA_HOME=_jdk-directory_
+| PATH                 | set PATH=%PATH%;%JAVA_HOME%\bin                                         | export PATH=$PATH:$JAVA_HOME/bin
+| CLASSPATH            | set CLASSPATH=%CLASSPATH%;_jdbc-installation-directory_\lib\jdbcT4.jar; | export CLASSPATH=$CLASSPATH:_jdbc-installation-directory_/lib/jdbcT4.jar:
+|===
+
+^1^ Enclose the _jdk-directory_ in quotes to ensure that Windows can find the directory correctly. You can use the `set <variable>` command to verify the setting.
+
+<<<
+=== Configure Applications
+
+Edit the `t4jdbc.properties` file in the `samples` folder. Refer to the `README` file in the `samples` folder for instructions.
+
+Set these values for your environment:
+
+* _catalog_: Specify a catalog that exists in the database.
+* _schema_: Specify a schema that exists in the database.
+* _user_: Specify the name of a user who will be accessing the database.
+* _password_: Specify the password of a user who will be accessing the database.
+* _url_: Specify this string: _jdbc:t4jdbc://_host-name_:_port-number_/:_
+
+_host-name_ is the IP address or host name of the database platform, and _port-number_ is the location where the 
+Trafodion Database Connectivity Service (DCS) is running, which is *23400* by default. See the
+http://trafodion.incubator.apache.org/docs/dcs_reference/index.html[Trafodion Database Connectivity Services Reference Guide]
+for information about how to configure the DCS port.
+
+*Example*
+
+In this example, Trafodion authentication has not been enabled. Therefore, you can use a dummy
+user and password. If authentication is enabled, then use your user and password information.
 
-1.  Change the directory to the clients subdirectory.
-2.  Extract the contents of the `JDBCT4.zip` file by using the unzip command (or the WinZip extract tool):
-+
 ```
-unzip JDBCT4.zip
+catalog = TRAFODION
+schema = SEABASE
+user = usr
+password = pwd
+
+url = jdbc:t4jdbc://trafodion.host.com:23400/:
 ```
-+
-The command creates these subdirectories:
-+
-* `lib`, which contains the `jdbcT4.jar` file
-* `samples`, which contains sample programs
 
-3.  Set up the client environment. See <<jdbct4_setup_env, Set Up Client Environment>>.
+NOTE: The driver’s class name is `org.trafodion.jdbc.t4.T4Driver`.
 
 <<<
-=== Uninstall JDBC Type-4 Driver
+[[jdbct4-test-programs]]
+== Test Programs
+
+The `README` file in the `samples` folder provide information for how you build and run sample Java programs.
+You can use these programs to verify the setup of the Trafodion JDBC Type-4 driver.
+See the <<jdbct4-install-driver, Install JDBC Type-4 Driver>> section above for information on the different
+sample programs that are included with the Trafodion JDBC Type-4 driver.
+
+*Example*
+
+Build and run the StatementSample test program to verify the JDBC Type-4 driver installation.
+
+```
+C:\Development Tools\Trafodion JDBCT4\samples>cd StatementSample
+
+C:\Development Tools\Trafodion JDBCT4\samples\StatementSample>%JAVA_HOME%\bin\javac -classpath ..\..\lib\jdbcT4.jar *.java ..\common\*.java
+Note: ..\common\sampleUtils.java uses or overrides a deprecated API.
+Note: Recompile with -Xlint:deprecation for details.
+v
+C:\Development Tools\Trafodion JDBCT4\samples\StatementSample>%JAVA_HOME%\bin\java -classpath ..\..\lib\jdbcT4.jar;..;. -Dt4jdbc.properties=..\t4jdbc.properties StatementSample
+Mar 16, 2016 9:36:54 PM common.sampleUtils getPropertiesConnection
+INFO: DriverManager.getConnection(url, props) passed
+
+Inserting TimeStamp
+
+Simple Select
+
+Printing ResultSetMetaData ...
+No. of Columns 12
+Column 1 Data Type: CHAR Name: C1
+Column 2 Data Type: SMALLINT Name: C2
+Column 3 Data Type: INTEGER Name: C3
+Column 4 Data Type: BIGINT Name: C4
+Column 5 Data Type: VARCHAR Name: C5
+Column 6 Data Type: NUMERIC Name: C6
+Column 7 Data Type: DECIMAL Name: C7
+Column 8 Data Type: DATE Name: C8
+Column 9 Data Type: TIME Name: C9
+Column 10 Data Type: TIMESTAMP Name: C10
+Column 11 Data Type: REAL Name: C11
+Column 12 Data Type: DOUBLE PRECISION Name: C12
+
+Fetching rows...
+
+Printing Row 1 using getString(), getObject()
+Column 1 - Row1                ,Row1
+Column 2 - 100,100
+Column 3 - 12345678,12345678
+Column 4 - 123456789012,123456789012
+Column 5 - Selva,Selva
+Column 6 - 100.12,100.12
+Column 7 - 100.12,100.12
+Column 8 - 2000-05-06,2000-05-06
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.000000,2000-05-06 10:11:12.0
+Column 11 - 100.12,100.12
+Column 12 - 100.12,100.12
+
+Printing Row 2 using getString(), getObject()
+Column 1 - Row2                ,Row2
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2000-05-16,2000-05-16
+Column 9 - 10:11:12,10:11:12
+Column 10 - 2000-05-06 10:11:12.000000,2000-05-06 10:11:12.0
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+Printing Row 3 using getString(), getObject()
+Column 1 - TimeStamp           ,TimeStamp
+Column 2 - -100,-100
+Column 3 - -12345678,-12345678
+Column 4 - -123456789012,-123456789012
+Column 5 - Selva,Selva
+Column 6 - -100.12,-100.12
+Column 7 - -100.12,-100.12
+Column 8 - 2016-03-16,2016-03-16
+Column 9 - 21:37:03,21:37:03
+Column 10 - 2016-03-16 21:37:03.053,2016-03-16 21:37:03.053
+Column 11 - -100.12,-100.12
+Column 12 - -100.12,-100.12
+
+End of Data
+
+C:\Development Tools\Trafodion JDBCT4\samples\StatementSample>
+```
+
+<<<
+== Uninstall JDBC Type-4 Driver
 Run one of these sets of commands to remove the Trafodion JDBC Type 4 Driver:
 
 * On Linux:
@@ -225,10 +357,9 @@ rm -rf <jdbc-installation-directory>
 *Example*
 +
 ```
-rm -rf /usr/local/jdbc
+rm -rf ~/jdbc
 ```
 
-<<<
 * On Windows:
 +
 ```
@@ -236,6 +367,8 @@ del <jdbc-installation-directory>
 rmdir <jdbc-installation-directory>
 ```
 +
+<<<
++
 *Example*
 +
 Windows uninstall
@@ -272,54 +405,10 @@ C:\>
 ```
 
 <<<
-=== Reinstall JDBC Type-4 Driver
-
-1.  Close all applications running on the workstation, except the Web browser.
-2.  In the browser, navigate to the download site and download the client package file. For more information, please refer to
-<<jdbct4_download, Downloading the Trafodion JDBC Type 4 Driver>>.
-3.  Extract the contents of the zip file by following these instructions: <<jdbct4_install_zip, Installing the Trafodion JDBC Type 4 Driver From the Zip File>>.
-4.  Set up the client environment. Please refer to: <<jdbct4_setup_env, Setting Up the Client Environment>>.
-
-[[jdbct4_setup_env]]
-== Set Up Client Environment
-
-Check that you have a supported Java version installed on the client workstation. The supported Java version is 1.7 or higher. For more
-information, see <<jdbct4_JRE, Installing and Verifying the Java Runtime>>.
-
-If you plan to write and run Java applications that use the Trafodion JDBC Type 4 Driver to connect to a Trafodion database, set these
-environment variables on the client workstation, replacing `_jdk-directory_` with the location of your Java Development Kit and
-replacing `_jdbc-installation-directory_` with the name of the directory where you downloaded the JDBC Type 4 driver:
+== Reinstall JDBC Type-4 Driver
 
-[cols="20%l,40%l,40%l",options="header"]
-|===
-| Environment Variable | On Windows                                                              | On Linux
-| JAVA_HOME            | set JAVA_HOME=_jdk-directory_                                           | export JAVA_HOME=_jdk-directory_
-| PATH                 | set PATH=%PATH%;%JAVA_HOME%\bin                                         | export PATH=$PATH:$JAVA_HOME/bin
-| CLASSPATH            | set CLASSPATH=%CLASSPATH%;_jdbc-installation-directory_\lib\jdbcT4.jar; | export CLASSPATH=$CLASSPATH:_jdbc-installation-directory_/lib/jdbcT4.jar:
-|===
-
-<<<
-=== Configure Applications
-
-Edit the `t4jdbc.properties` file. Set these values for your environment:
-
-* _catalog_: Specify a catalog that exists in the database.
-* _schema_: Specify a schema that exists in the database.
-* _user_: Specify the name of a user who will be accessing the database.
-* _password_: Specify the password of a user who will be accessing the database.
-* _url_: Specify this string: _jdbc:t4jdbc://_host-name_:_port-number_/:_
-
-_host-name_ is the IP address or host name of the database platform, and _port-number_ is the location where the 
-Trafodion Database Connectivity Service (DCS) is running, which is 37800 by default.
-
-*Example*
-
-```
-catalog = <your-catalog> schema = <your-schema> user = <user-name>
-password = <password>
-
-url = jdbc:t4jdbc://<host-name>:<port-number>/:
-```
-
-NOTE: The driver’s class name is `org.trafodion.jdbc.t4.T4Driver`.
+1. Close all applications running on the workstation, except the Web browser.
+2. Download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
+3. Install the new Trafodion JDBC Type-4 driver. See <<jdbct4-install-driver, Install JDBC Type-4 Driver>>.
+4. Set up the client environment. Please refer to: <<jdbct4-setup-env, Set Up Client Environment>>.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/odb.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/odb.adoc b/docs/client_install/src/asciidoc/_chapters/odb.adoc
index af97723..4e397af 100644
--- a/docs/client_install/src/asciidoc/_chapters/odb.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/odb.adoc
@@ -22,21 +22,6 @@
 
 [[install-odb]]
 = Install odb
-These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
-
-[[installation-package]]
-== Installation Package
-
-The distribution file for odb is packaged within the Trafodion clients tar file, `clients-1.3.*_n_*.tar.gz`,
-on the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
-Use this distribution file to install odb:
-
-[cols="35%l,35%l,30%",options="header"]
-|===
-| Distribution File    | File Contents | Client Operating System
-| odb64_linux.tar.gz | README +
-/bin/odb64luo | 64-bit Linux
-|===
 
 [[installation-requirements]]
 == Installation Requirements
@@ -51,50 +36,28 @@ http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_]
 NOTE: Before following these installation instructions, please make sure to install and configure unixODBC on the client workstation. For more
 information, see the http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
 
-Follow these instructions to download and install odb on the client workstation.
-
-* <<odb-download, Downloading odb>>
-* <<odb-install, Installing odb>>
-
-To uninstall odb, please refer to <<odb_uninstall, Uninstalling odb>>.
-
-<<<
-[[odb-download]]
-=== Download odb
-
-1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html
-3.  Click on the `clients-1.3.*_n_*.tar.gz` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `clients-1.3.*_n_*.tar.gz` file into the download folder.
-5.  Unpack the `clients-1.3.*_n_*.tar.gz` file.
-+
-```
-tar -xzf clients-1.3.0.tar.gz
-```
-+
-The package file contains the `odb64_linux.tar.gz` distribution file, which is extracted to the clients subdirectory.
-
-6.  Proceed with <<odb_install, Installing odb>>.
+You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
 
 [[odb-install]]
 === Install odb
 
-1.  Change the directory to the clients subdirectory.
+1.  Change the directory to the `clients` subdirectory.
 2.  Unpack the contents of the `odb64_linux.tar.gz` file to a location on your client workstation:
 +
 ```
-tar -xzf odb64_linux.tar.gz
+mkdir $HOME/odb
+tar -xzf odb64_linux.tar.gz -C $HOME/odb
 ```
 +
 The command extracts these files:
 +
 * `README`
-* `/bin/odb64luo` `odb64luo` is the odb executable.
+* `/bin/odb64luo` (the odb executable)
 
 3.  You are now ready to run the odb executable. For more information, see the http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
 
 [[odb-uninstall]]
-=== Uninstall odb
+== Uninstall odb
 
 To uninstall odb, delete the `README` and `/bin/odb64luo` files from their installed location.
 



[42/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
new file mode 100644
index 0000000..6e9cba9
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
@@ -0,0 +1,899 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[develop-spj-methods]]
+= Develop SPJ Methods
+
+Before creating, or registering, an SPJ in the database, you must write
+and compile the Java method to be used as the body of the SPJ. The
+manual refers to those Java methods as _SPJ methods_.
+
+This chapter requires a familiarity with writing and compiling Java
+programs and covers these topics:
+
+* <<guidelines-for-writing-spj-methods, Guidelines for Writing SPJ Methods>>
+* <<accessing-a-trafodion-database, Accessing a Trafodion Database>>
+* <<handling-java-exceptions,Handling Java Exceptions>>
+* <<compiling-and-packaging-java-classes,Compiling and Packaging Java Classes>>
+
+[[guidelines-for-writing-spj-methods]]
+== Guidelines for Writing SPJ Methods
+
+Follow the guidelines for these topics when you write SPJ methods to be
+used as SPJs in the database:
+
+* <<signature of the java method, Signature of the Java Method>>
+* <<returning-output-values-from-the-java-method, Returning Output Values From the Java Method>>
+* <<returning-stored-procedure-result-sets, Returning Stored Procedure Result Sets>>
+* <<using-the-main-method, Using the main() Method>>
+* <<null-input-and-output, Null Input and Output>>
+* <<static-java-variables, Static Java Variables>>
+* <<nested-java-method-invocations, Nested Java Method Invocations>>
+
+[[signature-of-the-java-method]]
+=== Signature of the Java Method
+
+A Java method that you use as an SPJ must have this general signature:
+
+[source, java]
+----
+public static void myMethodName ( java-parameter-list )
+----
+
+[[public-access-and-static-modifiers]]
+==== Public Access and Static Modifiers
+
+The Java method must be defined as public and static. If a method is
+private or protected, the database engine is unable to find the Java
+method when you try to register the SPJ and returns an error. The Java
+method must be defined as static so that the method can be invoked
+without having to instantiate its class.
+
+[[void-return-type]]
+==== Void Return Type
+
+The return type of the Java method must be `void`. The method must not
+return a value directly to the caller.
+
+[[java-parameters]]
+==== Java Parameters
+
+Except for result sets, which are described in
+<<returning-stored-procedure-result-sets, Returning Stored Procedure Result Sets>>,
+the parameter types in the Java signature must correspond to the SQL
+parameters of the stored procedure that you are planning to create. For
+type mappings, see the table below.
+
+[[table-1]]
+.Mapping of Java Data Types to SQL Data Types
+
+[cols="40%,60%",options="header",]
+|===
+| Java Data Type | Maps to SQL Data Type. . .
+| `java.lang.String`             |
+CHAR[ACTER] +
+CHAR[ACTER] VARYING +
+VARCHAR +
+PIC[TURE] X^1^ +
+NCHAR +
+NCHAR VARYING +
+NATIONAL CHAR[ACTER] +
+NATIONAL CHAR[ACTER] VARYING 
+| `java.sql.Date`               | DATE
+| `java.sql.Time`               | TIME
+| `java.sql.Timestamp`          | TIMESTAMP
+| `java.math.BigDecimal`        |
+NUMERIC (including NUMERIC with a precision greater than eighteen)^2^ +
+DEC[IMAL]^2^ +
+PIC[TURE] S9^3^
+| `short`                         | SMALLINT^2^
+| `int or java.lang.Integer`^4^   | INT[EGER]^2^
+| `long or java.lang.Long`^4^     | LARGEINT2
+| `double or java.lang.Double`^4^ | FLOAT
+| `float or java.lang.Float`^4^   | REAL
+| `double or java.lang.Double`^4^ | DOUBLE PRECISION
+| `java.sql.ResultSet[]`          | None
+|===
+
+1. The Trafodion database stores `PIC X` as a `CHAR` data type.
+
+2. Numeric data types of SQL parameters must be `SIGNED`, which is the
+default in the Trafodion database.
+
+3. The Trafodion database stores `PIC S9` as a `DECIMAL` or `NUMERIC` data type.
+
+4. Choose a Java wrapper class if you plan to pass null values as
+arguments to or from the method. See
+<<null-input-and-output, Null Input and Output>>
+
+Output parameters in the Java signature must be arrays (for example,
+`int[]` or `String[]`) that accept only one value in the first element of
+the array at index 0. For more information, see
+<<returning-output-values-from-the-java-method, Returning Output Values From the Java Method>>.
+
+[[returning-output-values-from-the-java-method]]
+=== Returning Output Values From the Java Method
+
+The Java method can return data to the calling application in the form
+of output parameters or result sets.
+
+_Output parameters_ in the Java signature are parameter arrays that
+accept only one value in the first element of the array at index 0. The
+array objects have a fixed size of one element.
+
+IMPORTANT: You cannot return more than one value to an output parameter of an SPJ.
+Any attempt to return more than one value to an output parameter results in a Java exception,
+`ArrayIndexOutOfBounds`.
+
+_Result sets_ in the Java signature are one-element `java.sql.ResultSet[]`
+arrays that contain ResultSet objects that have multiple rows of data.
+For more information about result sets, see
+<<returning-stored-procedure-result-sets, Returning Stored Procedure Result Sets>>
+
+This subsection covers these topics related to output parameters:
+
+* <<using-arrays-for-output-parameters, Using Arrays for Output Parameters>>
+* <<type-mapping-of-output-parameters, Type Mapping of Output Parameters>>
+
+[[using-arrays-for-output-parameters]]
+==== Using Arrays for Output Parameters
+
+You must use arrays for the output parameters of a Java method because
+of how Java handles the arguments of a method. Java supports arguments
+that are passed by value to a method and does not support arguments that
+are passed by reference. As a result, Java primitive types can be passed
+only to a method, not out of a method. Because a Java array is an
+object, its reference is passed by value to a method, and changes to the
+array are visible to the caller of the method. Therefore, arrays must be
+used for output parameters in a Java method.
+
+IMPORTANT: An output parameter accepts only one value in the first element
+of the array at index 0. Any attempt to return more than one value to an
+output parameter results in a Java exception, `ArrayIndexOutOfBounds`.
+
+For each output parameter, specify the Java type followed by empty
+square brackets (`[]`) to indicate that the type is an array. For example,
+specify an int type as `int[]` for an output parameter in the Java
+signature.
+
+To return multiple values from a Java method, use an output parameter
+for each returned value. For example, the `supplierInfo()` method returns
+a supplier's name, address, city, state, and post code, each as a single
+string in an output parameter:
+
+The `supplyQuantities()` method returns an average quantity, a minimum
+quantity, and a maximum quantity to separate output parameters of the
+integer type:
+
+[source, java]
+----
+public static void supplyQuantities( int[] avgQty
+                                   , int[] minQty
+                                   , int[] maxQty
+                                   )
+{
+
+...
+
+throws SQLException
+----
+
+For more information about the SPJ examples, see
+<<sample-spjs, Appendix A: Sample SPJs>>.
+
+[[type-mapping-of-output-parameters]]
+==== Type Mapping of Output Parameters
+
+When writing an SPJ method, consider how the output of the SPJ is
+used in the calling application. For output parameters, the Java data
+type of the SPJ method must map to an SQL data type. See
+<<table-1, Table 1>>.
+
+The SQL data type must then map to a compatible data type in the calling
+application. For the client application programming interfaces (APIs) that
+support SPJs and for cross-references to the appropriate manuals for type
+mappings between Trafodion SQL and each API, see
+<<execute-spjs, Execute SPJs>> below.
+
+[[returning-stored-procedure-result-sets]]
+=== Returning Stored Procedure Result Sets
+
+The Trafodion database engine supports SPJs that return stored procedure
+result sets. A stored procedure result set is a cursor that is left open
+after the SPJ method executes (that is, after the CALL statement
+executes successfully). After the CALL statement executes successfully,
+the calling application can issue requests to open and then retrieve
+multiple rows of data from the returned result sets.
+
+An SPJ method returns an ordered collection of result sets to the
+calling application by executing SELECT statements and placing each
+returned ResultSet object into a one-element Java array of type
+`java.sql.ResultSet[]`. The `java.sql.ResultSet[]` array is part of the Java
+method's signature and is recognized by the database engine as a
+container for a single stored procedure result set.
+
+Place the `java.sql.ResultSet[]` parameters after the other Java
+parameters, if any, in the Java signature. If you do not place the
+`java.sql.ResultSet[]` parameters after the other
+parameters in the signature, the database engine prevents you from
+creating an SPJ using that Java method. This example shows the
+declaration of an SPJ method, `orderSummary()`, which returns a maximum of
+two result sets:
+
+[source, java]
+----
+public static void orderSummary( java.lang.String onOrAfter
+                               , long[] numOrders
+                               , java.sql.ResultSet[] orders
+                               , java.sql.ResultSet[] detail
+                               )
+----
+
+This code fragment shows how the `orderSummary()` method returns one of
+its result sets by executing a SELECT statement and assigning the
+`java.sql.ResultSet` object to a `java.sql.ResultSet[]` output array:
+
+[source,java]
+----
+// Open a result set for order num, order info rows
+java.lang.String s =
+     "SELECT amounts.*, orders.order_date, emps.last_name "
+   + "FROM ( SELECT o.ordernum, COUNT( d.partnum ) AS num_parts, "
+   + "       SUM( d.unit_price * d.qty_ordered ) AS amount "
+   + "       FROM demo.sales.orders o, demo.sales.odetail d "
+   + "       WHERE o.ordernum = d.ordernum "
+   + "         AND o.order_date >= CAST(? AS DATE) "
+   + "       GROUP BY o.ordernum ) amounts, "
+   + "   demo.sales.orders orders, demo.persnl.employee emps "
+   + "WHERE amounts.ordernum = orders.ordernum "
+   + "  AND orders.salesrep = emps.empnum "
+   + "ORDER BY orders.ordernum "
+   ;
+
+java.sql.PreparedStatement ps2 = conn.prepareStatement(s) ;
+ps2.setString( 1, onOrAfter ) ;
+
+// Assign the returned result set object to the first element of a
+// java.sql.ResultSet[] output array
+orders[0] = ps2.executeQuery() ;
+----
+
+For the entire example, see 
+<<ordersummary-procedure, ORDERSUMMARY Procedure>>.
+
+IMPORTANT: In an SPJ method that returns result sets, do not explicitly close
+the default connection or the statement object. The database engine closes the
+connection used to return result sets after it finishes processing the result
+sets. If you close the connection on which the result sets are being returned,
+those result sets will be lost, and the calling application will not be able
+to process them.
+
+An SPJ method can return result sets that contain any data types, except
+large object (LOB) data. An SPJ method can return a holdable or
+updatable cursor as a result set. However, Trafodion SQL does not expose
+those attributes in the calling application. An SPJ method can return a
+ResultSet object that is a stored procedure result set acquired from a
+nested CALL statement executed by the SPJ method. However, you are
+discouraged from nesting CALL statements in SPJ methods. For more
+information, see <<nested-java-method-invocations, Nested Java Method Invocations>>.
+
+If an SPJ method returns multiple ResultSet objects, the database engine
+sorts the collection of valid result sets in chronological order
+according to when the underlying SQL statements were executed. If the
+number of result sets exceeds the declared maximum for the SPJ, only the
+first set of result sets up to the maximum number are returned. The
+database engine discards the other result sets and returns a warning to
+the calling application.
+
+When an SPJ method returns a ResultSet object through a
+`java.sql.ResultSet[]` parameter, Trafodion SQL exposes the underlying rows
+of data as an SQL cursor in the calling application.
+
+If a returned result set is a scrollable cursor, all underlying rows are
+included in the result set and are available to the calling application.
+If a returned result set is not scrollable, only those rows not
+processed by the SPJ method are included in the result set and are
+available to the calling application. If an SPJ method returns multiple
+occurrences of the same ResultSet object, the database engine ignores
+all but one occurrence and makes the underlying rows available to the
+calling application as a single result set.
+
+For information about processing result sets in different calling
+applications, see:
+
+* <<returning-result-sets-in-trafci, Returning Result Sets in trafci>>
+* <<returning-result-sets-in-an-odbc-client-application, Returning Result Sets in an ODBC Client Application>>
+* <<returning-result-sets-in-a-jdbc-client-application, Returning Result Sets in a JDBC Client Application>>
+
+[[using-the-main-method]]
+=== Using the main() Method
+
+You can use the `main()` method of a Java class file as an SPJ method. The
+`main()` method is different from other Java methods because it accepts
+input values in an array of `java.lang.String` objects and does not return
+any values in its array parameter.
+
+For example, you can register this main() method as an SPJ:
+
+[source,java]
+----
+public static void main (java.lang.String [] args)
+{
+
+...
+
+}
+----
+
+When you register a `main()` method as an SPJ, you can specify zero or
+more SQL parameters, even though the underlying `main()` method has only
+one array parameter. All the SQL parameters of the SPJ must have the
+character string data type, CHAR or VARCHAR, and be declared with the IN
+mode.
+
+If you specify the optional Java signature, the signature must be
+(`java.lang.String []`). For more information about registering an SPJ,
+see <<create-spjs, Create SPJs>>.
+
+[[null-input-and-output]]
+=== Null Input and Output
+
+You can pass a `null` value as input to or output from an SPJ method,
+provided that the Java data type of the parameter supports nulls. Java
+primitive data types do not support nulls. However, Java wrapper classes
+that correspond to primitive data types do support nulls. If a null is
+input or output for a parameter that does not support nulls, the
+database engine raises an error condition.
+
+To anticipate null input or output for your SPJ, use Java wrapper
+classes instead of primitive data types in the method signature.
+
+For example, this Java method uses a Java primitive data type in its
+signature where no null values are expected:
+
+[source, java]
+----
+public static void employeeJob( int empNum, Integer[] jobCode )
+----
+
+This Java method also uses a Java wrapper class in its signature to
+anticipate a possible returned null value:
+
+[source, java]
+----
+public static void employeeJob( int empNum, Integer[] jobCode )
+----
+
+[[static-java-variables]]
+=== Static Java Variables
+
+To ensure that your SPJ method is portable, you should avoid using
+static variables in the method. The database engine does not ensure the
+scope and persistence of static Java variables.
+
+[[nested-java-method-invocations]]
+=== Nested Java Method Invocations
+
+An SPJ that invokes another SPJ by issuing a CALL statement causes
+additional system resources to be used. If you want an SPJ method to
+call another SPJ method, consider invoking the other Java method
+directly through Java instead of using a CALL statement. The other Java
+method should be packaged in the same JAR file as the SPJ method. For
+more information, see
+<<compiling-and-packaging-java-classes, Compiling and Packaging Java Classes>>.
+
+[[accessing-a-trafodion-database]]
+== Accessing a Trafodion Database
+
+SPJ methods that access a Trafodion database must be from a Java class
+that uses JDBC method calls. Follow these guidelines when writing an SPJ
+method that accesses a Trafodion database:
+
+* <<use-of-java.sql.connection-objects, Use of java.sql.Connection Objects>>
+* <<using-jdbc-method-calls, Using JDBC Method Calls>>
+* <<referring-to-database-objects-in-an-spj-method, Referring to Database Objects in an SPJ Method>>
+* <<using-the-session_user-or-current_user-function-in-an-spj-method, Using the SESSION_USER or CURRENT_USER Function in an SPJ Method>>
+* <<exception-handling, Exception Handling>>
+
+[[use-of-java.sql.connection-objects]]
+=== Use of java.sql.Connection Objects
+
+The Trafodion database engine supports a default connection in an SPJ
+execution environment, which has a data source URL of
+`"jdbc:default:connection"`. For example:
+
+[source, java]
+----
+Connection conn =
+   DriverManager.getConnection( "jdbc:default:connection" ) ;
+----
+
+`java.sql.Connection` objects that use the `"jdbc:default:connection"` URL
+are portable to the Trafodion platform from other database management
+systems (DBMSs).
+
+[[closing-default-connections]]
+==== Closing Default Connections
+
+The Trafodion database engine controls default connections in the SPJ
+environment and closes default connections when they are no longer
+needed. Therefore, you do not need to use the `close()` method in an SPJ
+method to explicitly close a default connection when the connection is
+no longer needed.
+
+IMPORTANT: If an SPJ method returns result sets, you should not explicitly
+close the default connection. The database engine closes the connection used
+to return result sets after it finishes processing the result sets. If an SPJ
+method closes the connection on which the result sets are being returned, those
+result sets will be lost, and the calling application will not be able to
+process them. The JVM does not return an error or warning when the
+connection is closed.
+
+A default connection that is acquired when an SPJ method executes does
+not necessarily remain open for future invocations of the SPJ method.
+Therefore, do not store default connections in static variables for
+future use.
+
+[[default-connection-url]]
+==== Default Connection URL
+
+The default connection URL, `"jdbc:default:connection"`, is invalid when
+the Java method is invoked outside the DBMS, such as when you execute
+the Java method in a client application. To write an SPJ method that
+operates in a DBMS, in a client application, or both, without having to
+change and recompile the code, use the `sqlj.defaultconnection` system
+property:
+
+[source, java]
+----
+String s = System.property( "sqlj.defaultconnection" ) ;
+if ( s == null )
+{
+   s = other-url ;
+}
+
+Connection c = DriverManager.getConnection( s ) ;
+----
+
+The value of `sqlj.defaultconnection` is `"jdbc:default:connection"` in a
+DBMS and `null` outside a DBMS.
+
+[[connection-pooling]]
+==== Connection Pooling
+
+Connection pooling, where a cache of database connections is assigned to
+a client session and reused, is enabled by default in the SPJ
+environment. The SPJ environment sets the initial connection pool size
+to `1`, but it does not limit the number of connections an SPJ method can
+make.
+
+The SPJ environment also sets the minimum connection pool size to 1 so that
+there is always at least one connection available in the pool. The
+default settings in the SPJ environment are:
+
+* `maxPoolSize=0`
+* `minPoolSize=1`
+* `initialPoolSize=1`
+
+To change these settings, use the properties parameter of the
+`DriverManager.getConnection()` method as shown below:
+
+[source, java]
+----
+java.util.Properties props = new Properties() ;
+
+props.setProperty( "maxPoolSize", "10" ) ;
+props.setProperty( "minPoolSize", "5" ) ;
+props.setProperty( "initialPoolSize", "5" ) ;
+
+Connection conn =
+   DriverManager.getConnection( "jdbc:default:connection", props ) ;
+----
+
+[[using-jdbc-method-calls]]
+=== Using JDBC Method Calls
+
+The Trafodion platform uses a JDBC Type-4 driver internally to execute
+the SQL statements inside an SPJ method. To enable an SPJ to perform SQL
+operations on a Trafodion database, use JDBC method calls in the SPJ
+method. The JDBC method calls must be supported by the JDBC Type-4
+driver on the Trafodion platform.
+
+For example, if you want the SPJ method to operate on a Trafodion database,
+use the JDBC API that is supported by Trafodion.
+
+NOTE: You do not have to explicitly load the JDBC driver before
+establishing a connection to the Trafodion database. The database engine
+automatically loads the JDBC driver when the SPJ is called.
+
+Here is an example of an SPJ method, `adjustSalary()`, that uses JDBC
+method calls to adjust an employee's salary in the EMPLOYEE table:
+
+[source, java]
+----
+public class Payroll
+{
+   public static void adjustSalary( BigDecimal empNum
+                                  , double percent
+                                  , BigDecimal[] newSalary
+                                  ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement setSalary =
+         conn.prepareStatement( "UPDATE demo.persnl.employee "
+                              + "SET salary = salary * (1 + (? / 100)) "
+                              + "WHERE empnum = ?"
+                              ) ;
+ 
+      PreparedStatement getSalary =
+         conn.prepareStatement( "SELECT salary "
+                              + "FROM demo.persnl.employee "
+                              + "WHERE empnum = ?"
+                              ) ;
+
+      setSalary.setDouble( 1, percent ) ;
+      setSalary.setBigDecimal( 2, empNum ) ;
+      setSalary.executeUpdate() ;
+
+      getSalary.setBigDecimal( 1, empNum ) ;
+      ResultSet rs = getSalary.executeQuery() ;
+      rs.next() ;
+
+      newSalary[0] = rs.getBigDecimal( 1 ) ;
+
+      rs.close();
+      conn.close();
+   }
+}
+----
+
+For other examples of SPJ methods, see <<sample-spjs, Appendix A: Sample SPJs>>.
+
+[[referring-to-database-objects-in-an-spj-method]]
+=== Referring to Database Objects in an SPJ Method
+
+In an SPJ method, you can refer to SQL database objects by specifying
+three-part ANSI names that include the catalog, schema, and object name.
+For more information about database object names, see the
+http://trafodion.incubator.apache.org/docs/sql_reference/index.hmtl[Trafodion SQL Reference Manual].
+
+The database engine propagates the names of the catalog and schema where
+the SPJ is registered to the SPJ environment. By default, database
+connections created in the SPJ method are associated with that catalog
+and schema, meaning that unqualified database objects with one-part or
+two-part names in the SPJ method are qualified with the same catalog
+and/or schema name as the SPJ. For example, this SPJ method, which is
+registered as an SPJ in the DEMO.SALES schema, refers to the unqualified
+database object, ORDERS:
+
+[source, java]
+----
+public static void numDailyOrders( Date date
+                                 , int[] numOrders
+				 ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getNumOrders =
+      conn.prepareStatement( "SELECT COUNT( order_date ) "
+                           + "FROM orders "
+			   + "WHERE order_date = ?"
+			   ) ;
+
+   getNumOrders.setDate( 1, date ) ;
+
+   ResultSet rs = getNumOrders.executeQuery() ;
+   rs.next() ;
+
+   numOrders[0] = rs.getInt( 1 ) ;
+
+   rs.close() ;
+   conn.close() ;
+
+}
+----
+
+In the SPJ environment, the ORDERS table is qualified by default with
+the same catalog and schema as the SPJ, DEMO.SALES.
+
+The default behavior takes effect only when `getConnection()` does not
+contain catalog and schema properties. Catalog and schema property
+values in `getConnection()` have higher precedence over the default
+behavior. To override the default schema name and associate a database
+connection with a different schema, specify the schema property during
+connection creation. For example, `getConnection()` in this SPJ method
+specifies the schema, SALES2, which overrides the default schema, SALES:
+
+[source, java]
+----
+public static void numDailyOrders( Date date
+                                 , int[] numOrders
+				 ) throws SQLException
+{
+   Properties prop = new Properties() ;
+   prop.setProperty( "schema", "SALES2" ) ;
+
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection", prop) ;
+
+   PreparedStatement getNumOrders =
+      conn.prepareStatement( "SELECT COUNT( order_date ) "
+                           + "FROM orders "
+			   + "WHERE order_date = ?"
+			   ) ;
+
+   getNumOrders.setDate( 1, date ) ;
+
+   ResultSet rs = getNumOrders.executeQuery() ;
+   rs.next() ;
+
+   numOrders[0] = rs.getInt( 1 ) ;
+
+   rs.close() ;
+   conn.close() ;
+
+}
+----
+
+Be aware that overriding the default values by using getConnection()
+requires you to hard-code the catalog or schema name and might make SPJ
+methods less portable across systems.
+
+[[using-the-session_user-or-current_user-function-in-an-spj-method]]
+=== Using the SESSION_USER or CURRENT_USER Function in an SPJ Method
+
+SESSION_USER is an SQL function that returns the name of the
+authenticated database user who started the session and invoked the
+function, and CURRENT_USER (or USER) is an SQL function that returns the
+name of the database user who is authorized to invoke the function. If
+you plan to use the SESSION_USER or CURRENT_USER (or USER) function in
+an SPJ method, you should be aware of differences in their behavior
+depending on how extenal security is defined for the stored procedure.
+
+Suppose that you write this Java method, which uses the CURRENT_USER
+function to return the name of the database user who is authorized to
+invoke the function:
+
+[source, java]
+----
+public static void getUser( ResultSet [] rs ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   Statement stmt = conn.createStatement() ;
+
+   rs[0] =
+      stmt.executeQuery( "SELECT CURRENT_USER FROM (VALUES(1)) X(A) ; " ) ;
+}
+----
+
+If this method is used in a stored procedure with external security
+defined as _invoker_, the CURRENT_USER function returns the name of
+the database user who is authorized to invoke the function, which
+happens to be the authenticated database user who started the session
+and called the stored procedure.
+
+For example, suppose that DB USERADMINUSER creates a stored procedure
+named GETINVOKER using the `getUser()` method and sets the external
+security to invoker. If a database user named PAULLOW1, who has the
+EXECUTE privilege on the stored procedure, calls GETINVOKER, the procedure
+returns his name:
+
+```
+Welcome to Apache Trafodion Command Interface
+Copyright (c) 2015 Apache Software Foundation
+
+User Name:PAULLOW1 Password:
+
+Connected to Data Source: TDM_Default_DataSource
+
+SQL> CALL demo.persnl.getinvoker() ;
+
+(EXPR)
+--------------------------------------------------------------------------------
+PAULLOW1
+
+--- 1 row(s) selected.
+
+--- SQL operation complete.
+```
+
+If the method is used in a stored procedure with external security
+defined as _definer_, the CURRENT_USER function returns the name of
+the database user who is authorized to invoke the function, which
+happens to be the user who created the stored procedure (that is, the
+definer of the stored procedure). When a stored procedure's external
+security is set to definer, any user who has the execute privilege on
+the stored procedure can call the procedure using the privileges of the
+user who created the stored procedure.
+
+For example, suppose that DB USERADMINUSER creates a stored procedure
+named GETDEFINER using the `getUser(`) method and sets the external
+security to definer. If the database user named PAULLOW1, who has the
+EXECUTE privilege on the stored procedure, calls GETDEFINER, the procedure
+returns the name of the stored procedures's creator, DB USERADMINUSER,
+whose privileges PAULLOW1 is using to call the procedure:
+
+```
+SQL> SHOW USER
+
+USER PAULLOW1 (NONE)
+
+SQL> CALL demo.persnl.getdefiner() ;
+
+(EXPR)
+--------------------------------------------------------------------------------
+DB USERADMINUSER
+
+--- 1 row(s) selected.
+
+--- SQL operation complete.
+```
+
+Suppose that you write this Java method, which uses the SESSION_USER
+function to return the name of the authenticated database user who
+started the session and invoked the function:
+
+[source, java]
+----
+public static void getSessionUser( ResultSet [] rs ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   Statement stmt = conn.createStatement() ;
+
+   rs[0] = stmt.executeQuery( "SELECT SESSION_USER FROM (VALUES(1) ) X(A) ; " ) ;
+}
+----
+
+The SESSION_USER function returns the name of the authenticated database
+user who started the session and invoked the function, regardless of the
+external security setting of the stored procedure.
+
+For example, suppose that DB USERADMINUSER creates a stored procedure named
+GETSESSIONUSER using the `getSessionUser()` method and sets the external
+security to definer. If the database user named PAULLOW1, who has the EXECUTE
+privilege on the stored procedure, calls GETSESSIONUSER, the procedure
+returns his name because he is the authenticated user who started the
+session and invoked the function:
+
+```
+SQL> SHOW USER
+
+USER PAULLOW1 (NONE)
+
+SQL> CALL demo.persnl.getsessionuser() ;
+
+(EXPR)
+--------------------------------------------------------------------------------
+PAULLOW1
+
+--- 1 row(s) selected.
+
+--- SQL operation complete.
+```
+
+For more information about external security, see
+<<understand-external-security, Understand External Security>>.
+
+[[exception-handling]]
+=== Exception Handling
+
+For SPJ methods that access a Trafodion database, no special code is
+necessary for handling exceptions. If an SQL operation fails inside an
+SPJ, the error message associated with the failure is returned to the
+application that issues the CALL statement.
+
+[[handling-java-exceptions]]
+== Handling Java Exceptions
+
+If an SPJ method returns an uncaught Java exception or an uncaught chain
+of `java.sql.SQLException` objects, the database engine converts each Java
+exception object into an SQL error condition, and the CALL statement
+fails. Each SQL error condition contains the message text associated
+with one Java exception object.
+
+If an SPJ method catches and handles exceptions itself, those exceptions
+do not affect SQL processing.
+
+[[user-defined-exceptions]]
+=== User-Defined Exceptions
+
+The SQLSTATE values 38001 to 38999 are reserved for you to define your
+own error conditions that SPJ methods can return. By coding your SPJ
+method to throw a `java.sql.SQLException` object, you cause the CALL
+statement to fail with a specific user-defined SQLSTATE value and your
+own error message text.
+
+If you define the SQLSTATE to be outside the range of 38001 to 38999,
+the database engine raises SQLSTATE 39001, external routine invocation
+exception.
+
+This example uses the throw statement in the SPJ method named
+`numMonthlyOrders()` to raise a user-defined error condition when an
+invalid argument value is entered for the month:
+
+[source, java]
+----
+public static void numMonthlyOrders( int month
+                                   , int[] numOrders
+				   ) throws java.sql.SQLException
+{
+   if ( month < 1 || month > 12 )
+   {
+      throw new
+         java.sql.SQLException ( "Invalid value for month. "
+                               + "Retry the CALL statement using a number "
+                               + "from 1 to 12 to represent the month."
+			       , "38001"
+			       ) ;
+   }
+
+   ....
+}
+----
+
+For more information about the numMonthlyOrders() method, see the
+<<monthlyorders-procedure, MONTHLYORDERS Procedure>>.
+
+For information about specific SQL errors, see the
+http://trafodion.incubator.apache.org/docs/messages_guide/index.html[Trafodion Messages Manual], which lists
+the SQLCODE, SQLSTATE, message text, and cause-effect-recovery information for all SQL errors.
+
+[[compiling-and-packaging-java-classes]]
+== Compiling and Packaging Java Classes
+
+On the Trafodion database, the class files of SPJ methods must be
+packaged in Java archive (JAR) files. After writing an SPJ method,
+compile the Java source file of the SPJ method into Java bytecode and
+package the Java bytecode in a JAR file. A Java method that you register
+as an SPJ might need to access, either directly or indirectly, other
+Java classes to operate properly. Those Java classes might include other
+application classes. To enable an SPJ method to refer to other
+application classes, put the application classes in the same JAR file as
+the SPJ class. All classes stored in the same JAR file as the SPJ class
+are accessible by default to the SPJ method.
+
+.After writing the SPJ method
+
+1.  Compile the Java source file into Java bytecode by using the Java
+programming language compiler, `javac`:
++
+```
+javac Payroll.java
+```
+
+2.  Put the SPJ class file and all associated class files into a Java
+archive (JAR) file:
++
+```
+jar cvf Payroll.jar Payroll.class
+```
++
+A manifest file is not needed for the JAR file.
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
new file mode 100644
index 0000000..a2557c9
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
@@ -0,0 +1,730 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[execute-spjs]]
+= Execute SPJs
+
+This chapter describes how to execute SPJs by using the CALL statement
+and assumes that you have already registered the SPJs in the Trafodion
+database and that you have granted privileges to execute the SPJs to the
+appropriate database users. For information, see
+<<deploy-spj-jar-files, Deploy SPJ JAR Files>>
+and <<create-spjs, Create SPJs>>.
+
+This chapter covers these topics:
+
+* <<required-privileges-for-calling-an-spj, Required Privileges for Calling an SPJ>>
+* <<transaction-behavior, Transaction Behavior>>
+* <<multithreading, Multithreading>>
+* <<using-the-call-statement, Using the CALL Statement>>
+* <<calling-spjs-in-trafci, Calling SPJs in trafci>>
+* <<calling-spjs-from-an-odbc-client-application, Calling SPJs From an ODBC Client Application>>
+* <<calling-spjs-from-a-jdbc-client-application, Calling SPJs From a JDBC Client Application>>
+* <<calling-an-spj-in-a-trigger, Calling an SPJ in a Trigger>>
+
+The CALL statement invokes an SPJ in the database. You can issue a CALL
+statement from any of these applications or interfaces supported by the
+Trafodion platform:
+
+* trafci command-line interface or script file
+* JDBC Type-4 client applications
+* ODBC client applications
+
+You can use a CALL statement as a stand-alone SQL statement in
+applications or in command-line interfaces, such as trafci. You can also
+use a CALL statement in a trigger but not inside a compound statement or
+with rowsets. The SPJ that you use in a trigger must not have any OUT or
+INOUT parameters or return any result sets.
+
+== Required Privileges for Calling an SPJ
+
+To execute the CALL statement, you must have the EXECUTE privilege on
+the procedure. For more information, see
+<<grant-privileges, Grant Privileges>>.
+
+== Transaction Behavior
+
+The stored procedure's transaction attribute determines whether it
+inherits the transaction from the calling application (TRANSACTION
+REQUIRED) or whether it runs without inheriting the calling
+application's transaction (NO TRANSACTION REQUIRED). The transaction
+attribute is set during the creation of the stored procedure. For more
+information, see the Transaction Required attribute in
+<<create-a-procedure, Create a Procedure>>.
+
+Typically, you want the stored procedure to inherit the transaction
+from the calling application. See <<transaction-required, Transaction Required>>.
+However, if the SPJ method does not access the database or if you want the
+stored procedure to manage its own transactions, you should set the stored
+procedure's transaction attribute to NO TRANSACTION REQUIRED.
+See <<no-transaction-required>>.
+
+=== Transaction Required
+
+If you want the SPJ method to inherit the transaction from the calling
+application, set the stored procedure's transaction attribute to
+TRANSACTION REQUIRED (the default setting) when creating the stored
+procedure. For more information, see the Transaction Required attribute
+in link:#_bookmark116["Create a]
+link:#_bookmark116[Procedure" (page 37)]. When a stored procedure's
+transaction attribute is TRANSACTION REQUIRED, a CALL statement
+automatically initiates a transaction if there is no active transaction.
+
+==== Using Transaction Control Statements or Methods
+
+If you select Yes for the Transaction Required attribute when creating a
+stored procedure, you should not use transaction control statements (or
+equivalent JDBC transaction methods) in the SPJ method. Transaction
+control statements include COMMIT WORK and ROLLBACK WORK, and the
+equivalent JDBC transaction methods are Connection.commit() and
+Connection.rollback(). If you try to use transaction control statements
+or methods in an SPJ method when the stored procedure's transaction
+attribute is set to TRANSACTION REQUIRED, the transaction control
+statements or methods in the SPJ method are ignored, and the Java
+virtual machine (JVM) does not report any errors or warnings. When the
+stored procedure's transaction attribute is set to TRANSACTION REQUIRED,
+you should rely on the transaction control statements or methods in the
+application that calls the stored procedure and allow the calling
+application to manage the transactions.
+
+===== Committing or Rolling Back a Transaction
+
+If you do not use transaction control statements in the calling
+application, the transaction initiated by the CALL statement might not
+automatically commit or roll back changes to the database. When
+AUTOCOMMIT is ON (the default setting), the database engine
+automatically commits or rolls back any changes made to the database at
+the end of the CALL statement execution. However, when AUTOCOMMIT is
+OFF, the current transaction remains active until the end of the client
+session or until you explicitly commit or roll back the transaction.
+
+To ensure an atomic unit of work when calling an SPJ, use the COMMIT
+WORK statement in the calling application to commit the transaction when
+the CALL statement succeeds, and use the ROLLBACK WORK statement to roll
+back the transaction when the CALL statement fails. For more information
+about transaction management, see the __Trafodion SQL Reference Manual__.
+
+=== No Transaction Required
+
+In some cases, you might not want the SPJ method to inherit the
+transaction from the calling application. Instead, you might want the
+stored procedure to manage its own transactions or to run without a
+transaction. Not inheriting the calling application's transaction is
+useful in these cases:
+
+* The stored procedure performs several long-running operations, such as
+multiple DDL or table maintenance operations, on the database. In this
+case, you might want to commit those operations periodically from within
+the SPJ method to avoid locking tables for a long time.
+* The stored procedure performs certain SQL operations that must run
+without an active transaction. For example, INSERT, UPDATE, and DELETE
+statements with the WITH NO ROLLBACK option are rejected when a
+transaction is already active, as is the case when a stored procedure
+inherits a transaction from the calling application. The PURGEDATA
+utility is also rejected when a transaction is already active.
+* The stored procedure does not access the database. (For an example,
+see the link:#_bookmark250["TOTALPRICE] link:#_bookmark250[Procedure"
+(page 73)].) In this case, the stored procedure does not need to inherit
+the transaction from the calling application. By setting the stored
+procedure's transaction attribute to NO TRANSACTION REQUIRED, you can
+avoid the overhead of the calling application's transaction being
+propagated to the stored procedure.
+
+In these cases, you should set the stored procedure's transaction
+attribute to NO TRANSACTION REQUIRED when creating the stored procedure.
+For more information, see the Transaction Required attribute in
+link:#_bookmark116["Create a Procedure" (page 37)].
+
+If you select No for the Transaction Required attribute when creating a
+stored procedure and if the SPJ method creates a JDBC default
+connection, that connection will have autocommit enabled by default. You
+can either use the autocommit transactions or disable autocommit
+(conn.setAutoCommit(false);) and use the JDBC transaction methods,
+Connection.commit() and Connection.rollback(), to commit or roll back
+work where needed.
+
+== Multithreading
+
+The Trafodion database engine manages a single thread of execution within
+an SPJ environment, even if the application that issues a CALL statement
+is a multithreaded Java application. The CALL statements in a
+multithreaded application can execute in a nonblocking manner, but the
+SPJ methods underlying those CALL statements execute serially within a
+given SPJ environment.
+
+== Using the CALL Statement
+
+To invoke a stored procedure, specify the name of the stored procedure
+and its arguments in a CALL statement, as shown in
+link:#_bookmark167[Figure 2]:
+
+image:media/image8.png[image]Figure 2 CALL Statement Elements
+
+For the syntax of the CALL statement, see the __Trafodion SQL Reference
+Manual__.
+
+=== Specifying the Name of the SPJ
+
+In the CALL statement, specify the name of an SPJ that you have already
+created in the database. Qualify the procedure name with the same
+catalog and schema that you specified when you registered the SPJ. For
+example:
+
+```
+CALL demo.persnl.adjustsalary(202, 5.5, ?);
+```
+
+Or, for example:
+
+```
+SET SCHEMA demo.persnl;
+
+CALL adjustsalary(202, 5.5, ?);
+```
+
+If you do not fully qualify the procedure name, the database engine
+qualifies the procedure according to the catalog and schema of the
+current session.
+
+=== Listing the Parameter Arguments of the SPJ
+
+Each argument that you list in the CALL statement must correspond to an
+SQL parameter of the SPJ. A result set in the Java signature of the SPJ
+method does not correspond to an SQL parameter. Do not specify result
+sets in the argument list.
+
+For example, if you registered the stored procedure with three SQL
+parameters (two IN parameters and one OUT parameter), you must list
+three formal parameter arguments, separated by commas, in the CALL
+statement:
+
+```
+CALL demo.persnl.adjustsalary(202, 5, ?);
+```
+
+If the SPJ does not accept arguments, you must specify empty
+parentheses, as shown below:
+
+```
+CALL demo.sales.lowerprice();
+```
+
+If the SPJ has one IN parameter, one OUT parameter, and two result sets,
+you must list the IN and OUT parameters but not the result sets in the
+argument list:
+
+```
+CALL demo.sales.ordersummary('01-01-2011', ?);
+```
+
+==== Data Conversion of Parameter Arguments
+
+The database engine performs an implicit data conversion when the data
+type of a parameter argument is compatible with but does not match the
+formal data type of the stored procedure. For stored procedure input
+values, the conversion is from the actual argument value to the formal
+parameter type. For stored procedure output values, the conversion is
+from the actual output value, which has the data type of the formal
+parameter, to the declared type of the dynamic parameter.
+
+==== Input Parameter Arguments
+
+To pass data to an IN or INOUT parameter of an SPJ, specify an SQL value
+expression that evaluates to a character, date-time, or numeric value.
+The SQL value expression can evaluate to NULL provided that the
+underlying Java parameter supports null values. For more information,
+see link:#_bookmark58["Null Input and Output" (page 22)].
+
+For an IN parameter argument, use one of these SQL value expressions in
+link:#_bookmark175[Table 2]:
+
+Table 2 Input Parameter Argument Types
+
+Type of Argument Examples
+
+Literal
+
+CALL adjustsalary(**202**, 5.5, ?);
+
+CALL dailyorders(**DATE '2011-03-19**', ?); CALL totalprice(23,
+*'nextday'* , ?param);
+
+SQL function (including CASE and CAST expressions)
+
+CALL dailyorders(**CURRENT_DATE**, ?);
+
+Arithmetic expression CALL adjustsalary(202, **?percent * 0.25**, :OUT
+newsalary);
+
+Concatenation operation
+
+CALL totalprice(23, **'next' || 'day'**, ?param);
+
+Scalar subquery
+
+Dynamic parameter
+
+CALL totalprice(**(SELECT qty_ordered**
+
+*FROM odetail*
+
+**WHERE ordernum = 100210 AND partnum = 5100)**,
+
+'nextday', ?param);
+
+CALL adjustsalary(**?**, ?, ?);
+
+CALL adjustsalary(**?param1**, ?param2, ?param3);
+
+For more information about SQL value expressions, see the __Trafodion SQL
+Reference Manual__.
+
+Because an INOUT parameter passes a single value to and accepts a single
+value from an SPJ, you can specify only dynamic parameters for INOUT
+parameter arguments in a CALL statement.
+
+==== Output Parameter Arguments
+
+Except for result sets, an SPJ returns values in OUT and INOUT
+parameters. Each OUT or INOUT parameter accepts only one value from an
+SPJ. Any attempt to return more than one value to an output parameter
+results in a Java exception. See link:#_bookmark48["Returning Output
+Values From the Java Method"] link:#_bookmark48[(page 19)].
+
+OUT and INOUT parameter arguments must be dynamic parameters in a client
+application (for example, ?) or named or unnamed parameters in trafci
+(for example, ?param or ?).
+
+For information about how to call SPJs in different applications, see:
+
+* link:#_bookmark188["Calling SPJs in trafci" (page 53)]
+* link:#_bookmark196["Calling SPJs From an ODBC Client Application"
+(page 54)]
+* link:#_bookmark200["Calling SPJs From a JDBC Client Application" (page
+56)]
+
+==== Result Sets
+
+Result sets are an ordered set of open cursors that the SPJ method
+returns to the calling application in java.sql.ResultSet[] parameter
+arrays. The java.sql.ResultSet[] parameters do not correspond to SQL
+parameters, so you must not include them in the parameter argument list
+of a CALL statement.
+
+The calling application can retrieve multiple rows of data from the
+java.sql.ResultSet[]
+parameters. For information about how to process result sets in
+different applications, see:
+
+* link:#_bookmark194["Returning Result Sets in trafci" (page 54)]
+* link:#_bookmark198["Returning Result Sets in an ODBC Client
+Application" (page 55)]
+* link:#_bookmark204["Returning Result Sets in a JDBC Client
+Application" (page 56)]
+
+== Calling SPJs in trafci
+
+In trafci, you can invoke an SPJ by issuing a CALL statement directly or
+by preparing and executing a CALL statement.
+
+Use named or unnamed parameters anywhere in the argument list of an SPJ
+invoked in trafci. A named parameter is set by the SET PARAM command, and
+an unnamed parameter is set by the USING clause of the EXECUTE
+statement.
+
+You must use a parameter for an OUT or INOUT parameter argument. trafci
+displays all output parameter values and result sets after you issue the
+CALL statement. The procedure call changes the value of a named
+parameter that you use as an OUT or INOUT parameter.
+
+For more information about named and unnamed parameters, see the _HP
+Database Command_ __Interface (trafci) Guide__.
+
+=== Using Named Parameters
+
+In an trafci session, invoke the SPJ named TOTALPRICE, which has two IN
+parameters and one INOUT parameter. This SPJ accepts the quantity,
+shipping speed, and price of an item, calculates the total price,
+including tax and shipping charges, and returns the total price. For
+more information, see the link:#_bookmark250["TOTALPRICE Procedure"
+(page 73)].
+
+Set the input value for the INOUT parameter by entering a SET PARAM
+command before calling the SPJ:
+
+```
+SQL>**set param ?p 10;**
+
+SQL>**call demo.sales.totalprice(23, 'standard', ?p);**
+```
+
+The CALL statement returns the total price of the item:
+
+```
+p
+--------------------
+253.97
+
+--- SQL operation complete.
+```
+
+The value of the named parameter, ?p, changes from 10 to the returned
+value, 253.97:
+
+```
+SQL>**show param**
+
+p 253.97
+```
+
+=== Using Unnamed Parameters
+
+In an trafci session, invoke the SPJ named TOTALPRICE by preparing and
+executing a CALL statement. The INOUT parameter accepts a value that is
+set by the USING clause of the EXECUTE statement and returns the total
+price:
+
+```
+SQL>**prepare stmt1 from call demo.sales.totalprice(50, 'nextday',?);**
+
+--- SQL command prepared.
+
+SQL>**execute stmt1 using 2.25;**
+```
+
+The output of the prepared CALL statement is:
+
+```
+PRICE
+--------------------
+136.77
+
+--- SQL operation complete.
+```
+
+In an trafci session, invoke the SPJ named TOTALPRICE again by preparing
+and executing a CALL statement in which all three parameters accept
+values that are set by the USING clause of the EXECUTE statement. The
+INOUT parameter returns the total price:
+
+```
+SQL>**prepare stmt2 from call demo.sales.totalprice(?,?,?);**
+
+--- SQL command prepared.
+
+SQL>**execute stmt2 using 3, 'economy', 16.99;**
+```
+
+The output of the prepared CALL statement is:
+
+```
+PRICE
+--------------------
+
+57.13
+
+--- SQL operation complete.
+```
+
+=== Returning Result Sets in trafci
+
+If a CALL statement returns result sets, trafci displays column headings
+and data for each returned result set in the same format as SELECT
+statements. For example, this CALL statement returns an output parameter
+for the number of orders and two result sets in the trafci session:
+
+```
+SQL>**call demo.sales.ordersummary('01-01-2011', ?);**
+
+NUM_ORDERS
+--------------------
+13
+
+ORDERNUM NUM_PARTS            AMOUNT               ORDER_DATE LAST_NAME 
+-------- -------------------- -------------------- ---------- --------------------
+HUGHES HUGHES SCHNABL
+
+...
+
+--- 13 row(s) selected.
+
+ORDERNUM PARTNUM UNIT_PRICE QTY_ORDERED PARTDESC
+
+-------- ------- ---------- ----------- ------------------ 100210 244
+3500.00 3 PC GOLD, 30 MB
+
+100210 2001 1100.00 3 GRAPHIC PRINTER,M1
+
+100210 2403 620.00 6 DAISY PRINTER,T2
+
+... ... ... ... ...
+
+--- 70 row(s) selected.
+
+--- SQL operation complete.
+```
+
+For other result set examples, see link:#_bookmark221[Appendix A (page
+62)].
+
+== Calling SPJs From an ODBC Client Application
+
+You can execute a CALL statement in an ODBC client application.
+Microsoft ODBC requires that you put the CALL statement in an escape
+clause:
+
+```
+{call _procedure-name_ ([__parameter__][,[__parameter__]]...)}
+```
+
+For IN or INOUT parameters, use a literal or a parameter marker (?). You
+cannot use an empty string as an IN or INOUT parameter in the argument
+list. If you specify a literal for an INOUT parameter, the driver
+discards the output value.
+
+For OUT parameters, you can use only a parameter marker (?). You must
+bind all parameter markers with the SQLBindParameter function before you
+can execute the CALL statement.
+
+In this example, a CALL statement is executed from an ODBC client
+application:
+
+```
+/* Declare variables. */
+SQLHSTMT hstmt; SQL_NUMERIC_STRUCT salary; SDWORD cbParam = SQL_NTS;
+
+/* Bind the parameter markers. */
+
+SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_NUMERIC, SQL_NUMERIC, 4, 0, 202, 0, &cbParam);
+
+SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_FLOAT, SQL_FLOAT, 0, 0, 5.5, 0, &cbParam);
+
+SQLBindParameter(hstmt, 3, SQL_PARAM_OUTPUT, SQL_C_NUMERIC, SQL_NUMERIC, 8, 2, &salary, 0, &cbParam);
+
+/* Execute the CALL statement. */
+
+SQLExecDirect(hstmt, "{call demo.persnl.adjustsalary(?,?,?)}", SQL_NTS);
+```
+
+For more information about ODBC client applications, see the __Neoview
+ODBC Drivers Manual__.
+
+=== Returning Result Sets in an ODBC Client Application
+
+This example shows how an ODBC client application processes the result
+sets returned by a CALL statement. The SQLMoreResults() function closes
+the current result set and moves processing to the next available result
+set.
+
+NOTE: The HP ODBC API does not currently support interleaved result set
+processing, where more than one returned result set can be open at a
+time.
+
+```
+/* Allocate a statement handle */
+SQLHSTMT s;
+
+RETCODE rc = SQLAllocHandle(SQL_HANDLE_STMT, myConnection, &s);
+
+/* Prepare a CALL */
+char *stmtText = "{call demo.sales.ordersummary('01-01-2011', ?)}";
+rc = SQLPrepare(s, (SQLCHAR *) stmtText, strlen(stmtText));
+
+/* Bind the output parameter */
+_int64 num_orders = 0; SQLINTEGER indicator;
+
+rc = SQLBindParameter(s, 2, SQL_PARAM_OUTPUT, SQL_C_SBIGINT, SQL_BIGINT, 0, 0, &num_orders, 0, &indicator);
+
+/* Execute the CALL */
+rc = SQLExecute(s);
+
+/* Process all returned result sets. The outer while loop repeats */
+
+/* until there are no more result sets. */
+while ((rc = SQLMoreResults(s)) != SQL_NO_DATA)
+{
+  /* The inner while loop processes each row of the current result set */
+  while (SQL_SUCCEEDED(rc = SQLFetch(hStmt)))
+  {
+    /* Process the row */
+  }
+}
+
+== Calling SPJs From a JDBC Client Application
+
+You can execute a CALL statement in a JDBC client application by using
+the JDBC CallableStatement interface. The HP JDBC Type 4 driver requires
+that you put the CALL statement in an escape clause:
+
+```
+{call _procedure-name_ ([__parameter__[{, __parameter__}...]])}
+```
+
+Set input values for IN and INOUT parameters by using the set__type__()
+methods of the CallableStatement interface.
+
+Retrieve output values from OUT and INOUT parameters by using the
+get__type__() methods of the CallableStatement interface.
+
+If the parameter mode is OUT or INOUT, you must register the parameter
+as an output parameter by using the registerOutParameter() method of the
+CallableStatement interface before executing the CALL statement.
+
+In this example, a CALL statement is executed from a JDBC client application:
+
+```
+CallableStatement stmt =
+
+con.prepareCall("{call demo.persnl.adjustsalary(?,?,?)}");
+
+stmt.setBigDecimal(1,202); // x = 202 stmt.setDouble(2,5.5); // y = 5.5
+stmt.registerOutParameter(3, java.sql.Types.NUMERIC);
+
+stmt.execute();
+
+BigDecimal z = stmt.getBigDecimal(3); // Retrieve the value of the
+// OUT parameter
+```
+For more information about the HP JDBC Type 4 driver and mappings of SQL
+to JDBC data types, see the __Neoview JDBC Type 4 Driver Programmer's
+Reference__.
+
+=== Returning Result Sets in a JDBC Client Application
+
+This example shows serial result set processing in a JDBC client
+application where the result sets are processed in order and one at a
+time after the CALL statement executes. The
+java.sql.Statement.getMoreResults() method closes the current result set
+and moves processing to the next available result set.
+
+```
+// Prepare a CALL statement
+
+java.sql.CallableStatement s = myConnection.prepareCall ( "{call
+demo.sales.ordersummary('01-01-2011', ?)}" );
+
+// Register an output parameter s.registerOutParameter(1,
+java.sql.Types.BIGINT);
+
+// Execute the CALL
+
+boolean rsAvailable = s.execute();
+
+// Process all returned result sets. The outer while loop continues
+
+// until there are no more result sets. while (rsAvailable)
+
+{
+
+// The inner while loop processes each row of the current result set
+java.sql.ResultSet rs = s.getResultSet();
+
+while (rs.next())
+
+{
+
+// Process the row
+
+}
+
+rsAvailable = s.getMoreResults();
+
+}
+```
+
+This example shows how a JDBC client application can have more than one
+stored procedure result set open at a given time. The
+`java.sql.Statement.getMoreResults(int)` method
+uses its input argument to decide whether currently open result sets
+should remain open or be closed before the next result set is made
+available.
+
+```
+// Prepare a CALL statement
+
+java.sql.CallableStatement s = myConnection.prepareCall ( "{call
+demo.sales.ordersummary('01-01-2011', ?)}" );
+
+// Register an output parameter s.registerOutParameter(1,
+java.sql.Types.BIGINT);
+
+// Execute the CALL s.execute();
+
+// Open the FIRST result set java.sql.ResultSet firstRS =
+s.getResultSet();
+
+// Open the SECOND result set but do not close the FIRST
+s.getMoreResults(java.sql.Statement.KEEP_CURRENT_RESULT);
+java.sql.ResultSet secondRS = s.getResultSet();
+
+// The outer loop processes each row of the FIRST result set while
+(firstRS.next())
+
+{
+
+// Process a row from the FIRST result set
+// The inner loop processes some number of rows from the SECOND
+// result set. The number depends on data extracted from the
+// current row of the FIRST result set.
+
+for (int i = 0; i < NUM_ROWS_TO_PROCESS; i++)
+
+{
+
+// Process a row from the SECOND result set secondRS.next();
+
+}
+
+}
+```
+
+== Calling an SPJ in a Trigger
+
+A trigger is a mechanism in the database that enables the database
+engine to perform certain actions when a specified event occurs. SPJs
+are useful as triggered actions because they can help you encapsulate
+and enforce rules in the database. For more information about the
+benefits of using SPJs, see link:#_bookmark11["Benefits of SPJs" (page
+11)].
+
+Trafodion SQL supports a CALL statement in a trigger provided that the
+SPJ in the CALL statement does not have any OUT or INOUT parameters or
+return any result sets. For more information, see
+link:#_bookmark48["Returning Output Values From the Java Method" (page
+19)], link:#_bookmark183["Output Parameter Arguments"]
+link:#_bookmark183[(page 52)], or link:#_bookmark54["Returning Stored
+Procedure Result Sets" (page 20)].
+
+This example creates a trigger that executes an SPJ named LOWERPRICE
+when the QTY_ON_HAND column of the PARTLOC table is updated and exceeds
+500 parts:
+
+```
+CREATE TRIGGER demo.sales.setsalesprice AFTER UPDATE OF qty_on_hand
+ON demo.invent.partloc FOR EACH STATEMENT
+REFERENCING NEW as newqty
+WHEN ( SUM(newqty.qty_on_hand) > 500 ) CALL demo.sales.lowerprice();
+```
+
+For information about the CREATE TRIGGER syntax, see the __Trafodion SQL
+Reference Manual__.
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc b/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
new file mode 100644
index 0000000..647ed54
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
@@ -0,0 +1,121 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[get-started]]
+= Get Started
+
+Before you can start using SPJs on the Trafodion platform, verify that
+you have the required software installed on the client workstation. The
+Trafodion platform is delivered to you ready to use and preconfigured
+with the software required to support SPJs.
+
+[[required-client-software]]
+== Required Client Software
+
+[[java-development-kit]]
+=== Java Development Kit
+
+To develop Java methods to be used as SPJs, you must have a Java
+Development Kit (JDK) installed on the client workstation. To download a
+JDK, go to
+http://www.oracle.com/technetwork/java/index.html
+
+The version of the JDK that you download and use on the client
+workstation should be the same as or lower than the Java version running
+on the Trafodion database. To check the Java version that is running in
+the Trafodion database, use one of these approaches:
+
+* Run `sqvers` in the `RUN_SCRIPT` stored procedure from `trafci`:
++
+```
+SQL> CALL demo.hp_sp.run_script( 'sqvers', '', '', ? ) ;
+
+OUTRESULT
+------------------------------------------------------------
+Requesting user: DB ROOT
+Current time: 2013-05-22 04:44:16.00
+Location of script: /opt/hp/sqtest4/M9V29713/export/bin64
+Results are stored in table: "sqvers@2013-05-22@04:44:16.00"
+Command executed: sqvers
+
+RESULTS
+----------------------------------
+
+MY_SQROOT=/opt/hp/sqtest4/M9V29713
+who@host=sqtest4@n013
+JAVA_HOME=/usr/java/jdk1.7.0_09
+
+--- 3 row(s) selected.
+
+--- SQL operation complete.
+
+SQL>
+```
++
+In this example, the returned `JAVA_HOME` indicates that the Trafodion
+database supports Java SE 7 or JDK 7 (1.7.0), or earlier versions of the
+JDK.
+
+* Launch `trafci` on the Trafodion platform, and run the `LOCALHOST` or `LH java -version` command.
+(To use the on-platform trafci client, see the
+http://trafodion.apache.org/docs/command_interface/index.html[Trafodion Command Interface Guide.)
+For example:
++
+```
+SQL> lh java -version
+
+java version "1.6.0_06"
+Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
+Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode)
+
+SQL>
+```
++
+In this example, the returned Java version indicates that the Trafodion
+instance supports Java SE 6 or JDK 6 (1.6.0), or earlier versions of the
+JDK.
+
+NOTE: If you plan to install the Trafodion JDBC Type-4 Driver on the client
+workstation, you must have JDK 6 (1.6.0) or higher installed on the
+client workstation.
+
+[[recommended-client-software]]
+== Recommended Client Software
+
+[[trafodion-command-interface-trafci]]
+=== Trafodion Command Interface (trafci)
+
+`trafci` is a command-line interface in which you can run SQL statements,
+such as GRANT PROCEDURE and CALL statements, interactively or from
+script files. To install `trafci` on a client workstation, see the
+http://trafodion.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide].
+
+[[hp-jdbc-type-4-driver]]
+=== HP JDBC Type 4 Driver
+
+If you plan to use `trafci`, you must have a compatible version of the Trafodion
+JDBC Type-4 Driver installed on the client workstation.
+
+To install the JDBC Type-4 driver on the client workstation, see the 
+http://trafodion.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide].
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc b/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
new file mode 100644
index 0000000..9ff668c
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
@@ -0,0 +1,312 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[grant-privileges]]
+== Grant Privileges
+
+Security for SPJs is implemented by schema ownership rules and by
+granting privileges to specified database users and roles.
+
+The schema in which an SPJ is registered is the unit of ownership. The
+database user who creates the schema is the owner of that schema and all
+objects associated with it. In a Trafodion database, the schema owner
+automatically has these privileges:
+
+* Ability to create and drop SPJs in the schema. You can create SPJs in
+the schema provided that you also have the CREATE_PROCEDURE privilege
+for the SQL_OPERATIONS component. For more information, see the
+component privileges in the _HP Database Manager (HPDM) User Guide_ or
+the online help in HPDM
+* EXECUTE and WITH GRANT OPTION privileges on the SPJs in the schema
+
+To create or drop an SPJ in a schema, you must be the schema owner or
+have the appropriate create or drop privileges for the schema. For more
+information, see link:#_bookmark114["Required Privileges for Creating]
+link:#_bookmark114[or Dropping an SPJ" (page 37)]. To invoke an SPJ, you
+must have the EXECUTE privilege on the SPJ. The EXECUTE privilege allows
+a user to invoke an SPJ by issuing a CALL statement. The WITH GRANT
+OPTION privilege allows a user to grant the EXECUTE and WITH GRANT
+OPTION privileges to other users and roles. For more information, see:
+
+* link:#_bookmark141["Granting Execute Privileges on an SPJ" (page 45)]
+* link:#_bookmark143["Granting Privileges on Referenced Database
+Objects" (page 46)]
+* link:#_bookmark145["Revoking Execute Privileges on an SPJ" (page 47)]
+* link:#_bookmark147["Using Script Files to Grant and Revoke Privileges"
+(page 47)]
+
+To display the current ownership and privileges, see
+link:#bookmark130["Display Procedures and Their Properties"]
+link:#bookmark130[(page 42)].
+
+NOTE: You can also grant or revoke the EXECUTE privilege on an SPJ by
+using the Grant/Revoke Privileges Tool in HPDM. For more information,
+see the _HP Database Manager (HPDM) User Guide_ or the online help in
+HPDM.
+
+== Granting Execute Privileges on an SPJ
+
+Use the GRANT PROCEDURE or GRANT statement to assign the EXECUTE and
+WITH GRANT OPTION privileges on an SPJ to specific database users and
+roles. In a GRANT statement, specify ALL PRIVILEGES to grant the EXECUTE
+privilege on an SPJ. For the syntax of the GRANT PROCEDURE and GRANT
+statements, see the __Trafodion SQL Reference Manual__.
+
+If you own the SPJ, you can grant the EXECUTE and WITH GRANT OPTION
+privileges on the SPJ to any database user or role. If you are not the
+owner of the SPJ, you must have been granted the EXECUTE and WITH GRANT
+OPTION privileges on the SPJ to grant privileges to other database users
+and roles, or you must be associated with a role that has the EXECUTE
+and WITH GRANT OPTION privileges on the SPJ.
+
+As the owner of an SPJ, you can selectively grant the EXECUTE and WITH
+GRANT OPTION privileges to specified database users and roles. For some
+SPJs, particularly ones that handle sensitive information or modify
+data, you should grant the EXECUTE and WITH GRANT OPTION privileges to a
+restricted group of users or roles. For example, the SPJ named
+ADJUSTSALARY changes an employee's salary in the database. Therefore,
+only specific users or roles should be allowed to invoke this SPJ. In
+this example, the SPJ owner (or creator) grants the EXECUTE and WITH
+GRANT OPTION privileges on ADJUSTSALARY to the Payroll directors.
+
+```
+GRANT EXECUTE
+
+ON PROCEDURE demo.persnl.adjustsalary
+
+TO "payrolldir1", "payrolldir2" WITH GRANT OPTION;
+```
+
+One of the Payroll directors grants the EXECUTE privilege on
+ADJUSTSALARY to the regional department managers:
+
+```
+GRANT EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary TO "rgn1mgr", "rgn2mgr", "rgn3mgr"
+WITH GRANT OPTION;
+```
+
+In some cases, all users of a database system might need to invoke an
+SPJ. For example, the SPJ named TOTALPRICE calculates the total price of
+an item, including tax and shipping charges. This SPJ does not handle
+sensitive information or modify data and might be useful to customers or
+anyone within the company. Therefore, the SPJ owner (or creator) grants
+the EXECUTE privilege on TOTALPRICE to PUBLIC, meaning all present and
+future database users and roles:
+
+```
+GRANT EXECUTE
+ON PROCEDURE demo.sales.totalprice TO PUBLIC;
+```
+
+After granting the EXECUTE privilege to PUBLIC, you cannot revoke the
+privilege from a subset of database users or roles. You must revoke the
+privilege from PUBLIC and then grant the privilege to specific database
+users and roles.
+
+== Granting Privileges on Referenced Database Objects
+
+If the SPJ operates on a database object and the SPJ has been created
+with the external security specified as invoker (EXTERNAL SECURITY
+INVOKER), the database users that invoke the SPJ must have the
+appropriate privileges on that database object. If the SPJ has been
+created with the external security specified as definer (EXTERNAL
+SECURITY DEFINER), users other than the procedure's creator may invoke
+the SPJ without needing privileges on the underlying database objects.
+When the SPJ's external security is definer, users execute, or invoke,
+the stored procedure using the privileges of the user who created the
+stored procedure. The user who creates the stored procedure must have
+the appropriate privileges on the underlying database objects. For more
+information, see link:#_bookmark124["Understand External Security" (page
+41)].
+
+For example, users with the EXECUTE privilege on the SPJ named
+ADJUSTSALARY, which is defined with EXTERNAL SECURITY INVOKER and which
+selects data from and updates the EMPLOYEE table, must have the SELECT
+and UPDATE privileges on that SQL table. The SPJ owner (or creator)
+grants these access privileges to the Payroll directors:
+
+```
+GRANT SELECT, UPDATE (salary)
+ON TABLE demo.persnl.employee
+TO "payrolldir1", "payrolldir2" WITH GRANT OPTION;
+```
+
+One of the Payroll directors then grants these access privileges to the
+regional department managers:
+
+```
+GRANT SELECT, UPDATE (salary)
+ON TABLE demo.persnl.employee
+TO "rgn1mgr", "rgn2mgr", "rgn3mgr";
+```
+
+Users with the EXECUTE privilege on the SPJ named TOTALPRICE, which does
+not access the database, are not required to have privileges on any
+database tables because that SPJ does not access any database tables.
+
+The types of SQL statements in the underlying SPJ method, such as
+SELECT, UPDATE, DELETE, and INSERT, indicate which types of privileges
+are required for the referenced database objects.
+
+For the syntax of the GRANT statement, see the __Trafodion SQL Reference
+Manual__.
+
+== Revoking Execute Privileges on an SPJ
+
+Use the REVOKE PROCEDURE or REVOKE statement to remove the EXECUTE or
+WITH GRANT OPTION privilege on an SPJ from specific database users or
+roles. In a REVOKE statement, specify ALL PRIVILEGES to revoke the
+EXECUTE privilege on an SPJ. For the syntax of the REVOKE PROCEDURE and
+REVOKE statements, see the __Trafodion SQL Reference Manual__.
+
+If you own the SPJ, you can revoke the EXECUTE and WITH GRANT OPTION
+privileges on the SPJ from any database user or role to whom you granted
+those privileges or, if you did not directly grant those privileges, on
+behalf of the role that granted those privileges, provided that you were
+granted that role. If you are not the owner of the SPJ, you must have
+been granted the EXECUTE and WITH GRANT OPTION privileges on the SPJ to
+revoke privileges from other database users or roles, and you can revoke
+the privileges only from other users or roles to whom you have granted
+those privileges or, if you did not directly grant those privileges, on
+behalf of the role that granted those privileges, provided that you were
+granted that role. For example, the payrolldir1 user can revoke the
+EXECUTE privilege on ADJUSTSALARY from one or more regional department
+managers to whom the payrolldir1 user granted those privileges. In this
+example, the payrolldir1 user revokes the EXECUTE privilege from the
+Region 2 department manager:
+
+```
+REVOKE EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary FROM "rgn2mgr";
+```
+
+The payrolldir1 user cannot revoke the EXECUTE or WITH GRANT OPTION
+privilege from the payrolldir2 user because it was the SPJ owner (or
+creator) who granted those privileges.
+
+A user can revoke the WITH GRANT OPTION privilege on ADJUSTSALARY from
+any user or role to whom the user granted this privilege. In this
+example, the SPJ owner (or creator) revokes the WITH GRANT OPTION
+privilege from the payrolldir1 user:
+
+```
+REVOKE GRANT OPTION FOR EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary FROM "payrolldir1";
+```
+
+A user can also revoke the EXECUTE privilege from any user or role to
+whom the user granted this privilege and from any dependent privileges
+by using the CASCADE option. In this example, the SPJ owner (or creator)
+revokes the EXECUTE privilege from the payrolldir1 user and from the
+regional department managers to whom the payrolldir1 user granted
+privileges:
+
+```
+REVOKE GRANT OPTION FOR EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary FROM "payrolldir1"
+CASCADE;
+```
+
+For SPJs on which all users (that is, PUBLIC) have privileges, you can
+revoke privileges from PUBLIC but not from one or more specific users or
+roles. For example, this statement revokes the EXECUTE privilege on the
+SPJ named TOTALPRICE from all users and roles (that is, PUBLIC):
+
+```
+REVOKE EXECUTE
+ON PROCEDURE demo.sales.totalprice FROM PUBLIC;
+```
+
+== Using Script Files to Grant and Revoke Privileges
+
+Consider keeping your GRANT or REVOKE statements in script files. That
+way, you can quickly and easily grant or revoke privileges to the SPJs,
+as needed.
+
+=== Script File for Granting Privileges
+
+You can use another or the same script file to grant privileges on a
+series of SPJs. For example, the script file, grantprocs.sql, contains a
+series of GRANT PROCEDURE and GRANT statements:
+
+```
+?SECTION GrantSalesProcs
+
+GRANT EXECUTE
+ON demo.sales.monthlyorders
+TO PUBLIC;
+
+GRANT SELECT
+ON TABLE demo.sales.orders TO PUBLIC;
+
+?SECTION GrantPersnlProcs
+
+GRANT EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary TO "payrolldir1", "payrolldir2"
+WITH GRANT OPTION;
+
+GRANT SELECT, UPDATE(salary)
+ON TABLE demo.persnl.employee
+TO "payrolldir1", "payrolldir2" WITH GRANT OPTION;
+```
+
+To grant privileges on the SPJs, run the script file in the trafci
+interface:
+
+```
+obey c:\grantprocs.sql (GrantSalesProcs)
+```
+
+=== Script File for Revoking Privileges
+
+You can use another or the same script file to revoke privileges on a
+series of SPJs. For example, the script file, revokeprocs.sql, contains
+a series of REVOKE PROCEDURE and REVOKE statements:
+
+```
+?SECTION RevokeSalesProcs
+
+REVOKE EXECUTE
+ON PROCEDURE demo.sales.monthlyorders FROM PUBLIC;
+
+REVOKE SELECT
+ON TABLE demo.sales.orders FROM PUBLIC;
+
+?SECTION RevokePersnlProcs
+
+REVOKE EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary FROM "payrolldir1", "payrolldir2"
+CASCADE;
+
+REVOKE SELECT, UPDATE(salary)
+ON TABLE demo.persnl.employee
+FROM "payrolldir1", "payrolldir2" CASCADE;
+```
+
+To revoke privileges on the SPJs, run the script file in the trafci
+interface:
+
+```
+OBEY c:\revokeprocs.sql (RevokeSalesProcs)
+```
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc b/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
new file mode 100644
index 0000000..eb8d690
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
@@ -0,0 +1,255 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[introduction]]
+= Introduction
+
+This chapter introduces stored procedures in Java (SPJs) in a Trafodion
+database and covers these topics:
+
+[[what-is-an-spj]]
+== What Is an SPJ?
+
+A stored procedure is a type of user-defined routine (UDR) that operates
+within a database server and typically performs SQL operations on a
+database. The database server contains information about the stored
+procedure and controls its execution. A client application executes a
+stored procedure by issuing an SQL CALL statement. Unlike a user-defined
+function, which returns a value directly to the calling application, a
+stored procedure returns each output value to a dynamic parameter in its
+parameter list or returns a set of values to a result set array.
+
+The Trafodion database supports stored procedures written in the Java
+programming language. The Trafodion implementation of stored procedures
+complies mostly, unless otherwise specified, with SQL/JRT (Java Routines
+and Types), which extends the ANSI SQL/Foundation standard. A stored
+procedure in Java (SPJ) is a Java method contained in a Java archive
+(JAR) file on the Trafodion platform, registered in the database, and
+executed by the database engine when a client application issues a CALL
+statement.
+
+The body of a stored procedure consists of a public, static Java method
+that returns void. These Java methods, called _SPJ methods_, are
+contained in classes within JAR files on the cluster hosting the
+Trafodion database.
+
+An SPJ method must be registered as a stored procedure in the database before a
+client application can execute it with a CALL statement. You upload the SPJ to
+the cluster where the Trafodion datbase is running
+and then you register the SPJ as a library object using the
+http://trafodion.apache.org/docs/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
+statement. Next, you register the library object using the
+http://trafodion.apache.org/docs/sql_reference/index.html#create_procedure_statement[CREATE PROCEDURE]
+statement.
+
+[[benefits-of-spjs]]
+== Benefits of SPJs
+
+SPJs provide an efficient and secure way to implement business logic in
+the database. SPJs offer these advantages:
+
+* <<java-methods-callable-from-sql, Java Methods Callable From SQL>>
+* <<common-packaging-technique,Common Packaging Technique>>
+* <<security,Security>>
+* <<increased-productivity,Increased Productivity>>
+* <<portability,Portability>>
+
+[[java-methods-callable-from-sql]]
+=== Java Methods Callable From SQL
+
+With support for SPJs, Java methods are callable from any client
+application that connects to the Trafodion platform. For example, you can
+invoke the same SPJ method from JDBC client applications and ODBC client
+applications. By using the database engine to invoke Java methods, you
+can extend the functionality of the database and share business logic
+among different applications.
+
+For more information, see <<execute-spjs, Execute SPJs>>.
+
+[[common-packaging-technique]]
+=== Common Packaging Technique
+
+Different applications can invoke the same SPJ to perform a common
+business function. By encapsulating business logic in an SPJ, you can
+maintain consistent database operations and avoid duplicating code in
+applications.
+
+Applications that call SPJs are not required to know the structure of
+the database tables that the SPJ methods access. The application does
+not need to use any table or column names; it needs only the name of the
+stored procedure in the CALL statement. If the table structure changes,
+you might need to change the SPJ methods but not necessarily the CALL
+statements within each application.
+
+[[security]]
+=== Security
+
+By using SPJs, you can conceal sensitive business logic inside SPJ
+methods instead of exposing it in client applications. You can also
+grant privileges to execute an SPJ to specific users and restrict the
+privileges of other users. For more information, see
+<<grant-privileges, Grant Privileges>>
+
+[[increased-productivity]]
+=== Increased Productivity
+
+Use SPJs to reduce the time and cost of developing and maintaining
+client applications. By having several applications call the same SPJ,
+you need only change the SPJ method once when business rules or table
+structures change instead of changing every application that calls the
+SPJ.
+
+Using the Java language to implement stored procedures increases
+productivity. Given the popularity of the Java language, you can
+leverage the existing skill set of Java programmers to develop SPJs.
+
+The portability of the Java language enables you to write and compile
+Java class files for SPJs once and deploy them anywhere.
+
+[[portability]]
+=== Portability
+
+Because SPJ methods are written in Java, and SPJs conform to the ANSI
+SQL standard, SPJs are portable across different database servers. With
+minimal changes to SPJ methods, you can port existing SPJ JAR files from
+another database server to a Trafodion platform and register the methods
+as stored procedures in a Trafodion database. You can also port client
+applications that call SPJs in other databases to Trafodion SQL with
+minimal changes to the CALL statements in the application.
+
+<<<
+[[use-spjs]]
+== Use SPJs
+
+To use SPJs in a Trafodion database:
+
+1.  Verify that you have the required software installed on the client
+workstation. See <<get-started, Get Started>>.
+
+2.  Develop a Java method to be used as an SPJ:
+.. Write a static Java method:
++
+[source, java]
+----
+public class Payroll
+{
+   public static void adjustSalary( BigDecimal empNum
+                                  , double percent, BigDecimal[] newSalary
+				  ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement setSalary =
+         conn.prepareStatement( "UPDATE demo.persnl.employee "
+	                      + "SET salary = salary * (1 + (? / 100)) "
+			      + "WHERE empnum = ?"
+			      ) ;
+
+      PreparedStatement getSalary =
+         conn.prepareStatement( "SELECT salary "
+	                      + "FROM demo.persnl.employee "
+			      + "WHERE empnum = ?"
+			      ) ;
+
+      setSalary.setDouble( 1, percent ) ;
+      setSalary.setBigDecimal( 2, empNum ) ;
+      setSalary.executeUpdate() ;
+
+      getSalary.setBigDecimal( 1, empNum ) ;
+      ResultSet rs = getSalary.executeQuery() ;
+      rs.next() ;
+
+      newSalary[0] = rs.getBigDecimal( 1 ) ;
+
+      rs.close() ;
+      conn.close() ;
+   }
+}
+----
+
+.. Compile the Java source file to produce a class file:
++
+```
+javac Payroll.java
+```
+
+.. Package the SPJ class file in a JAR file:
++
+```
+jar cvf Payroll.jar Payroll.class
+```
++
+If the SPJ class refers to other classes, package the other classes in
+the same JAR file as the SPJ class:
++
+```
+jar cvf Payroll.jar Payroll.class other.class
+```
++
+For details, see <<develop-spj-methods, Develop SPJ Methods>>.
+
+3. Deploy the SPJ JAR file on the Trafodion platform by creating a
+library object for the JAR file in one of the database schemas. For
+details, see <<Deploy-spj-jar-files, Deploy SPJ JAR Files>>.
+
+4.  As the schema owner, create the SPJ in the database. For details,
+see <<create-spjs, Create SPJs>>.
+
+5.  Grant privileges to database users for executing the SPJ and for
+operating on the referenced database objects. For example, you can issue
+GRANT statements in an trafci session, as shown below:
++
+[source,sql]
+----
+GRANT EXECUTE
+ON PROCEDURE demo.persnl.adjustsalary
+TO "payrolldir1", "payrolldir2"
+WITH GRANT OPTION ;
+
+GRANT SELECT, UPDATE (salary)
+ON TABLE demo.persnl.employee
+TO "payrolldir1", "payrolldir2"
+WITH GRANT OPTION ;
+----
++
+For details, see <<grant-privileges, Grant Privileges>>.
+
+6. Execute an SPJ by using a CALL statement in a client application.
+For example, you can issue a CALL statement in an trafci session, as
+shown below, or in a JDBC or ODBC client application:
++
+```
+SQL> CALL demo.persnl.adjustsalary( 29, 2.5, ? ) ;
+
+NEWSALARY
+------------
+   139400.00
+
+--- SQL operation complete.
+```
++
+For details, see <<execute-spjs, Execute SPJs>>.
+
+7. Monitor the performance of SPJs and resolve common problems with
+SPJs in the database. See <<performance-and-troubleshooting, Performance and Troubleshooting>>.
+



[36/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
update


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

Branch: refs/heads/master
Commit: 681cad66935981b7e0f6bcb9b6c72fe18e2f69f6
Parents: f9f3748
Author: mashengchen <ma...@gmail.com>
Authored: Tue Mar 22 05:40:23 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Tue Mar 22 05:40:23 2016 +0000

----------------------------------------------------------------------
 .rat-excludes                                   |    1 +
 core/conn/odbc/src/odbc/nsksrvr/Makefile        |    2 +
 .../odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp     |    7 +-
 core/dbsecurity/auth/Makefile                   |    2 +-
 core/rest/pom.xml                               |    2 +-
 core/sqf/Makefile                               |    2 +-
 .../sqf/conf/log4cxx.trafodion.masterexe.config |    1 +
 core/sqf/hbase_utilities/pom.xml                |    2 +-
 core/sqf/monitor/linux/clio.cxx                 |    7 +
 core/sqf/monitor/linux/cluster.cxx              |   11 +
 core/sqf/monitor/linux/cmsh.cxx                 |   29 +-
 core/sqf/monitor/linux/config.cxx               |    1 +
 core/sqf/monitor/linux/internal.h               |    9 +
 core/sqf/monitor/linux/makefile                 |    5 +-
 core/sqf/monitor/linux/mlio.cxx                 |    6 +-
 core/sqf/monitor/linux/monitor.cxx              |    9 +
 core/sqf/monitor/linux/msgdef.h                 |   17 +
 core/sqf/monitor/linux/phnode.h                 |    2 +
 core/sqf/monitor/linux/pnode.cxx                |   10 +
 core/sqf/monitor/linux/pnode.h                  |    1 +
 core/sqf/monitor/linux/pnodeconfig.cxx          |    6 +
 core/sqf/monitor/linux/pnodeconfig.h            |    2 +-
 core/sqf/monitor/linux/replicate.cxx            |   56 +-
 core/sqf/monitor/linux/replicate.h              |   14 +
 core/sqf/monitor/linux/reqnodename.cxx          |  114 +
 core/sqf/monitor/linux/reqqueue.cxx             |   60 +-
 core/sqf/monitor/linux/reqqueue.h               |   32 +-
 core/sqf/monitor/linux/shell.cxx                |  195 +-
 core/sqf/monitor/linux/testpoint.h              |    2 +-
 core/sqf/sqenvcom.sh                            |    8 +
 core/sqf/sql/scripts/gensq.pl                   |   54 +-
 core/sqf/sql/scripts/genstats.sh                |   43 +
 core/sqf/sql/scripts/get_libhdfs_files          |  203 +-
 core/sqf/sql/scripts/sqnodeipcrm                |    2 +-
 core/sqf/sql/scripts/sqstart                    |    3 +-
 core/sqf/sql/scripts/sqstop                     |    2 +-
 core/sqf/src/seabed/src/msmon.cpp               |    6 +
 core/sqf/src/seabed/src/sautil.cpp              |    5 -
 core/sqf/src/seabed/src/stream.cpp              |    2 -
 .../transactional/SplitBalanceHelper.java       |    6 +-
 core/sqf/src/tm/Makefile                        |    3 +
 core/sqf/src/tm/tm.cpp                          |   33 +-
 core/sqf/src/tm/tmaudit.cpp                     |   18 +-
 core/sqf/src/tm/tmauditobj.cpp                  |    6 +-
 core/sqf/src/tm/tmddlrequests.cpp               |   12 +-
 core/sqf/src/tm/tmlib.cpp                       |   13 +-
 core/sqf/src/tm/tmpoolelement.h                 |    2 +-
 core/sqf/src/tm/tmrecov.cpp                     |    3 +-
 core/sqf/src/tm/tmregisterregion.cpp            |    4 +-
 core/sqf/src/tm/tmrmhbase.cpp                   |    3 -
 core/sqf/src/tm/tmrmtse.cpp                     |    3 +-
 core/sqf/src/tm/tmtime.h                        |    3 +-
 core/sqf/src/tm/tmxarmmain.cpp                  |    2 +-
 core/sqf/src/tm/tmxatxn.cpp                     |    4 +-
 core/sqf/src/tm/tools/Makefile                  |    3 +
 core/sqf/src/tm/tools/dtmci.cpp                 |   14 +-
 core/sqf/src/tm/xarmapi.cpp                     |    5 +-
 core/sqf/src/tm/xatmapi.cpp                     |    7 +-
 core/sql/SqlCompilerDebugger/mk.sh              |    5 +
 core/sql/bin/SqlciErrors.txt                    |    7 +-
 core/sql/cli/Cli.cpp                            |  445 ++-
 core/sql/cli/Cli.h                              |   15 +-
 core/sql/cli/CliExpExchange.cpp                 |   18 +-
 core/sql/cli/CliExtern.cpp                      |   54 +-
 core/sql/cli/Descriptor.cpp                     |    6 +-
 core/sql/comexe/ComQueue.h                      |    2 +-
 core/sql/comexe/ComTdb.h                        |    1 +
 core/sql/comexe/ComTdbHbaseAccess.cpp           |    2 +-
 core/sql/comexe/ComTdbHbaseAccess.h             |    2 +-
 core/sql/common/CharType.cpp                    |    3 +-
 core/sql/common/CharType.h                      |    2 +-
 core/sql/common/ComMisc.cpp                     |   13 +
 core/sql/common/ComMisc.h                       |    8 +
 core/sql/common/ComSmallDefs.h                  |   14 +-
 core/sql/common/ComUser.cpp                     |   54 +
 core/sql/common/ComUser.h                       |    6 +
 core/sql/common/NAString.cpp                    |   23 +
 core/sql/common/NAString.h                      |    3 +
 core/sql/common/NAUserId.h                      |   32 +-
 core/sql/common/OperTypeEnum.h                  |    1 +
 core/sql/executor/ExExeUtilLoad.cpp             |    3 +-
 core/sql/executor/ExHbaseAccess.h               |    3 +
 core/sql/executor/ExHbaseIUD.cpp                |   27 +-
 core/sql/executor/hiveHook.cpp                  |    2 +-
 core/sql/exp/ExpHbaseInterface.h                |    1 -
 core/sql/exp/ExpLOB.cpp                         |  158 +-
 core/sql/exp/ExpLOB.h                           |   41 +-
 core/sql/exp/ExpLOBaccess.cpp                   | 2905 +++++++++---------
 core/sql/exp/ExpLOBaccess.h                     |  288 +-
 core/sql/exp/ExpLOBenums.h                      |    5 +-
 core/sql/exp/ExpLOBexternal.h                   |   20 +-
 core/sql/exp/ExpLOBinterface.cpp                |  291 +-
 core/sql/exp/ExpLOBinterface.h                  |   24 +-
 core/sql/exp/ExpLOBprocess.cpp                  |  494 +--
 core/sql/exp/ExpLOBprocess.h                    |    2 +-
 core/sql/exp/exp_conv.cpp                       |    1 +
 core/sql/exp/exp_datetime.cpp                   | 1239 ++++----
 core/sql/exp/exp_datetime.h                     |  187 +-
 core/sql/exp/exp_function.cpp                   |   28 +-
 core/sql/generator/GenExpGenerator.cpp          |    3 +-
 core/sql/generator/GenItemFunc.cpp              |  151 +-
 core/sql/generator/GenPreCode.cpp               |   36 +-
 core/sql/generator/GenRelUpdate.cpp             |   47 +-
 core/sql/generator/Generator.cpp                |   10 +-
 core/sql/nskgmake/Makerules.linux               |    8 +-
 core/sql/nskgmake/SqlCompilerDebugger/Makefile  |    5 +-
 core/sql/optimizer/BindItemExpr.cpp             |  598 ++--
 core/sql/optimizer/BindRI.cpp                   |   45 +-
 core/sql/optimizer/BindRelExpr.cpp              |   40 +-
 core/sql/optimizer/ItemCache.cpp                |    5 +-
 core/sql/optimizer/ItemExpr.cpp                 |   52 +-
 core/sql/optimizer/ItemFunc.h                   |   70 +-
 core/sql/optimizer/NAFileSet.cpp                |    2 +
 core/sql/optimizer/NAFileSet.h                  |    7 +
 core/sql/optimizer/NATable.cpp                  |   29 +-
 core/sql/optimizer/NATable.h                    |    3 +-
 core/sql/optimizer/QRDescGenerator.cpp          |   19 +-
 core/sql/optimizer/RelExeUtil.cpp               |   12 +-
 core/sql/optimizer/RelExeUtil.h                 |   17 +-
 core/sql/optimizer/RelFastTransport.cpp         |    2 +-
 core/sql/optimizer/RelUpdate.h                  |    3 +-
 core/sql/optimizer/Stats.h                      |    8 +-
 core/sql/optimizer/SynthType.cpp                |  154 +-
 core/sql/optimizer/ValueDesc.cpp                |    5 +-
 core/sql/optimizer/ValueDesc.h                  |    6 +-
 core/sql/parser/ElemDDLNode.cpp                 |    6 +
 core/sql/parser/ElemDDLNode.h                   |    3 +
 core/sql/parser/ParKeyWords.cpp                 |    7 +-
 .../sql/parser/StmtDDLAlterTableAlterColumn.cpp |   39 +-
 core/sql/parser/StmtDDLAlterTableAlterColumn.h  |   40 +-
 core/sql/parser/sqlparser.y                     |  177 +-
 core/sql/regress/charsets/DIFF012.KNOWN.SB      |    2 +-
 core/sql/regress/charsets/EXPECTED002           |   13 +-
 core/sql/regress/charsets/EXPECTED003           |   11 +-
 core/sql/regress/charsets/EXPECTED012           |   19 +-
 core/sql/regress/charsets/EXPECTED310           |  198 +-
 core/sql/regress/charsets/EXPECTED312           |  198 +-
 core/sql/regress/charsets/EXPECTED313           |  286 +-
 core/sql/regress/compGeneral/DIFF006.KNOWN.SB   |    4 -
 core/sql/regress/compGeneral/EXPECTED005        |   10 +-
 core/sql/regress/compGeneral/EXPECTED006        | 1235 --------
 core/sql/regress/compGeneral/EXPECTED006.SB     |   33 +-
 core/sql/regress/compGeneral/EXPECTED013.SB     |   48 +
 core/sql/regress/compGeneral/EXPECTED042        |    8 +-
 core/sql/regress/compGeneral/TEST006            |   12 +-
 core/sql/regress/compGeneral/TEST013            |   28 +
 core/sql/regress/core/EXPECTED001.SB            |   48 +-
 core/sql/regress/core/EXPECTED037.SB            |   14 +-
 core/sql/regress/core/EXPECTED056.SB            |    6 -
 core/sql/regress/core/EXPECTED061.SB            |   13 +-
 core/sql/regress/core/EXPECTED116               |  149 +-
 core/sql/regress/core/TEST001                   |    2 +
 core/sql/regress/core/TEST029                   |    1 -
 core/sql/regress/core/TEST056                   |    2 -
 core/sql/regress/core/TEST116                   |   11 +-
 core/sql/regress/executor/EXPECTED001           |   80 +-
 core/sql/regress/executor/EXPECTED013.SB        |   59 +-
 core/sql/regress/executor/EXPECTED014.SB        |   73 +-
 core/sql/regress/executor/EXPECTED016.SB        |   10 +-
 core/sql/regress/executor/EXPECTED122           |   20 +-
 core/sql/regress/executor/EXPECTED130           |  106 +-
 core/sql/regress/executor/TEST130               |   32 +
 core/sql/regress/hive/EXPECTED009               |    7 +
 core/sql/regress/hive/EXPECTED017               |    3 +
 core/sql/regress/privs1/EXPECTED132             |   96 +-
 core/sql/regress/privs2/EXPECTED135             |    2 +
 core/sql/regress/seabase/EXPECTED010            |  394 +--
 core/sql/regress/seabase/EXPECTED011            |   16 +-
 core/sql/regress/seabase/EXPECTED012            |    5 +-
 core/sql/regress/seabase/EXPECTED020            |   52 +-
 core/sql/regress/seabase/EXPECTED022            |   12 +-
 core/sql/regress/seabase/EXPECTED025            |    7 +-
 core/sql/regress/seabase/EXPECTED027            |  499 ++-
 core/sql/regress/seabase/EXPECTED030            |  599 ++++
 core/sql/regress/seabase/EXPECTED031            |  214 ++
 core/sql/regress/seabase/TEST020                |   15 +-
 core/sql/regress/seabase/TEST027                |   85 +-
 core/sql/regress/seabase/TEST030                |  117 +
 core/sql/regress/seabase/TEST031                |  108 +
 core/sql/regress/tools/dll-compile.ksh          |    4 +-
 core/sql/regress/tools/runregr_udr.ksh          |   73 +-
 core/sql/regress/udr/EXPECTED102                |  421 +++
 core/sql/regress/udr/TEST102                    |  119 +
 core/sql/sqlcat/desc.h                          |    1 +
 core/sql/sqlcomp/CmpDescribe.cpp                |   30 +-
 core/sql/sqlcomp/CmpDescribe.h                  |    2 -
 core/sql/sqlcomp/CmpSeabaseDDL.h                |   79 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |  110 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.h            |    2 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp       |    7 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |  128 +-
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |    4 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp       |  171 ++
 core/sql/sqlcomp/CmpSeabaseDDLroutine.h         |  280 ++
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |  114 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         | 1761 ++++++++---
 core/sql/sqlcomp/DefaultConstants.h             |    9 +-
 core/sql/sqlcomp/PrivMgrComponentOperations.cpp |   24 +-
 core/sql/sqlcomp/PrivMgrComponentOperations.h   |    3 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp |   15 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.h   |    3 +-
 core/sql/sqlcomp/PrivMgrMD.cpp                  |  129 +-
 core/sql/sqlcomp/PrivMgrMD.h                    |    3 +-
 core/sql/sqlcomp/PrivMgrRoles.cpp               |   65 +-
 core/sql/sqlcomp/PrivMgrRoles.h                 |    4 +-
 core/sql/sqlcomp/nadefaults.cpp                 |   40 +-
 core/sql/ustat/hs_cli.cpp                       |   22 +-
 core/sql/ustat/hs_globals.cpp                   |    2 +-
 dcs/Makefile                                    |    2 +
 dcs/bin/dcs                                     |   20 -
 dcs/bin/dcs-config.sh                           |   21 -
 dcs/bin/dcs-daemon.sh                           |   21 -
 dcs/bin/dcs-daemons.sh                          |   20 -
 dcs/pom.xml                                     |  157 +-
 dcs/src/assembly/all.xml                        |   11 +-
 .../org/trafodion/dcs/master/DcsMaster.java     |    2 -
 .../dcs/master/MasterStatusServlet.java         |   22 +-
 .../java/org/trafodion/dcs/rest/DcsRest.java    |  215 --
 .../trafodion/dcs/rest/GetStatusResponse.java   |   50 -
 .../org/trafodion/dcs/rest/RESTServlet.java     |  172 --
 .../org/trafodion/dcs/rest/ResourceBase.java    |   34 -
 .../org/trafodion/dcs/rest/ResourceConfig.java  |   31 -
 .../org/trafodion/dcs/rest/RestConstants.java   |   63 -
 .../org/trafodion/dcs/rest/RootResource.java    |  102 -
 .../org/trafodion/dcs/rest/ServerConnector.java |   79 -
 .../org/trafodion/dcs/rest/ServerResource.java  |  158 -
 .../org/trafodion/dcs/rest/VersionResource.java |  122 -
 .../trafodion/dcs/rest/WorkloadResource.java    |  140 -
 .../org/trafodion/dcs/rest/client/Client.java   |  504 ---
 .../org/trafodion/dcs/rest/client/Cluster.java  |  102 -
 .../org/trafodion/dcs/rest/client/Response.java |  129 -
 .../trafodion/dcs/rest/model/ServerModel.java   |  530 ----
 .../trafodion/dcs/rest/model/VersionModel.java  |  193 --
 .../dcs/rest/model/WorkloadListModel.java       |  225 --
 .../trafodion/dcs/rest/model/WorkloadModel.java |  139 -
 .../dcs/rest/provider/JAXBContextResolver.java  |   84 -
 .../producer/PlainTextMessageBodyProducer.java  |   92 -
 .../dcs-webapps/master/aggr_querystats.html     |   88 -
 .../dcs-webapps/master/aggr_querystats.jsp      |   85 -
 .../resources/dcs-webapps/master/explain.html   |   62 -
 .../resources/dcs-webapps/master/queryPlan.jsp  |   77 -
 .../dcs-webapps/master/querystats.html          |   89 -
 .../resources/dcs-webapps/master/querystats.jsp |   89 -
 .../resources/dcs-webapps/master/repository.jsp |  114 -
 .../resources/dcs-webapps/master/sessions.html  |   87 -
 .../resources/dcs-webapps/master/sessions.jsp   |   89 -
 .../src/asciidoc/_chapters/odbc_windows.adoc    |   10 +-
 docs/cqd_reference/pom.xml                      |    8 +-
 .../src/asciidoc/_chapters/debugging.adoc       |   95 +
 .../src/asciidoc/_chapters/histograms.adoc      |   38 +-
 .../src/asciidoc/_chapters/introduction.adoc    |   13 +-
 .../_chapters/operational_controls.adoc         |  138 +-
 .../src/asciidoc/_chapters/query_execution.adoc |  239 ++
 .../src/asciidoc/_chapters/query_plans.adoc     |  330 +-
 .../asciidoc/_chapters/runtime_controls.adoc    |    4 +-
 .../src/asciidoc/_chapters/schema_controls.adoc |   24 +-
 .../asciidoc/_chapters/table_definition.adoc    |  142 +
 .../src/asciidoc/_chapters/transactions.adoc    |    4 +-
 .../src/asciidoc/_chapters/update_stats.adoc    |   31 +-
 docs/cqd_reference/src/asciidoc/index.adoc      |    3 +
 docs/load_transform/pom.xml                     |    8 +-
 .../src/asciidoc/_chapters/about.adoc           |    8 +-
 .../src/asciidoc/_chapters/bulk_load.adoc       |   37 +-
 .../src/asciidoc/_chapters/introduction.adoc    |   14 +-
 .../src/asciidoc/_chapters/tables_indexes.adoc  |   18 +-
 .../src/asciidoc/_chapters/trickle_load.adoc    |   12 +-
 .../src/asciidoc/_chapters/troubleshoot.adoc    |    4 +-
 .../src/asciidoc/_chapters/about.adoc           |    4 +-
 .../src/asciidoc/_chapters/cqds.adoc            |  329 --
 .../src/asciidoc/_chapters/introduction.adoc    |   11 +-
 .../src/asciidoc/_chapters/sql_statements.adoc  |    6 +-
 docs/sql_reference/src/asciidoc/index.adoc      |    1 -
 docs/src/site/markdown/documentation.md         |   66 +-
 docs/src/site/markdown/logo.md                  |    2 +-
 .../resources/images/logos/pb-Trafodion.png     |  Bin 49089 -> 0 bytes
 .../resources/images/logos/pb-trafodion.png     |  Bin 0 -> 49089 bytes
 docs/src/site/site.xml                          |    1 +
 install/installer/checkHBase                    |   37 +
 install/installer/dcs_installer                 |    8 +-
 install/installer/parseHBaseSite.py             |   56 +
 install/installer/traf_add_sudoAccess           |    6 +-
 install/installer/traf_cloudera_mods98          |   40 +-
 install/installer/traf_config_check             |   56 +-
 install/installer/traf_config_setup             |    3 +-
 install/installer/traf_getHadoopNodes           |   21 +-
 install/installer/traf_hortonworks_mods98       |   42 +-
 install/installer/traf_package_setup            |    2 +-
 install/installer/traf_sqgen                    |    2 +-
 install/installer/trafodion_install             |   86 +-
 install/traf_tools_setup.sh                     |   56 +-
 licenses/lic-clients-bin                        |   33 +-
 licenses/lic-dcs-bin                            |  651 +++-
 licenses/lic-winodbc-bin                        |   50 +
 licenses/not-dcs-bin                            |   20 +
 pom.xml                                         |    2 +
 tools/docker/Dockerfile                         |   45 +
 tools/docker/build-base-docker.sh               |   29 +
 tools/docker/start-compile-docker.sh            |   67 +
 wms/pom.xml                                     |    2 +-
 299 files changed, 12964 insertions(+), 11880 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/.rat-excludes
----------------------------------------------------------------------
diff --git a/.rat-excludes b/.rat-excludes
index 1073071..1c0642d 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -59,6 +59,7 @@ license*.txt*
 LICENSE.rtf*
 lic-.*-src
 lic-.*-bin
+not-.*-bin
 # win generated
 SetCertificateDirReg_os.vcxproj*
 SetCertificateDirReg_os.vcxproj.*

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/conn/odbc/src/odbc/nsksrvr/Makefile
----------------------------------------------------------------------
diff --git a/core/conn/odbc/src/odbc/nsksrvr/Makefile b/core/conn/odbc/src/odbc/nsksrvr/Makefile
index 2952f9d..36404e6 100644
--- a/core/conn/odbc/src/odbc/nsksrvr/Makefile
+++ b/core/conn/odbc/src/odbc/nsksrvr/Makefile
@@ -130,6 +130,8 @@ LOC_JSIG=$(JAVA_HOME)/jre/lib/i386/server
 endif
 
 
+#gcc 4.8 need explicit enable this flag, otherwise ld must explicitly link with all so using '-l'
+GCCMODE        += -Xlinker --copy-dt-needed-entries
 # Produce mxosrvr
 $(BINEXPDIR)/mxosrvr: $(OBJS) $(LIBEXPDIR)/libzookeeper_mt.so
 	$(CXX) $(GCCMODE) -o $@ $(DBG_FLGS)  -L$(LIBEXPDIR) -D_SQ64 -L$(LOC_JSIG) $(EARLY_LIBS) $(COMMON_LIBS) $(DBT_LIBS) -lzookeeper_mt $(HADOOP_LIBS) $(OBJS) -lz

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/conn/odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp
----------------------------------------------------------------------
diff --git a/core/conn/odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp b/core/conn/odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp
index ed5ce72..e04682e 100644
--- a/core/conn/odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp
+++ b/core/conn/odbc/src/odbc/nsksrvrcore/csrvrstmt.cpp
@@ -129,7 +129,12 @@ SRVR_STMT_HDL::SRVR_STMT_HDL()
 	IRD = NULL;
 	outputDataValue._length = 0;
 	outputDataValue._buffer = NULL;
-	outputDataValue.pad_to_offset_8_ = {'\0', '\0', '\0', '\0'};
+        //outputDataValue.pad_to_offset_8_ = {'\0', '\0', '\0', '\0'};
+        //use trafodional way to initialze array, above is c++11 in gcc 4.8
+        //for gcc 4.4 backward compatibilty, Trafodion now is using c++0x , gcc 4.4 cannot support c++11 mode
+        //once tested with -std=c++11, may recover this coding style
+        memset( outputDataValue.pad_to_offset_8_ , 0, sizeof(outputDataValue.pad_to_offset_8_) );
+
 	inputDataValue._length = 0;
 	inputDataValue._buffer = NULL;
 	delayedOutputDataValue._length = 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/dbsecurity/auth/Makefile
----------------------------------------------------------------------
diff --git a/core/dbsecurity/auth/Makefile b/core/dbsecurity/auth/Makefile
index 1e3ea4c..f916a94 100644
--- a/core/dbsecurity/auth/Makefile
+++ b/core/dbsecurity/auth/Makefile
@@ -73,7 +73,7 @@ INCLUDES	= -I. -I./inc -I ../shared/inc \
 	        -I ../../sql/common
 
 
-LINK_OPTIONS	= -L$(LIBEXPDIR) -lldap -lssl
+LINK_OPTIONS	= -L$(LIBEXPDIR) -lldap -lssl -llber
 LINK_OPTIONS   += $(LNK_FLGS) 
 
 COMMON_LIBS =  -ltdm_sqlcli -larkcmp_dll  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/rest/pom.xml
----------------------------------------------------------------------
diff --git a/core/rest/pom.xml b/core/rest/pom.xml
index 540660a..be74105 100644
--- a/core/rest/pom.xml
+++ b/core/rest/pom.xml
@@ -417,7 +417,7 @@
   	<compileSource>1.6</compileSource>
     
   	<!-- Dependencies -->
-    <hadoop.version>2.4.0</hadoop.version>
+    <hadoop.version>${env.HADOOP_DEP_VER}</hadoop.version>
   	<commons-cli.version>1.2</commons-cli.version>
   	<commons-codec.version>1.4</commons-codec.version>
   	<commons-io.version>2.1</commons-io.version>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/Makefile b/core/sqf/Makefile
index 6c3cae9..1a13269 100644
--- a/core/sqf/Makefile
+++ b/core/sqf/Makefile
@@ -196,7 +196,7 @@ setupdir:
 	-ln -sf $(SQL_W)/sqludr/sqludr.h $(EXPORTINCSQL_DIR)
 	@#
 	mkdir -p export/include/nsk
-	-ln -sf inc/cextdecs/cextdecs.h export/include/nsk
+	-ln -sf $(MY_SQROOT)/inc/cextdecs/cextdecs.h export/include/nsk
 	@# USTAT
 	-mkdir -p export/lib/mx_ustat
 	-ln -sf $(SQL_W)/ustat/USAS.sh export/lib/mx_ustat

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/conf/log4cxx.trafodion.masterexe.config
----------------------------------------------------------------------
diff --git a/core/sqf/conf/log4cxx.trafodion.masterexe.config b/core/sqf/conf/log4cxx.trafodion.masterexe.config
index 5a8e96d..5d037ce 100644
--- a/core/sqf/conf/log4cxx.trafodion.masterexe.config
+++ b/core/sqf/conf/log4cxx.trafodion.masterexe.config
@@ -47,6 +47,7 @@ log4j.appender.mxoAppender.layout.ConversionPattern=%d, %p, %c, %m%n
 log4j.logger.MXOSRVR=ERROR, mxoAppender
 
 # SQL
+#log4j.logger.SQL.EXE=DEBUG
 log4j.logger.SQL=INFO
 log4j.logger.SQL.COMP=ERROR
 log4j.logger.SQL.EXE.Memory=INFO

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/hbase_utilities/pom.xml
----------------------------------------------------------------------
diff --git a/core/sqf/hbase_utilities/pom.xml b/core/sqf/hbase_utilities/pom.xml
index e0c7a74..7d7063f 100644
--- a/core/sqf/hbase_utilities/pom.xml
+++ b/core/sqf/hbase_utilities/pom.xml
@@ -28,7 +28,7 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <hadoop.version>2.6.0</hadoop.version>
+    <hadoop.version>${env.HADOOP_DEP_VER}</hadoop.version>
     <hbase.version>${env.HBASE_DEP_VER_CDH}</hbase.version>
     <java.version>1.7</java.version>
   </properties>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/clio.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clio.cxx b/core/sqf/monitor/linux/clio.cxx
index d181039..672c543 100644
--- a/core/sqf/monitor/linux/clio.cxx
+++ b/core/sqf/monitor/linux/clio.cxx
@@ -370,6 +370,13 @@ Local_IO_To_Monitor::Local_IO_To_Monitor(int pv_pid)
         la_node_name[0] = '\0';
     }
 
+    char *tmpptr = la_node_name;
+    while ( *tmpptr )
+    {
+        *tmpptr = (char)tolower( *tmpptr);
+        tmpptr++;
+    }
+
     char *lp_nodes = getenv("SQ_VIRTUAL_NODES");
     if (lp_nodes != NULL) 
     {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 0373bfd..8190b49 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -1888,7 +1888,13 @@ void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
         // Queue the node down request for processing by a worker thread.
         ReqQueue.enqueueDownReq( recv_msg->u.down.pnid );
         break;
+    case InternalType_NodeName:
+        if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+            trace_printf("%s@%d - Internal node name request (%s to %s)\n", method_name, __LINE__, recv_msg->u.nodename.current_name, recv_msg->u.nodename.new_name);
 
+        // Queue the node down request for processing by a worker thread.
+        ReqQueue.enqueueNodeNameReq( recv_msg->u.nodename.current_name, recv_msg->u.nodename.new_name );
+        break;
     case InternalType_SoftNodeDown:
         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
             trace_printf("%s@%d - Internal soft node down request for pnid=%d\n", method_name, __LINE__, recv_msg->u.down.pnid);
@@ -2394,6 +2400,11 @@ void CCluster::HandleMyNodeMsg (struct internal_msg_def *recv_msg,
             trace_printf("%s@%d - Internal down node request for pnid=%d\n", method_name, __LINE__, recv_msg->u.down.pnid);
         break;
 
+    case InternalType_NodeName:
+        if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+            trace_printf("%s@%d - Internal node name request (%s to %s)\n", method_name, __LINE__, recv_msg->u.nodename.current_name, recv_msg->u.nodename.new_name);
+        break;
+
     case InternalType_SoftNodeDown:
         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
             trace_printf("%s@%d - Internal soft down node request for pnid=%d\n", method_name, __LINE__, recv_msg->u.down.pnid);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/cmsh.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cmsh.cxx b/core/sqf/monitor/linux/cmsh.cxx
index 1fd9af4..c8c4975 100755
--- a/core/sqf/monitor/linux/cmsh.cxx
+++ b/core/sqf/monitor/linux/cmsh.cxx
@@ -127,19 +127,32 @@ int CCmsh::GetClusterState( PhysicalNodeNameMap_t &physicalNodeMap )
             it = physicalNodeMap.find( nodeName.c_str() );
             if (it != physicalNodeMap.end())
             {
-                // TEST_POINT: to force state down on node name 
-                const char *downNodeName = getenv( TP001_NODE_DOWN );
-                if ( downNodeName != NULL && 
-                    !strcmp( downNodeName, nodeName.c_str() ) )
-                {
-                    nodeState = StateDown ;
-                }
+               // TEST_POINT and Exclude List : to force state down on node name 
+               const char *downNodeName = getenv( TP001_NODE_DOWN );
+               const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+	       string downNodeString = " ";
+	       if (downNodeList)
+	       {
+		 downNodeString += downNodeList;
+	         downNodeString += " ";
+	       }
+	       string downNodeToFind = " ";
+	       downNodeToFind += nodeName.c_str();
+	       downNodeToFind += " ";
+               if (((downNodeList != NULL) && 
+		      strstr(downNodeString.c_str(),downNodeToFind.c_str())) ||
+                   ( (downNodeName != NULL) && 
+                     !strcmp( downNodeName, nodeName.c_str()) ))
+              {
+                   nodeState = StateDown;
+              }
+	   
                 // Set physical node state
                 physicalNode = it->second;
                 physicalNode->SetState( nodeState );
             }
         }
-    }
+    }	
 
     TRACE_EXIT;
     return( rc );

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/config.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.cxx b/core/sqf/monitor/linux/config.cxx
index aaf4e0b..dc78ba2 100755
--- a/core/sqf/monitor/linux/config.cxx
+++ b/core/sqf/monitor/linux/config.cxx
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <iostream>
+#include <unistd.h>
 
 using namespace std;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/internal.h b/core/sqf/monitor/linux/internal.h
index 1edec1a..5766bd4 100644
--- a/core/sqf/monitor/linux/internal.h
+++ b/core/sqf/monitor/linux/internal.h
@@ -39,6 +39,7 @@ enum InternalType
     InternalType_Exit,              // Delete process for monitor
     InternalType_IoData,            // Stdin/Stdout data for a process
     InternalType_Kill,              // Kill monitored process
+    InternalType_NodeName,          // Node Name Change 
     InternalType_Notify,            // Register for monitoring of process death
     InternalType_Process,           // Add process to monitor
     InternalType_ProcessInit,       // Process fork completed
@@ -140,6 +141,13 @@ struct down_def
     int pnid;                       // Physical node id
 };
 
+struct nodename_def
+{
+    char current_name[MAX_PROCESS_NAME];
+    char new_name[MAX_PROCESS_NAME];
+};
+
+
 struct shutdown_def
 {
     int level;                      // shutdown level
@@ -362,6 +370,7 @@ struct internal_msg_def
         struct event_def   event;
         ioData_t           iodata;
         struct kill_def    kill;
+	struct nodename_def  nodename;
         struct notify_def  notify;
         struct process_def process;
         struct process_init_def processInit;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/makefile b/core/sqf/monitor/linux/makefile
index 6a9efac..ef9316b 100755
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@ -48,7 +48,7 @@ FLAGS+= -UNDEBUG
 FLAGS+= -Wall -Wextra
 
 # Flags for use in compiling Seabed trace modules
-SBFLAGS = -Wall -Wextra -pedantic -Werror  -Wno-long-long $(DBG_FLGS) $(OPTIM_FLGS)
+SBFLAGS = -Wall -Wextra -pedantic -Werror  -Wno-long-long $(DBG_FLGS) $(OPTIM_FLGS) -Xlinker --copy-dt-needed-entries
 SBDIR = ../../src/seabed/src
 
 COMMONLOGGERDIR = ../../commonLogger
@@ -84,6 +84,7 @@ INCLUDES+= -I$(LOG4CXX_INC_DIR)/log4cxx
 
 LIBS+=  -lsqlite3
 LIBS+=  -llog4cxx
+LIBS+=  -ldl
 
 ifeq ($(USE_TESTPOINTS),1)
    FLAGS+= -DUSE_TESTPOINTS
@@ -130,6 +131,7 @@ MONITORSRC += reqmount.cxx
 MONITORSRC += reqnewproc.cxx
 MONITORSRC += reqnodedown.cxx
 MONITORSRC += reqnodeinfo.cxx
+MONITORSRC += reqnodename.cxx
 MONITORSRC += reqnodeup.cxx
 MONITORSRC += reqnotify.cxx
 MONITORSRC += reqopen.cxx
@@ -189,6 +191,7 @@ MONITOROBJS += $(OUTDIR)/reqmount.o
 MONITOROBJS += $(OUTDIR)/reqnewproc.o
 MONITOROBJS += $(OUTDIR)/reqnodedown.o
 MONITOROBJS += $(OUTDIR)/reqnodeinfo.o
+MONITOROBJS += $(OUTDIR)/reqnodename.o
 MONITOROBJS += $(OUTDIR)/reqpnodeinfo.o
 MONITOROBJS += $(OUTDIR)/reqnodeup.o
 MONITOROBJS += $(OUTDIR)/reqnotify.o

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/mlio.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/mlio.cxx b/core/sqf/monitor/linux/mlio.cxx
index 20c4c02..47deba3 100644
--- a/core/sqf/monitor/linux/mlio.cxx
+++ b/core/sqf/monitor/linux/mlio.cxx
@@ -113,7 +113,8 @@ const int SQ_LocalIOToClient::serviceRequestSize[] = {
    sizeof(REQTYPE) + sizeof( TmSync_def ),          // ReqType_TmSync
    sizeof(REQTYPE) + sizeof( TransInfo_def ),       // ReqType_TransInfo
    sizeof(REQTYPE) + sizeof( MonStats_def ),        // ReqType_MonStats
-   sizeof(REQTYPE) + sizeof( ZoneInfo_def )         // ReqType_ZoneInfo
+   sizeof(REQTYPE) + sizeof( ZoneInfo_def ),        // ReqType_ZoneInfo
+   sizeof(REQTYPE) + sizeof( NodeName_def )         // ReqType_NodeName
 };
 
 // The serviceReplySize array holds the size of the request messages for
@@ -136,7 +137,8 @@ const int SQ_LocalIOToClient::serviceReplySize[] = {
    sizeof(REPLYTYPE) + sizeof( Startup_reply_def ),     // ReplyType_Startup
    sizeof(REPLYTYPE) + sizeof( Mount_reply_def ),       // ReplyType_Mount
    sizeof(REPLYTYPE) + sizeof( MonStats_reply_def ),    // ReplyType_MonStats
-   sizeof(REPLYTYPE) + sizeof( ZoneInfo_reply_def )     // ReplyType_ZoneInfo
+   sizeof(REPLYTYPE) + sizeof( ZoneInfo_reply_def ),    // ReplyType_ZoneInfo
+   sizeof(REPLYTYPE) + sizeof( NodeName_reply_def )     // ReplyType_NodeName
 };
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index b1115fc..31f7928 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -35,6 +35,9 @@ using namespace std;
 #include <unistd.h>
 #include <malloc.h>
 #include <sys/ipc.h>
+#include <sys/time.h>
+#include <sys/resource.h> //add for getrlimit, strange centos6/gcc4.4 don't need this
+
 //#include <sys/stat.h>
 #include "monlogging.h"
 #include "monprof.h"
@@ -927,6 +930,12 @@ int main (int argc, char *argv[])
     SnmpLog->setPNid( MyPNID );
 
     gethostname(Node_name, MPI_MAX_PROCESSOR_NAME);
+    char *tmpptr = Node_name;
+    while ( *tmpptr )
+    {
+        *tmpptr = (char)tolower( *tmpptr );
+        tmpptr++;
+    }
 
 #ifdef MULTI_TRACE_FILES
     setThreadVariable( (char *)"mainThread" );

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index 5941950..2fc18b1 100755
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -257,6 +257,7 @@ typedef enum {
     ReqType_TransInfo,                      // request transaction enlistment information
     ReqType_MonStats,                       // get monitor statistics
     ReqType_ZoneInfo,                       // zone information request 
+    ReqType_NodeName,                       // change node name request
 
     ReqType_Invalid                         // marks the end of the request
                                             // types, add any new request types 
@@ -285,6 +286,7 @@ typedef enum {
     ReplyType_Mount,                        // reply with mount info
     ReplyType_MonStats,                     // reply with monitor statistics
     ReplyType_ZoneInfo,                     // reply with info on list of zones
+    ReplyType_NodeName,                     // reply with results
 
 
     ReplyType_Invalid                       // marks the end of the reply types,
@@ -605,6 +607,19 @@ struct NodeInfo_reply_def
     bool continuation;                      // true if continuation of earlier request
 };
 
+struct NodeName_def
+{
+    int nid;                                    // node id of requesting process
+    int pid;                                    // process id of requesting process
+    char new_name[MPI_MAX_PROCESSOR_NAME];      // get information on node id (-1 for all)
+    char current_name[MPI_MAX_PROCESSOR_NAME];  // current name of node (validation)
+};
+
+struct NodeName_reply_def
+{
+    int return_code;                        // error returned to sender
+};
+
 struct NodeJoining_def
 {
     int  pnid;
@@ -1059,6 +1074,7 @@ struct request_def
         struct PNodeInfo_def         pnode_info;
         struct SpareUp_def           spare_up;
         struct NodeReInt_def         reintegrate;
+        struct NodeName_def          nodename;
     } u;
 };
 
@@ -1088,6 +1104,7 @@ struct reply_def
         struct Close_reply_def         close;
         struct MonStats_reply_def      mon_info;
         struct ZoneInfo_reply_def      zone_info;
+        struct NodeName_reply_def      nodename;
     } u;
 };
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/phnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/phnode.h b/core/sqf/monitor/linux/phnode.h
index 937939f..b029ada 100755
--- a/core/sqf/monitor/linux/phnode.h
+++ b/core/sqf/monitor/linux/phnode.h
@@ -55,6 +55,8 @@ public:
     inline const char *GetName( void ) { return( name_.c_str() ); }
     inline NodeState_t GetState( void ) { return( state_ ); }
     inline void    SetState( NodeState_t state ) { state_ = state; }
+    inline void SetName( const char * newName ) { if (newName) name_ = newName; } 
+ 
 
 private:
     string          name_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index ab81b2d..dda44f2 100755
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -1528,6 +1528,14 @@ void CNodeContainer::AddNodes( )
     int pnid;
     int rank;
     int *sparePNids = NULL;
+    
+    //  only relevant on a workstation acting as a single node
+    const char* envVar = getenv("SQ_MAX_RANK"); 
+    int maxNode;
+    if (envVar != NULL)
+      maxNode = atoi (envVar);
+    else
+      maxNode = MAX_NODES; 
 
     CPNodeConfig *pnodeConfig = clusterConfig_->GetFirstPNodeConfig();
     for ( ; pnodeConfig; pnodeConfig = pnodeConfig->GetNext() )
@@ -1561,6 +1569,8 @@ void CNodeContainer::AddNodes( )
         }
         else
         {
+           if (pnid >= maxNode) // only for workstation acting as single node
+              rank = -1;
             node = new CNode( (char *)pnodeConfig->GetName(), pnid, rank );
             assert( node != NULL );
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index 9bfe655..0cc6fd3 100755
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -285,6 +285,7 @@ public:
     inline void SetTmSyncNid( int nid ) { tmSyncNid_ = nid; }
     inline void SetTmSyncState( SyncState syncState ) { tmSyncState_ = syncState; }
     inline void SetZone( int zid ) { zid_ = zid; }
+    inline void SetName( char *newName ) { if (newName) strcpy (name_, newName); }
     void StartPStartDProcess( void );
     void StartPStartDPersistent( void );
     void StartPStartDPersistentDTM( int nid );

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/pnodeconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnodeconfig.cxx b/core/sqf/monitor/linux/pnodeconfig.cxx
index 3c20ef6..6647601 100755
--- a/core/sqf/monitor/linux/pnodeconfig.cxx
+++ b/core/sqf/monitor/linux/pnodeconfig.cxx
@@ -292,6 +292,12 @@ int CPNodeConfigContainer::GetPNid( char *nodename )
     return( pnid );
 }
 
+void CPNodeConfig::SetName( char *newName ) 
+{ 
+    if (newName) 
+      strcpy(name_, newName); 
+} 
+
 CPNodeConfig *CPNodeConfigContainer::GetPNodeConfig( int pnid )
 {
     CPNodeConfig *config;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/pnodeconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnodeconfig.h b/core/sqf/monitor/linux/pnodeconfig.h
index 939c898..f4c7fb1 100755
--- a/core/sqf/monitor/linux/pnodeconfig.h
+++ b/core/sqf/monitor/linux/pnodeconfig.h
@@ -77,7 +77,7 @@ public:
     inline const char   *GetName( void ) { return ( name_ ); }
     inline CPNodeConfig *GetNext( void ) { return ( next_ ); }
     inline int           GetPNid( void ) { return ( pnid_ ); }
-
+    void                 SetName( char *newName ); 
     int                  GetSpareList( int sparePNid[] );
     inline int           GetSparesCount( void ) { return ( sparePNidsCount_ ); }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/replicate.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.cxx b/core/sqf/monitor/linux/replicate.cxx
index 895cf94..fb2565f 100755
--- a/core/sqf/monitor/linux/replicate.cxx
+++ b/core/sqf/monitor/linux/replicate.cxx
@@ -68,7 +68,7 @@ void CReplObj::validateObj()
 // Determine the maximum size of a replication object (excluding CReplEvent)
 int CReplObj::calcAllocSize()
 {
-    return  max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(sizeof(CReplSoftNodeUp),
+    return  max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(sizeof(CReplSoftNodeUp),
                                                                                 sizeof(CReplSoftNodeDown)),
                                                                             sizeof(CReplSchedData)),
                                                                         sizeof(CReplActivateSpare)),
@@ -81,6 +81,7 @@ int CReplObj::calcAllocSize()
                                             sizeof(CReplKill)),
                                         sizeof(CReplDevice)),
                                     sizeof(CReplNodeDown)),
+                                  sizeof(CReplNodeName)),
                                 sizeof(CReplNodeUp)),
                             sizeof(CReplDump)),
                         sizeof(CReplDumpComplete)),
@@ -1208,6 +1209,59 @@ bool CReplShutdown::replicate(struct internal_msg_def *&msg)
     return true;
 }
 
+CReplNodeName::CReplNodeName(const char *current_name, const char* new_name)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RPLZ", 4);
+
+    // Compute message size (adjust if needed to conform to
+    // internal_msg_def structure alignment).
+    replSize_ = (MSG_HDR_SIZE + sizeof ( nodename_def ) + msgAlignment_)
+                & ~msgAlignment_;
+
+    if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL))
+    {
+        const char method_name[] = "CReplNodeName::CReplNodeName";
+        trace_printf("%s@%d  - Changing node name, old name =%s, new name = %s\n",
+                     method_name, __LINE__, current_name, new_name);
+    }
+    
+    current_name_ = current_name;
+    new_name_ = new_name;
+}
+
+CReplNodeName::~CReplNodeName()
+{
+    const char method_name[] = "CReplNodeName::~CReplNodeName";
+
+    if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL))
+        trace_printf("%s@%d - Node name change replication\n", method_name, __LINE__ );
+
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rplz", 4);
+}
+
+bool CReplNodeName::replicate(struct internal_msg_def *&msg)
+{
+    const char method_name[] = "CReplNodeName::replicate";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_SYNC | TRACE_PROCESS))
+        trace_printf("%s@%d" " - Changing node name (%s to %s)\n", method_name, __LINE__, current_name_.c_str(), new_name_.c_str());
+
+    // build message to replicate this process kill to other nodes
+    msg->type = InternalType_NodeName;
+    strcpy (msg->u.nodename.new_name, new_name_.c_str());
+    strcpy (msg->u.nodename.current_name, current_name_.c_str());
+
+    // Advance sync buffer pointer
+    Nodes->AddMsg( msg, replSize() );
+
+    TRACE_EXIT;
+
+    return true;
+}
+
 CReplNodeDown::CReplNodeDown(int pnid) : pnid_(pnid)
 {
     // Add eyecatcher sequence as a debugging aid

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/replicate.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.h b/core/sqf/monitor/linux/replicate.h
index 1b7e6ac..92bf985 100755
--- a/core/sqf/monitor/linux/replicate.h
+++ b/core/sqf/monitor/linux/replicate.h
@@ -284,6 +284,20 @@ private:
     int pnid_;
 };
 
+class CReplNodeName: public CReplObj
+{
+public:
+    CReplNodeName(const char *current_name, const char *new_name);
+    virtual ~CReplNodeName();
+
+    bool replicate(struct internal_msg_def *& msg);
+
+private:
+    string current_name_;
+    string new_name_;
+};
+
+
 class CReplNodeUp: public CReplObj
 {
 public:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/reqnodename.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnodename.cxx b/core/sqf/monitor/linux/reqnodename.cxx
new file mode 100644
index 0000000..6c55e23
--- /dev/null
+++ b/core/sqf/monitor/linux/reqnodename.cxx
@@ -0,0 +1,114 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ 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 @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include <stdio.h>
+#include "reqqueue.h"
+#include "montrace.h"
+#include "monsonar.h"
+#include "monlogging.h"
+#include "replicate.h"
+#include "mlio.h"
+
+extern CMonitor *Monitor;
+extern CMonStats *MonStats;
+extern CNodeContainer *Nodes;
+extern CReplicate Replicator;
+extern CNode *MyNode;
+
+
+CExtNodeNameReq::CExtNodeNameReq (reqQueueMsg_t msgType, int pid,
+                          struct message_def *msg )
+    : CExternalReq(msgType, pid, msg)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RQEZ", 4);
+}
+
+CExtNodeNameReq::~CExtNodeNameReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rqez", 4);
+}
+
+void CExtNodeNameReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2] = { 0 };
+
+    snprintf( strBuf, sizeof(strBuf), 
+              "ExtReq(%s) req #=%ld requester(pid=%d)"
+              , CReqQueue::svcReqType[reqType_], getId(), pid_);
+    requestString_.assign( strBuf );
+}
+
+void CExtNodeNameReq::performRequest()
+{
+   const char method_name[] = "CExtNodeNameReq::performRequest";
+    TRACE_ENTRY;
+
+    CNode    *node = NULL;
+
+    // Trace info about request
+     node = Nodes->GetNode(msg_->u.request.u.nodename.current_name); 
+     if (node)
+     {
+           if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+           {
+                 trace_printf("[%s], Requested node name change from %s to %s\n" , method_name, msg_->u.request.u.nodename.current_name, msg_->u.request.u.nodename.new_name);
+           }
+
+           node->SetName(msg_->u.request.u.nodename.new_name);
+
+           CReplNodeName *repl = new CReplNodeName(msg_->u.request.u.nodename.current_name, 
+                                msg_->u.request.u.nodename.new_name);
+           Replicator.addItem(repl);
+           if (!msg_->noreply)  // client needs a reply 
+           {
+                msg_->u.reply.type = ReplyType_NodeInfo;
+                msg_->u.reply.u.generic.return_code = MPI_SUCCESS;
+   
+                // Send reply to requester
+                lioreply(msg_, pid_);
+           }
+        } else 
+        {
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+           {
+                trace_printf("[%s], Internal Error - Requested node name change from %s to %s\n" , method_name, msg_->u.request.u.nodename.current_name, msg_->u.request.u.nodename.new_name);
+           }
+
+            if (!msg_->noreply)  // client needs a reply 
+            {
+                msg_->u.reply.type = ReplyType_NodeInfo;
+                msg_->u.reply.u.generic.return_code = MPI_ERR_UNKNOWN;
+   
+                // Send reply to requester
+                 lioreply(msg_, pid_);
+            }
+	  
+	}
+
+    TRACE_EXIT;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 5fb8e38..fcf7620 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1623,6 +1623,48 @@ void CIntShutdownReq::performRequest()
     TRACE_EXIT;
 }
 
+CIntNodeNameReq::CIntNodeNameReq( const char *current_name, const char *new_name  ) 
+    : CInternalReq()
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RQIZ", 4);
+    new_name_ = new_name;
+    current_name_=current_name;
+}
+
+CIntNodeNameReq::~CIntNodeNameReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rqiz", 4);
+}
+
+void CIntNodeNameReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld"
+                   , CReqQueue::intReqType[InternalType_NodeName]
+                   , getId() );
+    requestString_.assign( strBuf );
+}
+
+void CIntNodeNameReq::performRequest()
+{
+    const char method_name[] = "CIntNodeNameReq::performRequest";
+    TRACE_ENTRY;
+    char current_n[MAX_PROCESS_NAME];
+    char new_n[MAX_PROCESS_NAME];
+    
+    strcpy (current_n, current_name_.c_str());
+    strcpy (new_n, new_name_.c_str());
+
+    CNode    *node = Nodes->GetNode(current_n); 
+    if (node)
+        node->SetName(new_n);
+
+    TRACE_EXIT;
+}
+
+
 CIntDownReq::CIntDownReq( int pnid ) 
     : CInternalReq(),
       pnid_ ( pnid )
@@ -2591,6 +2633,11 @@ CExternalReq *CReqQueue::prepExternalReq(CExternalReq::reqQueueMsg_t msgType,
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
             break;
 
+        case ReqType_NodeName:
+            request = new CExtNodeNameReq(msgType, pid, msg);
+            request->setConcurrent(reqConcurrent[msg->u.request.type]);
+            break;
+   
         case ReqType_ProcessInfo:
             request = new CExtProcInfoReq(msgType, pid, msg);
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
@@ -2916,6 +2963,15 @@ void CReqQueue::enqueueDownReq( int pnid )
     enqueueReq ( request );
 }
 
+void CReqQueue::enqueueNodeNameReq( char *current_name, char *new_name)
+{
+    CInternalReq * request;
+
+    request = new CIntNodeNameReq ( current_name, new_name );
+
+    enqueueReq ( request );
+}
+
 void CReqQueue::enqueueSoftNodeDownReq( int pnid )
 {
     CInternalReq * request;
@@ -3565,7 +3621,8 @@ const bool CReqQueue::reqConcurrent[] = {
    false,    // ReqType_TmSync
    false,    // ReqType_TransInfo
    true,     // ReqType_MonStats
-   true      // ReqType_ZoneInfo
+   true,     // ReqType_ZoneInfo
+   false     // ReqType_NodeName
 };
 #endif
 
@@ -3602,6 +3659,7 @@ const bool CReqQueue::reqConcurrent[] = {
    false,    // ReqType_TransInfo
    false,    // ReqType_MonStats
    false,    // ReqType_ZoneInfo
+   false,    // ReqType_NodeName 
    false     // ReqType_Invalid
 };
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.h b/core/sqf/monitor/linux/reqqueue.h
index 43e008e..4f5a21b 100755
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@ -220,6 +220,20 @@ private:
     void populateRequestString( void );
 };
 
+class CExtNodeNameReq: public CExternalReq
+{
+public:
+    CExtNodeNameReq (reqQueueMsg_t msgType, int pid,
+                 struct message_def *msg );
+    virtual ~CExtNodeNameReq();
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+};
+
+
 class CExtEventReq: public CExternalReq
 {
 public:
@@ -849,6 +863,21 @@ private:
     int level_;
 };
 
+class CIntNodeNameReq: public CInternalReq
+{
+public:
+    CIntNodeNameReq( const char *current_name, const char *new_name );
+    virtual ~CIntNodeNameReq();
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    string current_name_;
+    string new_name_;
+};
+
 class CIntDownReq: public CInternalReq
 {
 public:
@@ -1027,6 +1056,7 @@ class CReqQueue
     void enqueueChildDeathReq ( pid_t pid );
     void enqueueAttachedDeathReq ( pid_t pid );
     void enqueueDownReq( int pnid );
+    void enqueueNodeNameReq( char *current_name, char *new_name);
     void enqueueSoftNodeDownReq( int pnid );
     void enqueueSoftNodeUpReq( int pnid );
     void enqueueShutdownReq( int level );
@@ -1157,7 +1187,7 @@ private:
       RQEW   CExtZoneInfoReq
       RQEX   (unused)
       RQEY   (unused)
-      RQEZ   (unused)
+      RQEZ   CExtNodeNameReq
       RQE_   CExtNullReq
 
  */

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 7727c80..c30f1da 100755
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -183,14 +183,26 @@ bool init_pnode_map( void )
     pnodeConfig = ClusterConfig.GetFirstPNodeConfig();
     for ( ; pnodeConfig; pnodeConfig = pnodeConfig->GetNext() )
     {
-        // TEST_POINT: to force state down on node name 
-        NodeState_t nodeState = StateUp;
-        const char *downNodeName = getenv( TP001_NODE_DOWN );
-        if ( downNodeName != NULL && 
-            !strcmp( downNodeName, pnodeConfig->GetName() ) )
-        {
-            nodeState = StateDown;
-        }
+        // TEST_POINT and exclude list : to force state down on node name
+         NodeState_t nodeState = StateUp;
+         const char *downNodeName = getenv( TP001_NODE_DOWN );
+         const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+	 string downNodeString = " ";
+	 if (downNodeList)
+	 {
+	   downNodeString += downNodeList;
+	   downNodeString += " ";
+	 }
+	 string downNodeToFind = " ";
+	 downNodeToFind += pnodeConfig->GetName();
+	 downNodeToFind += " ";
+         if (((downNodeList != NULL) && 
+	    (strstr(downNodeString.c_str(),downNodeToFind.c_str()))) ||
+            ( downNodeName != NULL && 
+             !strcmp( downNodeName, pnodeConfig->GetName() ) ))
+         {
+             nodeState = StateDown;
+         }
 
         // effectively remove spare nodes on startup only
         if ( SpareNodeColdStandby && pnodeConfig->IsSpareNode() )
@@ -2822,7 +2834,7 @@ void help_cmd (void)
     printf ("[%s] -- ls [{[detail]}] [<path>]\n", MyName);
     printf ("[%s] -- measure | measure_cpu\n", MyName);
     printf ("[%s] -- monstats\n", MyName);
-    printf ("[%s] -- node [info [<nid>]]\n", MyName);
+    printf ("[%s] -- node [[info [<nid>]] | [name <old name> <new name>]]\n", MyName);
     printf ("[%s] -- path [<directory>[,<directory>]...]\n", MyName);
     printf ("[%s] -- ps [{ASE|TSE|DTM|AMP|BO|VR|CS}] [<process_name>|<nid,pid>]\n", MyName);
     printf ("[%s] -- pwd\n", MyName);
@@ -3069,6 +3081,103 @@ const char *zone_type_string( ZoneType type )
     return( str );
 }
 
+void changeNodeName (char *current_name, char *new_name)
+{
+  
+    if ((current_name == NULL) || (new_name == NULL))
+    {
+         printf( "[%s] Error: Invalid node name while attempting to change node name.\n", MyName );           
+         return;
+    }
+    int count;
+    MPI_Status status;
+    CPhysicalNode  *physicalNode;
+    PhysicalNodeNameMap_t::iterator it;
+    pair<PhysicalNodeNameMap_t::iterator, bool> pnmit;
+
+    // Look up name
+    it = PhysicalNodeMap.find( current_name );
+
+    if (it != PhysicalNodeMap.end())
+    {
+        physicalNode = it->second;
+        if (physicalNode)
+        {
+           CPhysicalNode  *newPhysicalNode = new CPhysicalNode( new_name, physicalNode->GetState() );
+           if (newPhysicalNode == NULL)
+          {
+               printf( "[%s] Error: Internal error with configuration while changing node name.\n", MyName );           
+              return;
+           }
+           //remove and read
+           PhysicalNodeMap.erase(current_name);
+           pnmit = PhysicalNodeMap.insert( PhysicalNodeNameMap_t::value_type 
+                                            ( newPhysicalNode->GetName(), newPhysicalNode ));
+           if (pnmit.second == false)
+           {   // Already had an entry with the given key value.  
+                printf( "[%s] Error: Internal error while changing node name. Node name exists, node name=%s\n", MyName, new_name );
+                return;
+           }
+        }
+        else
+        {
+           printf( "[%s] Error: Internal error while changing node name.  Node name=%s\n", MyName,new_name );           
+           return;
+        }
+    }
+    else
+    {
+        printf( "[%s] Error: Internal error while changing node name.  Node name=%s\n", MyName, new_name );           
+        return;
+    }
+    
+    // change in another local location
+    int pnid = ClusterConfig.GetPNid (current_name); 
+    CPNodeConfig *pConfig = ClusterConfig.GetPNodeConfig (pnid); 
+    if (pConfig != NULL) 
+        pConfig->SetName(new_name);
+      
+     //and..... in another local location
+     for( int i=0; i<NumNodes; i++)
+     {
+        if ( strcmp (PNode[i], current_name) == 0)
+           strcpy(PNode[i],new_name);
+     }       
+    
+     // now change it in the monitors
+     if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+     {   // Could not acquire a message buffer
+         printf ("[%s] Unable to acquire message buffer.\n", MyName);
+         return;
+     }
+
+     msg->type = MsgType_Service;
+     msg->noreply = false;
+     msg->reply_tag = REPLY_TAG;
+     msg->u.request.type = ReqType_NodeName;
+     msg->u.request.u.nodename.nid = MyNid;
+     msg->u.request.u.nodename.pid = MyPid;
+     strcpy (msg->u.request.u.nodename.new_name, new_name);
+     strcpy (msg->u.request.u.nodename.current_name, current_name);
+  
+     gp_local_mon_io->send_recv( msg );
+     count = sizeof( *msg );
+     status.MPI_TAG = msg->reply_tag;
+ 
+     if ((status.MPI_TAG == REPLY_TAG) &&
+            (count == sizeof (struct message_def)))
+     {
+        if ((msg->type == MsgType_Service) &&
+            (msg->u.reply.type == ReplyType_NodeName))
+            {
+                if (msg->u.reply.u.node_info.return_code != MPI_SUCCESS)
+                   printf ("[%s] Unable to change node name in monitors.\n", MyName);
+            }
+     }
+     else
+       printf ("[%s] Invalid Message/Reply type for Node Name Change request.\n", MyName);
+}
+
 void listNodeInfo( int nid )
 {
     int i;
@@ -3083,6 +3192,14 @@ void listNodeInfo( int nid )
         return;
     }
 
+    const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+    string downNodeString = " ";
+    if (downNodeList)
+    {
+      downNodeString += downNodeList;
+      downNodeString += " ";
+    }
+		 
     bool needBanner = true;
     bool getMoreInfo = false;
     do
@@ -3128,6 +3245,20 @@ void listNodeInfo( int nid )
 
                         for (i=0; i < msg->u.reply.u.node_info.num_returned; i++)
                         {
+                             CPNodeConfig *pConfig = ClusterConfig.GetPNodeConfig (msg->u.reply.u.node_info.node[i].pnid);
+			     
+			     if (pConfig != NULL)
+			     {
+			       string downNodeToFind = " ";
+	                       downNodeToFind += pConfig->GetName();
+	                       downNodeToFind += " ";
+
+                               if  ((downNodeList != NULL) && strstr(downNodeString.c_str(),downNodeToFind.c_str()))
+                               {
+                                   continue; // We do not want to consider this node since it is in our exclude list
+                               }
+			     }
+
                             if ( last_nid != -1 )
                             {
                                 if ( (msg->u.reply.u.node_info.node[i].pnid != 
@@ -3484,6 +3615,14 @@ void node_cmd (char *cmd_tail)
     char token[MAX_TOKEN];
     char delimiter;
     char *ptr;
+    const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+    string downNodeString = " ";
+    
+    if (downNodeList)
+    {
+	 downNodeString += downNodeList;
+	 downNodeString += " ";
+    }
 
     if (*cmd_tail == '\0')
     {
@@ -3505,9 +3644,14 @@ void node_cmd (char *cmd_tail)
                 }
                 
                 pnodeConfig = lnodeConfig->GetPNodeConfig();
-                if ( lnodeConfig )
+                if ( pnodeConfig )
                 {
-                    printf( "[%s] Node[%d]=%s, %s, %s\n"
+		   string downNodeToFind = " ";
+	           downNodeToFind += pnodeConfig->GetName();
+	           downNodeToFind += " ";
+     
+                   if (((!downNodeList) || ((downNodeList) && !(strstr(downNodeString.c_str(),downNodeToFind.c_str())))))
+                       printf( "[%s] Node[%d]=%s, %s, %s\n"
                           , MyName
                           , i 
                           , pnodeConfig->GetName()
@@ -3521,7 +3665,16 @@ void node_cmd (char *cmd_tail)
     else
     {
         ptr = get_token (cmd_tail, token, &delimiter);
-        if (strcmp (token, "info") == 0)
+        if (strcmp (token, "name") == 0)
+        {
+             char* ptr2 = get_token (ptr, token, &delimiter);
+             if (ptr2 && *ptr2)
+                changeNodeName(token, ptr2);
+             else
+                printf ("[%s] Invalid node name\n", MyName);
+        }
+        else if (strcmp (token, "info") == 0)
+
         {
             if (Started)
             {
@@ -4569,6 +4722,18 @@ bool start_monitor( char *cmd_tail, bool warmstart, bool reintegrate )
     // Ensure that we are on a node that is part of the configuration
     char mynode[MPI_MAX_PROCESSOR_NAME];
     gethostname(mynode, MPI_MAX_PROCESSOR_NAME);
+    //JIRA: TRAFODION-1854, hostname contains upper case letters
+    //change all char in mynode to lowercase
+    //since cluster config strings will all in lowercase , see CTokenizer::NormalizeCase()
+    if(!VirtualNodes)  // for VirtualNodes, it use same gethostname, so do not tolower
+    {
+      char *tmpptr = mynode;
+      while ( *tmpptr )
+      {
+        *tmpptr = tolower( *tmpptr );
+	tmpptr++;
+      }
+    }
     bool nodeInConfig = false;
     for ( i = 0; i < NumNodes; i++ )
     {
@@ -6137,6 +6302,12 @@ int main (int argc, char *argv[])
     else
     {
         gethostname(MyNode, MPI_MAX_PROCESSOR_NAME);
+        char *tmpptr = MyNode;
+        while ( *tmpptr )
+        {
+            *tmpptr = (char)tolower( *tmpptr );
+            tmpptr++;
+        }
         if ( !load_nodes() )
         {
             exit (1);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/monitor/linux/testpoint.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/testpoint.h b/core/sqf/monitor/linux/testpoint.h
index 4125b7b..058a36f 100755
--- a/core/sqf/monitor/linux/testpoint.h
+++ b/core/sqf/monitor/linux/testpoint.h
@@ -32,7 +32,7 @@
 
 // Startup in real cluster with down node simulation
 #define TP001_NODE_DOWN  "MON_TP_NODE_DOWN"     // down node name at startup
-
+#define TRAF_EXCLUDE_LIST  "TRAF_EXCLUDE_LIST"     // exclude node
 // Node re-integration failure testpoints
 //   Roles:
 //     new      - new monitor created by shell 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 4364d2e..bfec256 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -150,6 +150,13 @@ export THRIFT_DEP_VER=0.9.0
 export HBASE_TRX_ID_CDH=hbase-trx-cdh5_4
 export HBASE_TRX_ID_APACHE=hbase-trx-apache1_0_2
 export HBASE_TRX_ID_HDP=hbase-trx-hdp2_3
+export HIVE_DEP_VER=0.13.1
+export HADOOP_DEP_VER=2.6.0
+
+
+# staged build-time dependencies
+export HADOOP_BLD_LIB=${TOOLSDIR}/hadoop-${HADOOP_DEP_VER}/lib/native
+export HADOOP_BLD_INC=${TOOLSDIR}/hadoop-${HADOOP_DEP_VER}/include
 
 # general Hadoop & TRX dependencies - not distro specific, choose one to build against
 export HBASE_TRXDIR=$MY_SQROOT/export/lib
@@ -172,6 +179,7 @@ if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
     export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
 
+
 # check for workstation env
 # want to make sure SQ_VIRTUAL_NODES is set in the shell running sqstart
 # so we can determine if we are on a workstation or not

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index e826c99..58ccd06 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -21,7 +21,6 @@
 #
 # @@@ END COPYRIGHT @@@
 #
-require "ctime.pl";
 use sqnodes;
 use POSIX;
 use DBI;
@@ -145,6 +144,10 @@ my $DBH = 0;
 # instance type
 my $instanceType = "";
 
+sub getTime {
+    return strftime("%a %b %d %H:%M:%S %Y\n", localtime(time));
+}
+
 sub printScript {
     ($dWhich, @rest) = @_;
 
@@ -199,7 +202,7 @@ sub printRMSCheckScript{
 }
 
 sub printTime {
-    printScript(1, "# Trafodion Startup script generated @ ",&ctime(time),"\n");
+    printScript(1, "# Trafodion Startup script generated @ ",getTime(),"\n");
 }
 
 sub validate_config_script {
@@ -479,24 +482,7 @@ sub genComponentWait {
     printScript(1, "fi\n");
 }
 
-sub genLOBConfig {
 
-    # Generate sqconfig.db config for LOB.
-    # This allows the process startup daemon (pstartd)
-    # to start it up after a node failure.
-    for ($i=0; $i < $gdNumNodes; $i++) {
-	my $l_progname="mxlobsrvr";
-	my $l_procargs="";
-	my $l_procname="\$ZLOBSRV$i";
-	my $l_procname_config = sprintf('$ZLOBSRV%d', $i);
-	my $l_stdout="stdout_\$ZLOBSRV_$i";
-	addDbProcData($l_procname_config, "PERSIST_RETRIES", "10,60");
-	addDbProcData($l_procname_config, "PERSIST_ZONES", $i);
-	addDbPersistProc($l_procname_config, $i, 1);
-	addDbProcDef( $ProcessType_Generic, $l_procname_config, $i, $l_progname, $l_stdout, $l_procargs);
-    }
-
-}
 
 sub genIdTmSrv {
     if ($SQ_IDTMSRV > 0) {
@@ -575,6 +561,24 @@ sub genDTM {
     printScript(1, "done\n");
     printScript(1, "echo \"The Transaction Service is Ready.\"\n");
 }
+sub genLOBConfig {
+
+    # Generate sqconfig.db config for LOB.
+    # This allows the process startup daemon (pstartd)
+    # to start it up after a node failure.
+    for ($i=0; $i < $gdNumNodes; $i++) {
+	my $l_progname="mxlobsrvr";
+	my $l_procargs="";
+	my $l_procname="\$ZLOBSRV$i";
+	my $l_procname_config = sprintf('$ZLOBSRV%d', $i);
+	my $l_stdout="stdout_\$ZLOBSRV_$i";
+	addDbProcData($l_procname_config, "PERSIST_RETRIES", "10,60");
+	addDbProcData($l_procname_config, "PERSIST_ZONES", $i);
+	addDbPersistProc($l_procname_config, $i, 1);
+	addDbProcDef( $ProcessType_Generic, $l_procname_config, $i, $l_progname, $l_stdout, $l_procargs);
+    }
+
+}
 
 sub genSSMPCommand {
 
@@ -660,30 +664,30 @@ sub generateRMS {
     
     #generate rmsstart and rmsstop scripts
     printRMSScript(0, "#!/bin/sh\n");
-    printRMSScript(0, "# SQ config/utility file generated @ ",&ctime(time),"\n");
+    printRMSScript(0, "# SQ config/utility file generated @ ",getTime(),"\n");
     printRMSScript(0, "\n# Start the RMS processes\n");
     printRMSScript(0, "sscpstart\n");
     printRMSScript(0, "ssmpstart\n");
 
     printRMSStopScript(0, "#!/bin/sh\n");
-    printRMSStopScript(0, "# SQ config/utility file generated @ ",&ctime(time),"\n");
+    printRMSStopScript(0, "# SQ config/utility file generated @ ",getTime(),"\n");
     printRMSStopScript(0, "\n# Stop the RMS processes\n");
     printRMSStopScript(0, "ssmpstop\n");
     printRMSStopScript(0, "sscpstop\n");
 
     #generate ssmpstart, ssmpstop, sscpstart, sscpstop scripts
     printRMSScript(1, "#!/bin/sh\n");
-    printRMSScript(1, "# SQ config/utility file generated @ ",&ctime(time),"\n");
+    printRMSScript(1, "# SQ config/utility file generated @ ",getTime(),"\n");
     printRMSScript(2, "\n# Start the SSMP processes\n");
     printRMSScript(3, "\n# Start the SSCP processes\n");
 
     printRMSStopScript(1, "#!/bin/sh\n");
-    printRMSStopScript(1, "# SQ config/utility file generated @ ",&ctime(time),"\n");
+    printRMSStopScript(1, "# SQ config/utility file generated @ ",getTime(),"\n");
     printRMSStopScript(1, "sqshell -a << eof\n"); 
     printRMSStopScript(2, "\n!Stop the SSMP processes\n");
     printRMSStopScript(3, "\n!Stop the SSCP processes\n");
 
-    printRMSCheckScript(1, "-- SQ config/utility file generated @ ",&ctime(time),"\n");
+    printRMSCheckScript(1, "-- SQ config/utility file generated @ ",getTime(),"\n");
     printRMSCheckScript(1, "prepare rms_check from select current_timestamp, \n");
     printRMSCheckScript(1, "cast('Node' as varchar(5)), \n");
     printRMSCheckScript(1, "cast(tokenstr('nodeId:', variable_info) as varchar(3)) node, \n");
@@ -1028,7 +1032,7 @@ sub printInitLinesAuxFiles {
     my $file_ptr  = @_[0];
 
     print $file_ptr "#!/bin/sh\n";
-    print $file_ptr "# SQ config/utility file generated @ ", &ctime(time), "\n";
+    print $file_ptr "# SQ config/utility file generated @ ", getTime(), "\n";
 }
 
 sub openFiles {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/genstats.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/genstats.sh b/core/sqf/sql/scripts/genstats.sh
new file mode 100755
index 0000000..7d7a7f0
--- /dev/null
+++ b/core/sqf/sql/scripts/genstats.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#-- @@@ 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 @@@
+#
+# This script generates the run-time stats for all the queries currently running.
+# The statistics outputs are channeled to stdout.
+#
+# If no argument is given, the per-operator run-time stats are generated. If arguments
+# are given, they are passed to the SQL command "get statistics for qid" without 
+# modification. A common argument is 'default', which generates the per-table stats.
+
+lso=$MY_SQROOT/export/limited-support-tools/LSO
+
+qids=`$lso/offender -s active -t 10 | grep -o 'MXID[^ ]*'`
+
+for qid in $qids 
+do
+  if [ $# = 0 ]; then
+    echo "get statistics for qid $qid ;" | sqlci
+  else
+    echo "get statistics for qid $qid $*;" | sqlci
+  fi
+done
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/get_libhdfs_files
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/get_libhdfs_files b/core/sqf/sql/scripts/get_libhdfs_files
index abe92d2..55d7197 100755
--- a/core/sqf/sql/scripts/get_libhdfs_files
+++ b/core/sqf/sql/scripts/get_libhdfs_files
@@ -23,6 +23,11 @@
 # This script downloads and/or makes the required libhdfs files
 # to be able to build Trafodion, which acts as a libhdfs client.
 #
+# This script is now redundant, given that install/traf_tools_setup.sh
+# puts the libhdfs dependency in TOOLSDIR. This is now just a
+# transitional script until build environment is updated to include
+# these files as prerequisite.
+#
 # Basically, what we need are three files:
 #
 # hdfs.h       (copied to $TGT_INC_DIR)
@@ -37,10 +42,11 @@ fi
 LOGFILE=${LIBHDFS_TEMP_DIR}/build.log
 
 # Hadoop source tar file to build libhdfs from
-HADOOP_SRC_MIRROR_URL=https://archive.apache.org/dist/hadoop/common/hadoop-2.6.0
-HADOOP_ID=hadoop-2.6.0
+HADOOP_ID=hadoop-${HADOOP_DEP_VER}
+HADOOP_MIRROR_URL=https://archive.apache.org/dist/hadoop/common/${HADOOP_ID}
 HADOOP_SRC_ID=${HADOOP_ID}-src
 HADOOP_SRC_TAR=${HADOOP_SRC_ID}.tar.gz
+HADOOP_BIN_TAR=${HADOOP_ID}.tar.gz
 
 # files to build required version of Google Protocol Buffers
 PROTOBUF_MIRROR_URL=https://github.com/google/protobuf/releases/download/v2.5.0
@@ -56,11 +62,13 @@ TGT_INC_DIR=$MY_SQROOT/export/include
 TGT_LIB_DIR=$MY_SQROOT/export/lib${SQ_MBTYPE}
 
 FORCE_BUILD=false
+SOURCE_BUILD=false
 VERBOSE=false
 
 usage() {
   echo "Usage: $0"
   echo "    [ -f | --force ]"
+  echo "    [ -s | --source ]"
   echo "    [ -v | --verbose ]"
   echo "    [ -d <temp dir> | --tempDir <temp dir> ]"
 }
@@ -74,6 +82,10 @@ do
        FORCE_BUILD=true
        ;;
 
+    -s|--source)
+       SOURCE_BUILD=true
+       ;;
+
     -v|--verbose)
        VERBOSE=true
        ;;
@@ -99,8 +111,9 @@ do
 done
 
 
-if [[ $FORCE_BUILD == true || \
-      ! -e ${TGT_INC_DIR}/hdfs.h || \
+if [[ $FORCE_BUILD == true ||
+      ! -e ${TGT_INC_DIR}/hdfs.h ||
+      ! -e ${TGT_LIB_DIR}/libhadoop.so ||
       ! -e ${TGT_LIB_DIR}/libhdfs.so ]]; then
 
   if [[ ! -d $LIBHDFS_TEMP_DIR ]]; then
@@ -110,113 +123,141 @@ if [[ $FORCE_BUILD == true || \
       exit 1
     fi
   fi
-
   cd $LIBHDFS_TEMP_DIR
 
-  PROTOBUF_VER=`protoc --version 2>/dev/null | cut -f 2 -d ' '`
+  if [[ $SOURCE_BUILD != true ]]; then
+    echo "Downloading Hadoop-common binary distro..." | tee -a ${LOGFILE}
+    wget ${HADOOP_MIRROR_URL}/${HADOOP_BIN_TAR} 2>&1 >>${LOGFILE}
+    tar -xzf $HADOOP_BIN_TAR  \
+       $HADOOP_ID/lib/native/libhadoop\*so\* \
+       $HADOOP_ID/lib/native/libhdfs\*so\* \
+       $HADOOP_ID/include/hdfs.h
+
+    cp -f ${HADOOP_ID}/include/hdfs.h ${TGT_INC_DIR}
+    cp -Pf ${HADOOP_ID}/lib/native/libhdfs*.so* ${TGT_LIB_DIR}
+    cp -Pf ${HADOOP_ID}/lib/native/libhadoop*.so* ${TGT_LIB_DIR}
+
+  else
+
+    PROTOBUF_VER=`protoc --version 2>/dev/null | cut -f 2 -d ' '`
+
+    # download and build protoc v2.5.0 if not already in the path
+    if [[ "$PROTOBUF_VER" != "${PROTOBUF_VERSION}" ]]; then
+      if [[ ! -f ${PROTOBUF_TAR} ]]; then
+        echo "Downloading Google Protocol Buffers..." | tee -a ${LOGFILE}
+        wget ${PROTOBUF_MIRROR_URL}/${PROTOBUF_TAR} >${LOGFILE}
+      fi
+
+      if [[ $FORCE_BUILD == true ]]; then
+        rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_ID}
+        rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
+      fi
 
-  # download and build protoc v2.5.0 if not already in the path
-  if [[ "$PROTOBUF_VER" != "${PROTOBUF_VERSION}" ]]; then
-    if [[ ! -f ${PROTOBUF_TAR} ]]; then
-      echo "Downloading Google Protocol Buffers..." | tee -a ${LOGFILE}
-      wget ${PROTOBUF_MIRROR_URL}/${PROTOBUF_TAR} >${LOGFILE}
+      if [[ ! -d ${PROTOBUF_ID} ]]; then
+        echo "Unpacking Google Protocol Buffer tar file..." | tee -a ${LOGFILE}
+        rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
+        tar -xzf ${PROTOBUF_TAR} >>${LOGFILE}
+      fi
+
+      if [[ ! -d $PROTOBUF_TGT_ID ]]; then
+        cd ${PROTOBUF_ID}
+        echo "Building Google Protocol Buffers, this could take a while..." | tee -a ${LOGFILE}
+        if [[ $VERBOSE == true ]]; then
+          ./configure --prefix=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID} 2>&1 | tee -a ${LOGFILE}
+        else
+          ./configure --prefix=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID} 2>&1 >>${LOGFILE}
+        fi
+        if [[ $? != 0 ]]; then
+          echo "Error during configure step, exiting" | tee -a ${LOGFILE}
+          exit 1
+        fi
+        make 2>&1 >>${LOGFILE}
+        if [[ $? != 0 ]]; then
+          echo "Error during make step, exiting" | tee -a ${LOGFILE}
+          exit 1
+        fi
+        # skip the tests
+        # make check 2>&1 >>${LOGFILE}
+        # if [[ $? != 0 ]]; then
+        #   echo "Error during check step, exiting" | tee -a ${LOGFILE}
+        #   exit 1
+        # fi
+        make install 2>&1 >>${LOGFILE}
+        if [[ $? != 0 ]]; then
+          echo "Error during install step, exiting" | tee -a ${LOGFILE}
+          # remove partial results, if any
+          rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
+          exit 1
+        fi
+      fi
+
+      # Tell the Hadoop build to use our custom-built protoc
+      export HADOOP_PROTOC_PATH=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}/bin/protoc
+    fi
+
+    cd $LIBHDFS_TEMP_DIR
+
+    if [[ ! -f ${HADOOP_SRC_TAR} ]]; then
+      echo "Downloading Hadoop tar file ${HADOOP_SRC_TAR}..." | tee -a ${LOGFILE}
+      wget ${HADOOP_MIRROR_URL}/${HADOOP_SRC_TAR} 2>&1 >>${LOGFILE}
     fi
 
     if [[ $FORCE_BUILD == true ]]; then
-      rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_ID}
-      rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
+      rm -rf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}
     fi
 
-    if [[ ! -d ${PROTOBUF_ID} ]]; then
-      echo "Unpacking Google Protocol Buffer tar file..." | tee -a ${LOGFILE}
-      rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
-      tar -xzf ${PROTOBUF_TAR} >>${LOGFILE}
+    if [[ ! -d ${HADOOP_SRC_ID} ]]; then
+      echo "Unpacking Hadoop tar file..." | tee -a ${LOGFILE}
+      tar -xzf ${HADOOP_SRC_TAR}
     fi
 
-    if [[ ! -d $PROTOBUF_TGT_ID ]]; then
-      cd ${PROTOBUF_ID}
-      echo "Building Google Protocol Buffers, this could take a while..." | tee -a ${LOGFILE}
+    if [[ ! -d ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target ]]; then
+      cd ${HADOOP_SRC_ID}
+      echo "Building native library, this will take several minutes..." | tee -a ${LOGFILE}
       if [[ $VERBOSE == true ]]; then
-        ./configure --prefix=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID} 2>&1 | tee -a ${LOGFILE}
+        mvn package -Pdist,native -Dmaven.javadoc.skip=true -DskipTests -Dtar 2>&1 | tee -a ${LOGFILE}
       else
-        ./configure --prefix=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID} 2>&1 >>${LOGFILE}
-      fi
-      if [[ $? != 0 ]]; then
-        echo "Error during configure step, exiting" | tee -a ${LOGFILE}
-        exit 1
+        mvn package -Pdist,native -Dmaven.javadoc.skip=true -DskipTests -Dtar 2>&1 >>${LOGFILE}
       fi
-      make 2>&1 >>${LOGFILE}
       if [[ $? != 0 ]]; then
-        echo "Error during make step, exiting" | tee -a ${LOGFILE}
-        exit 1
-      fi
-      # skip the tests
-      # make check 2>&1 >>${LOGFILE}
-      # if [[ $? != 0 ]]; then
-      #   echo "Error during check step, exiting" | tee -a ${LOGFILE}
-      #   exit 1
-      # fi
-      make install 2>&1 >>${LOGFILE}
-      if [[ $? != 0 ]]; then
-        echo "Error during install step, exiting" | tee -a ${LOGFILE}
-        # remove partial results, if any
-        rm -rf ${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}
+        echo "Error during Maven build step for libhdfs, exiting" | tee -a ${LOGFILE}
         exit 1
       fi
     fi
 
-    # Tell the Hadoop build to use our custom-built protoc
-    export HADOOP_PROTOC_PATH=${LIBHDFS_TEMP_DIR}/${PROTOBUF_TGT_ID}/bin/protoc
-  fi
-
-  cd $LIBHDFS_TEMP_DIR
-
-  if [[ ! -f ${HADOOP_SRC_TAR} ]]; then
-    echo "Downloading Hadoop tar file ${HADOOP_SRC_TAR}..." | tee -a ${LOGFILE}
-    wget ${HADOOP_SRC_MIRROR_URL}/${HADOOP_SRC_TAR} 2>&1 >>${LOGFILE}
-  fi
-
-  if [[ $FORCE_BUILD == true ]]; then
-    rm -rf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}
-  fi
-
-  if [[ ! -d ${HADOOP_SRC_ID} ]]; then
-    echo "Unpacking Hadoop tar file..." | tee -a ${LOGFILE}
-    tar -xzf ${HADOOP_SRC_TAR}
-  fi
-
-  if [[ ! -d ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target ]]; then
-    cd ${HADOOP_SRC_ID}
-    echo "Building native library, this will take several minutes..." | tee -a ${LOGFILE}
+    echo "Copying include file and built libraries to Trafodion export dir..." | tee -a ${LOGFILE}
     if [[ $VERBOSE == true ]]; then
-      mvn package -Pdist,native -Dmaven.javadoc.skip=true -DskipTests -Dtar 2>&1 | tee -a ${LOGFILE}
-    else
-      mvn package -Pdist,native -Dmaven.javadoc.skip=true -DskipTests -Dtar 2>&1 >>${LOGFILE}
-    fi
-    if [[ $? != 0 ]]; then
-      echo "Error during Maven build step for libhdfs, exiting" | tee -a ${LOGFILE}
-      exit 1
+      set -x
     fi
-  fi
-
-  echo "Copying include file and built libraries to Trafodion export dir..." | tee -a ${LOGFILE}
-  if [[ $VERBOSE == true ]]; then
-    set -x
-  fi
-  cp -f ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/include/hdfs.h ${TGT_INC_DIR}
-  cp -Pf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/lib/native/libhdfs*.so* ${TGT_LIB_DIR}
-  cp -Pf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/lib/native/libhadoop*.so* ${TGT_LIB_DIR}
+    cp -f ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/include/hdfs.h ${TGT_INC_DIR}
+    cp -Pf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/lib/native/libhdfs*.so* ${TGT_LIB_DIR}
+    cp -Pf ${LIBHDFS_TEMP_DIR}/${HADOOP_SRC_ID}/hadoop-dist/target/${HADOOP_ID}/lib/native/libhadoop*.so* ${TGT_LIB_DIR}
+  fi # source build
 
   ls -l ${TGT_INC_DIR}/hdfs.h       >> ${LOGFILE}
   ls -l ${TGT_LIB_DIR}/libhdfs.so   >> ${LOGFILE}
   ls -l ${TGT_LIB_DIR}/libhadoop.so >> ${LOGFILE}
 
   # Final check whether all the needed files are there
-  if [[ ! -r ${TGT_INC_DIR}/hdfs.h || \
+  if [[ ! -r ${TGT_INC_DIR}/hdfs.h ||
+        ! -r ${TGT_LIB_DIR}/libhadoop.so ||
         ! -r ${TGT_LIB_DIR}/libhdfs.so ]]; then
     echo "Error, not all files were created" | tee -a ${LOGFILE}
     ls -l ${TGT_INC_DIR}/hdfs.h
     ls -l ${TGT_LIB_DIR}/libhdfs.so
+    ls -l ${TGT_LIB_DIR}/libhadoop.so
     exit 1
   fi
+  # check that we have 64=-bit libs
+  libcheck=0
+  file -L ${TGT_LIB_DIR}/libhdfs.so | grep -q 'ELF 64-bit' || libcheck=1
+  file -L ${TGT_LIB_DIR}/libhadoop.so | grep -q 'ELF 64-bit' || libcheck=1
+  if [[ $libcheck == 1 ]]; then
+    echo "Error, libraries are not 'ELF 64-bit'" | tee -a ${LOGFILE}
+    file -L ${TGT_LIB_DIR}/libhdfs.so
+    file -L ${TGT_LIB_DIR}/libhadoop
+    exit 1
+  fi
+
 fi
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/sqnodeipcrm
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqnodeipcrm b/core/sqf/sql/scripts/sqnodeipcrm
index 1f5ec13..00e9153 100755
--- a/core/sqf/sql/scripts/sqnodeipcrm
+++ b/core/sqf/sql/scripts/sqnodeipcrm
@@ -25,7 +25,7 @@ function rm_shm {
     lv_port_file=$1
     echo "Using Portfile $lv_port_file"
     declare -i lv_virtual_node
-    let lv_virtual_node=`echo $lv_port_file | cut -d '.' -f 3`
+    let lv_virtual_node=`echo $lv_port_file | awk -F/ '{print $NF}' | cut -d '.' -f 3`
     lv_port_no=`cat $lv_port_file | cut -d ':' -f 2`
     #echo "lv_virtual_node=$lv_virtual_node"
     #echo "lv_port_no=$lv_port_no"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqstart b/core/sqf/sql/scripts/sqstart
index 7c63eb1..93e49bd 100755
--- a/core/sqf/sql/scripts/sqstart
+++ b/core/sqf/sql/scripts/sqstart
@@ -542,7 +542,8 @@ dcsstart
 sleep 10
 sqcheck | tee -a $SQMON_LOG
 # Start the LOB Service
-lobstart
+#comment out since it's unused right now
+#lobstart
 # Start the REST Service
 reststart
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/sql/scripts/sqstop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqstop b/core/sqf/sql/scripts/sqstop
index 55cfa84..e4ecbb1 100755
--- a/core/sqf/sql/scripts/sqstop
+++ b/core/sqf/sql/scripts/sqstop
@@ -92,7 +92,7 @@ reststop
 dcsstop
 
 # Stop the lob Service
-lobstop
+#lobstop
 
 # Issue the shutdown request
 echoLog "Shutting down ($shutdowntype) the SQ environment!"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/seabed/src/msmon.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/msmon.cpp b/core/sqf/src/seabed/src/msmon.cpp
index 42f9600..2f41fb5 100644
--- a/core/sqf/src/seabed/src/msmon.cpp
+++ b/core/sqf/src/seabed/src/msmon.cpp
@@ -3818,6 +3818,12 @@ int msg_mon_init_attach(const char *pp_where,
     }
     gethostname(la_host_name, sizeof(la_host_name));
     lp_nodes = getenv(gp_ms_env_sq_vnodes);
+    char *tmpptr = la_host_name;
+    while ( *tmpptr )
+    {
+        *tmpptr = (char)tolower( *tmpptr );
+        tmpptr++;
+    }
     lp_nid = getenv(gp_ms_env_sq_vnid);
     if ((lp_nid != NULL) && *lp_nid)
         lv_nid = atoi(lp_nid);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/seabed/src/sautil.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/sautil.cpp b/core/sqf/src/seabed/src/sautil.cpp
index 30b60da..683bc0e 100644
--- a/core/sqf/src/seabed/src/sautil.cpp
+++ b/core/sqf/src/seabed/src/sautil.cpp
@@ -95,11 +95,6 @@ void SB_SA_Util_assert_fun_com(const char *pp_exp,
                                const char *pp_file,
                                unsigned    pv_line,
                                const char *pp_fun) {
-    pid_t lv_pid;
-    pid_t lv_tid;
-
-    lv_pid = getpid();
-    lv_tid = sb_sa_util_gettid();
     gv_sb_sa_util_save_assert.iv_errno = errno;
     gv_sb_sa_util_save_assert.iv_line = pv_line;
     gv_sb_sa_util_save_assert.iv_lhs = pv_lhs;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/seabed/src/stream.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/stream.cpp b/core/sqf/src/seabed/src/stream.cpp
index 90c5e9c..fccbccd 100644
--- a/core/sqf/src/seabed/src/stream.cpp
+++ b/core/sqf/src/seabed/src/stream.cpp
@@ -353,11 +353,9 @@ void SB_Trans::Trans_Stream::checksum_recv_check(Rd_Type     *pp_rd,
     int   lv_chk;
     int   lv_ctrl_len;
     int   lv_data_len;
-    int   lv_data_off;
     int   lv_inx;
 
     lv_chk = -1;
-    lv_data_off = 0;
     pv_client = pv_client; // touch
     lp_ctrl = pp_rd->ip_ctrl;
     lv_ctrl_len = pp_rd->iv_ctrl_len;



[34/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.cpp b/core/sql/exp/ExpLOB.cpp
index 18470d6..0662ec8 100644
--- a/core/sql/exp/ExpLOB.cpp
+++ b/core/sql/exp/ExpLOB.cpp
@@ -94,7 +94,7 @@ char * ExpLOBoper::ExpGetLOBDescHandleObjNamePrefix(Int64 uid,
   if (outBufLen < 512)
     return NULL;
   
-  str_sprintf(outBuf, "LOBDescHandle_%020Ld", uid);
+  str_sprintf(outBuf, "%s_%020Ld", LOB_DESC_HANDLE_PREFIX,uid);
   
   return outBuf;
 }
@@ -107,8 +107,8 @@ char * ExpLOBoper::ExpGetLOBDescHandleName(Lng32 schNameLen, char * schName,
       (schName == NULL))
     return NULL;
   
-  str_sprintf(outBuf, "%s.\"LOBDescHandle_%020Ld_%04d\"",
-	      schName, uid, num);
+  str_sprintf(outBuf, "%s.\"%s_%020Ld_%04d\"",
+	      schName, LOB_DESC_HANDLE_PREFIX,uid, num);
   
   return outBuf;
 }
@@ -116,7 +116,7 @@ char * ExpLOBoper::ExpGetLOBDescHandleName(Lng32 schNameLen, char * schName,
 Lng32 ExpLOBoper::ExpGetLOBnumFromDescName(char * descName, Lng32 descNameLen)
 {
   // Desc Name Format: LOBDescHandle_%020Ld_%04d
-  char * lobNumPtr = &descName[strlen("LOBDescHandle_") + 20 + 1];
+  char * lobNumPtr = &descName[sizeof(LOB_DESC_HANDLE_PREFIX) + 20 + 1];
   Lng32 lobNum = str_atoi(lobNumPtr, 4);
   
   return lobNum;
@@ -131,26 +131,13 @@ char * ExpLOBoper::ExpGetLOBDescChunksName(Lng32 schNameLen, char * schName,
       (schName == NULL))
     return NULL;
   
-  str_sprintf(outBuf, "%s.\"LOBDescChunks_%020Ld_%04d\"",
-	      schName, uid, num);
+  str_sprintf(outBuf, "%s.\"%s_%020Ld_%04d\"",
+	      schName, LOB_DESC_CHUNK_PREFIX,uid, num);
 
   return outBuf;
 }
 
-char * ExpLOBoper::ExpGetLOBHdrName(Lng32 schNameLen, char * schName,
-				    Int64 uid, Lng32 num, 
-				    char * outBuf, Lng32 outBufLen)
-{
-  if ((outBufLen < 512) ||
-      (schNameLen == 0) ||
-      (schName == NULL))
-    return NULL;
-
-  str_sprintf(outBuf, "%s.\"LOBHdr_%020Ld_%04d\"",
-	      schName, uid, num);
 
-  return outBuf;
-}
 
 char * ExpLOBoper::ExpGetLOBMDName(Lng32 schNameLen, char * schName,
 				    Int64 uid,  
@@ -159,14 +146,14 @@ char * ExpLOBoper::ExpGetLOBMDName(Lng32 schNameLen, char * schName,
   if (outBufLen < 512)
     return NULL;
 
-  str_sprintf(outBuf, "%s.\"LOBMD_%020Ld\"",
-	      schName, uid);
+  str_sprintf(outBuf, "%s.\"%s_%020Ld\"",
+	      schName, LOB_MD_PREFIX,uid);
 
   return outBuf;
 }
 Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap, 
-			    char * lobLoc,
-			    Int64 uid, Lng32 num, Int64 lobMaxSize)
+			    char * lobLoc,Int32 hdfsPort,char *hdfsServer,
+			    Int64 uid, Lng32 num, Int64 lobMaxSize )
 {
   char buf[100];
   
@@ -186,13 +173,114 @@ Lng32 ExpLOBoper::createLOB(void * lobGlob, void * lobHeap,
   else
     lobGlobL = lobGlob;
 
-  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,(char *)"default",lobMaxSize);
+  rc = ExpLOBinterfaceCreate(lobGlobL, lobName, lobLoc, Lob_HDFS_File,hdfsServer,lobMaxSize, hdfsPort);
+
+  return rc;
+}
+void ExpLOBoper::calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries)
+{
+  Int32 i = 0;
+  //Check if there is a hole right up front for the first entry. If so start compacting with the first entry.
+  if (dcArray[0].getCurrentOffset() != 0)
+    {
+      dcArray[0].setNewOffset(0);
+      for (i = 1; i < numEntries; i++)
+        {
+          dcArray[i].setNewOffset(dcArray[i-1].getNewOffset() + dcArray[i-1].getChunkLen());
+        }
+    }
+  else
+    //Look for the first unused section and start compacting from there.
+    {
+      NABoolean done = FALSE;
+      i = 0;
+      Int32 j = 0;
+      while (i < numEntries && !done )
+        {
+          if ((dcArray[i].getCurrentOffset()+dcArray[i].getChunkLen()) != 
+              dcArray[i+1].getCurrentOffset())
+            {
+              j = i+1;
+              while (j < numEntries)
+                {
+                   dcArray[j].setNewOffset(dcArray[j-1].getNewOffset()+dcArray[j-1].getChunkLen());
+                   j++;
+                }
+              done = TRUE;
+            }
+          i++;
+        }
+    }
+  return ;
+}
+
+Lng32 ExpLOBoper::compactLobDataFile(void *lobGlob,ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries,char *tgtLobName,Int64 lobMaxChunkMemSize, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
+{
+  Int32 rc = 0;
+  void * lobGlobL = NULL;
+  // Call ExeLOBinterface to create the LOB
+  if (lobGlob == NULL)
+    {
+      rc = initLOBglobal(lobGlobL, lobHeap);
+      if (rc)
+	return -1;
+    }
+  else
+    lobGlobL = lobGlob;
+ 
+  if (rc)
+	return -1;
+   
+  rc = ExpLOBinterfacePerformGC(lobGlobL,tgtLobName, (void *)dcArray, numEntries,hdfsServer,hdfsPort,lobLoc,lobMaxChunkMemSize);
+  
+  return rc;
+}
+
+Int32 ExpLOBoper::restoreLobDataFile(void *lobGlob, char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLoc)
+{
+  Int32 rc = 0;
+  void * lobGlobL = NULL;
+   if (lobGlob == NULL)
+    {
+      rc = initLOBglobal(lobGlobL, lobHeap);
+      if (rc)
+	return -1;
+    }
+  else
+    lobGlobL = lobGlob;
+ 
+  if (rc)
+    return -1;
+    
+  rc = ExpLOBinterfaceRestoreLobDataFile(lobGlobL,hdfsServer,hdfsPort,lobLoc,lobName);
+   return rc;
 
+}
+
+Int32 ExpLOBoper::purgeBackupLobDataFile(void *lobGlob,char *lobName, void *lobHeap, char * hdfsServer, Int32 hdfsPort, char *lobLoc)
+{
+  Int32 rc = 0;
+  void * lobGlobL = NULL;
+  if (lobGlob == NULL)
+    {
+      rc = initLOBglobal(lobGlobL, lobHeap);
+      if (rc)
+	return -1;
+    }
+  else
+    lobGlobL = lobGlob;
+  
+  if (rc)
+    return -1;
+  
+
+  rc = ExpLOBinterfacePurgeBackupLobDataFile(lobGlobL,(char *)hdfsServer,hdfsPort,lobLoc,lobName);
   return rc;
 }
 
+
 Lng32 ExpLOBoper::dropLOB(void * lobGlob, void * lobHeap,
-			  char * lobLoc,
+			  char * lobLoc,Int32 hdfsPort, char *hdfsServer,
 			  Int64 uid, Lng32 num)
 {
   char buf[101];
@@ -214,12 +302,13 @@ Lng32 ExpLOBoper::dropLOB(void * lobGlob, void * lobHeap,
     lobGlobL = lobGlob;
 
   // Call ExeLOBinterface to drop the LOB
-  rc = ExpLOBinterfaceDrop(lobGlobL,(char *)"default", 0, lobName, lobLoc);
+  rc = ExpLOBinterfaceDrop(lobGlobL,hdfsServer, hdfsPort, lobName, lobLoc);
 
   return rc;
 }
 
 Lng32 ExpLOBoper::purgedataLOB(void * lobGlob, char * lobLoc, 
+                               
 			       Int64 uid, Lng32 num)
 {
   char buf[100];
@@ -229,7 +318,7 @@ Lng32 ExpLOBoper::purgedataLOB(void * lobGlob, char * lobLoc,
     return -1;
 
   // Call ExeLOBinterface to purgedata the LOB
-  Lng32 rc = ExpLOBInterfacePurgedata(lobGlob,(char *)"default", 0, lobName, lobLoc);
+  Lng32 rc = ExpLOBInterfacePurgedata(lobGlob, lobName, lobLoc);
   if (rc < 0)
     return ex_expr::EXPR_ERROR;
 
@@ -252,11 +341,12 @@ ExpLOBoper::ExpLOBoper(OperatorTypeEnum oper_type,
   lobHandleSaved_[0] = 0;
   lobStorageLocation_[0] = 0;
   lobHdfsServer_[0] = 0;
-  strcpy(lobHdfsServer_,"default");
-  lobHdfsPort_ = 0;
+  strcpy(lobHdfsServer_,"");
+  lobHdfsPort_ = -1;
   descSchName_[0] = 0;
   lobMaxSize_ = 0;
   lobMaxChunkMemSize_ = 0;
+  lobGCLimit_ = 0;
 };
 
 
@@ -725,7 +815,7 @@ ex_expr::exp_return_type ExpLOBiud::insertDesc(char *op_data[],
      &cliError,
      so,
      waitedOp,
-     lobData, lobLen, getLobMaxSize(), getLobMaxChunkMemSize());
+     lobData, lobLen, getLobMaxSize(), getLobMaxChunkMemSize(),getLobGCLimit());
   
   if (rc == LOB_ACCESS_PREEMPT)
     {
@@ -891,7 +981,9 @@ ex_expr::exp_return_type ExpLOBiud::insertData(Lng32 handleLen,
 				 so,
 				 waitedOp,				 
 				 lobData,
-				 lobLen,getLobMaxSize(), getLobMaxChunkMemSize());
+				 lobLen,getLobMaxSize(),
+                                 getLobMaxChunkMemSize(),
+                                 getLobGCLimit());
     }
 
   if (rc == LOB_ACCESS_PREEMPT)
@@ -1231,7 +1323,7 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
 	 data,
 	 fromLobName, fromSchNameLen, fromSchName,
 	 fromDescKey, fromDescTS,
-	 getLobMaxSize(), getLobMaxChunkMemSize());
+	 getLobMaxSize(), getLobMaxChunkMemSize(),getLobGCLimit());
     }
   else
     {
@@ -1254,7 +1346,7 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
 	 data,
 	 fromLobName, fromSchNameLen, fromSchName,
 	 fromDescKey, fromDescTS,
-	 getLobMaxSize(), getLobMaxChunkMemSize());
+	 getLobMaxSize(), getLobMaxChunkMemSize(),getLobGCLimit());
     }
 
   if (rc < 0)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOB.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.h b/core/sql/exp/ExpLOB.h
index de74b4a..d71a1d9 100644
--- a/core/sql/exp/ExpLOB.h
+++ b/core/sql/exp/ExpLOB.h
@@ -47,7 +47,7 @@
 
 #define LOB_HANDLE_LEN 1024
 
-
+class ExLobInMemoryDescChunksEntry;
 ////////////////////////////////
 // class LOBglobals
 ////////////////////////////////
@@ -225,22 +225,23 @@ public:
 					Int64 uid, Lng32 lobNum, 
 					char * outBuf, Lng32 outBufLen);
 
-  static char * ExpGetLOBHdrName(Lng32 schNameLen, char * schName, 
-				 Int64 uid, Lng32 lobNum, 
-				 char * outBuf, Lng32 outBufLen);
 
   static Lng32 ExpGetLOBnumFromDescName(char * descName, Lng32 descNameLen);
   
   static char * ExpGetLOBMDName(Lng32 schNameLen, char * schName,
 				Int64 uid,  
 				char * outBuf, Lng32 outBufLen);
+  static void calculateNewOffsets(ExLobInMemoryDescChunksEntry *dcArray, Lng32 numEntries);
+  static Lng32 compactLobDataFile(void *lobGlob, ExLobInMemoryDescChunksEntry *dcArray, Int32 numEntries, char *tgtLobName, Int64 lobMaxChunkSize, void *lobHeap,char *hdfsServer, Int32 hdfsPort,char *lobLocation);
+  static Int32 restoreLobDataFile(void *lobGlob, char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort,char *lobLocation );
+  static Int32 purgeBackupLobDataFile(void *lobGlob,char *lobName, void *lobHeap, char *hdfsServer, Int32 hdfsPort, char *lobLocation);
 
   static Lng32 createLOB(void * lobGlob, void * lobHeap,
-			 char * lobLoc,
+			 char * lobLoc, Int32 hdfsPort, char *hdfsServer,
 			 Int64 uid, Lng32 lobNum, Int64 lobMAxSize);
 
   static Lng32 dropLOB(void * lobGlob, void * lobHeap, 
-		       char * lobLoc,
+		       char * lobLoc,Int32 hdfsPort, char *hdfsServer,
 		       Int64 uid, Lng32 lobNum);
 
   static Lng32 purgedataLOB(void * lobGlob, 
@@ -303,6 +304,12 @@ public:
   Int64 getLobMaxSize() { return lobMaxSize_;}
   void setLobMaxChunkMemSize(Int64 maxsize) { lobMaxChunkMemSize_ = maxsize;}
   Int64 getLobMaxChunkMemSize() { return lobMaxChunkMemSize_;}
+  void setLobGCLimit(Int64 gclimit) { lobGCLimit_ = gclimit;}
+  Int64 getLobGCLimit() { return lobGCLimit_;}
+  void setLobHdfsServer(char *hdfsServer)
+  {strcpy(lobHdfsServer_,hdfsServer);}
+  void setLobHdfsPort(Int32 hdfsPort)
+  {lobHdfsPort_ = hdfsPort;}
  protected:
   typedef enum
   {
@@ -349,13 +356,14 @@ public:
   };
 
   Lng32 checkLobOperStatus();
-
+  
 protected:
   char * descSchName() { return descSchName_; }
 
   char * getLobHdfsServer() { return (strlen(lobHdfsServer_) == 0 ? NULL : lobHdfsServer_); }
   Lng32 getLobHdfsPort() { return lobHdfsPort_; }
-      
+ 
+
   short flags_;      // 00-02
 
   short lobNum_;
@@ -371,7 +379,7 @@ protected:
   char lobHandleSaved_[LOB_HANDLE_LEN];
 
   char outLobHandle_[LOB_HANDLE_LEN];
-  Int64 outHandleLen_;
+  Int32 outHandleLen_;
 
   char blackBox_[1024];
   Int64 blackBoxLen_;
@@ -386,6 +394,7 @@ protected:
   
   Int64 lobMaxSize_;
   Int64 lobMaxChunkMemSize_;
+  Int64 lobGCLimit_;
   //  NABasicPtr lobStorageLocation_;
 }
 ;
@@ -478,6 +487,7 @@ class ExpLOBiud : public ExpLOBoper {
   {
     (v) ? liudFlags_ |= FROM_EXTERNAL: liudFlags_ &= ~FROM_EXTERNAL;
   };
+  
 
  protected:
   Int64 objectUID_;
@@ -534,18 +544,12 @@ public:
 
   virtual short getClassSize() { return (short)sizeof(*this); }
   // ---------------------------------------------------------------------
-
-
+  
  private:
-  //  char * descSchName() { return descSchName_; }
-
+ 
   Lng32 liFlags_;
   char filler1_[4];
-  //  Int64 objectUID_;
-
-  //  short descSchNameLen_;
-  //  char  descSchName_[510];
-  //  NABasicPtr  descSchName_;
+ 
 };
 
 class ExpLOBdelete : public ExpLOBiud {
@@ -705,6 +709,7 @@ public:
   {
     return tgtLocation_;
   }
+  
  private:
    enum
   {


[35/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
index b1f19ad..d91565e 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
@@ -306,12 +306,13 @@ public class SplitBalanceHelper {
         try {
             List<String> trafTables = ZKUtil.listChildrenNoWatch(zkw, zSplitBalPathNoSlash);
             List<String> hbaseTables = ZKUtil.listChildrenNoWatch(zkw, SplitBalanceHelper.zkTable);
-
-            for (String tableName : trafTables) {
+            if(trafTables != null && hbaseTables != null) {
+              for (String tableName : trafTables) {
                 if (!hbaseTables.contains(tableName)) {
                     if (LOG.isTraceEnabled()) LOG.trace("zkCleanup, removing " + zSplitBalPath + tableName);
                     ZKUtil.deleteNodeRecursively(zkw, zSplitBalPath + tableName);
                 }
+              }
             }
         } catch (KeeperException ke) {
             if (LOG.isErrorEnabled()) LOG.error("zkCleanup error, please check your ZooKeeper: " + ke);
@@ -320,4 +321,3 @@ public class SplitBalanceHelper {
     }
 
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/Makefile b/core/sqf/src/tm/Makefile
index 80a295d..734653f 100644
--- a/core/sqf/src/tm/Makefile
+++ b/core/sqf/src/tm/Makefile
@@ -44,6 +44,9 @@ endif
 DTMOBJS		= -DTMOBJS
 
 
+#gcc 4.8 need explicit set this flag to allow auto search of dependent shared object during link
+LNK_FLGS       += -Xlinker --copy-dt-needed-entries
+
 LIBSTMOBJS = $(OUTDIR)/tmtransid.o \
 			 $(OUTDIR)/tmtransaction.o \
 			 $(OUTDIR)/tmlibtxn.o \

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tm.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tm.cpp b/core/sqf/src/tm/tm.cpp
index d37ad76..00db215 100644
--- a/core/sqf/src/tm/tm.cpp
+++ b/core/sqf/src/tm/tm.cpp
@@ -460,8 +460,8 @@ void tm_process_req_requestregioninfo(CTmTxMessage * pp_msg)
        TM_Txid_legacy lv_transid;
    } u;
 
-   char res_array[10], tname[300], ername[50], rname[100], offline[20], regid[200], hostname[200], port[100];
-   res_array[9] = '\0', tname[299] = '\0', ername[49] = '\0', rname[99] = '\0', offline[19] = '\0';
+   char tname[300], ername[50], rname[100], offline[20], regid[200], hostname[200], port[100];
+   tname[299] = '\0', ername[49] = '\0', rname[99] = '\0', offline[19] = '\0';
    regid[199]= '\0', hostname[199]='\0', port[99]='\0';
 
    TMTrace(2, ("tm_process_req_requestregioninfo ENTRY.\n"));
@@ -1401,7 +1401,7 @@ void tm_process_req_ax_reg (CTmTxMessage * pp_msg)
                     lv_nid, lv_pid, lv_ptype));
             tm_log_event(DTM_AX_REG_XARM_NOTSUPPORTED, SQ_LOG_CRIT, "DTM_AX_REG_XARM_NOTSUPPORTED", 
                 -1,pp_msg->request()->u.iv_ax_reg.iv_rmid,-1,pp_msg->msgid(),
-                -1,-1,-1,-1,-1,-1,-1,-1,lv_pid,lv_ptype,NULL,lv_nid);
+                -1,-1,-1,-1,-1,-1,-1,-1,lv_pid,lv_ptype,0,lv_nid);
             pp_msg->reply(FENOTFOUND);
             delete pp_msg;
             return;
@@ -2099,8 +2099,6 @@ void tm_originating_sync_abort(int32 pv_tag)
 // ---------------------------------------------------------------------------
 void tm_process_node_down_msg(int32 pv_nid)
 {
-    int32 lv_error = 0;
-
     gv_tm_info.close_tm(pv_nid); 
     TMTrace(2, ("tm_process_node_down_msg ENTRY, nid %d\n", pv_nid));
     tm_log_event(DTM_NODEDOWN, SQ_LOG_INFO, "DTM_NODEDOWN", 
@@ -2126,7 +2124,7 @@ void tm_process_node_down_msg(int32 pv_nid)
         // transaction has now yet been enabled.  
     {
         gv_tm_info.ClusterRecov(new TM_Recov(gv_tm_info.rm_wait_time()));
-        lv_error = gv_tm_info.ClusterRecov()->initiate_start_sync();
+        gv_tm_info.ClusterRecov()->initiate_start_sync();
     }
     else 
     {       
@@ -2224,7 +2222,6 @@ void tm_abort_all_transactions(bool pv_shutdown)
 void tm_process_registry_change(MS_Mon_Change_def *pp_change )
 {
     int32 lv_value; 
-    bool lv_success = false;
     char lv_regKeyText[1024];
     char *lp_regKeyText = (char *) &lv_regKeyText;
 
@@ -2285,7 +2282,7 @@ void tm_process_registry_change(MS_Mon_Change_def *pp_change )
         lv_value = atoi (pp_change->value);
         bool lv_tm_stats = ((lv_value == 0)?false:true);
         gv_tm_info.stats()->initialize(lv_tm_stats, gv_tm_info.stats()->collectInterval());
-        lv_success = gv_tm_info.threadPool()->setConfig(lv_tm_stats);
+        gv_tm_info.threadPool()->setConfig(lv_tm_stats);
         // Add other pools here
     }
     // Configure thread pool
@@ -2293,38 +2290,38 @@ void tm_process_registry_change(MS_Mon_Change_def *pp_change )
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 1)
-           lv_success = gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), lv_value);
+           gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), lv_value);
     }
     else if (strcmp(pp_change->key, DTM_STEADYSTATE_LOW_THREADS) == 0)
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 0)
-           lv_success = gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), -1, lv_value);
+           gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), -1, lv_value);
     }
     else if (strcmp(pp_change->key, DTM_STEADYSTATE_HIGH_THREADS) == 0)
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 0)
-           lv_success = gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), -1, -1, lv_value);
+           gv_tm_info.threadPool()->setConfig(gv_tm_info.tm_stats(), -1, -1, lv_value);
     }
     // Configure transaction pool
     else if (strcmp(pp_change->key, DTM_MAX_NUM_TRANS) == 0)
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 1)
-           lv_success = gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), lv_value);
+           gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), lv_value);
     }
     else if (strcmp(pp_change->key, DTM_STEADYSTATE_LOW_TRANS) == 0)
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 0)
-           lv_success = gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), -1, lv_value);
+           gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), -1, lv_value);
     }
     else if (strcmp(pp_change->key, DTM_STEADYSTATE_HIGH_TRANS) == 0)
     {
         lv_value = atoi (pp_change->value);
         if (lv_value >= 0)
-           lv_success = gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), -1, -1, lv_value);
+           gv_tm_info.transactionPool()->setConfig(gv_tm_info.tm_stats(), -1, -1, lv_value);
     }
     else if (strcmp(pp_change->key, DTM_CP_INTERVAL) == 0)
     {
@@ -2789,7 +2786,7 @@ void tm_process_msg(BMS_SRE *pp_sre)
     Tm_Broadcast_Rsp_Type *lp_br_rsp; 
     Tm_Perf_Stats_Req_Type *lp_ps_req;
     Tm_Perf_Stats_Rsp_Type *lp_ps_rsp; 
-    Tm_Sys_Status_Req_Type *lp_ss_req;
+    //Tm_Sys_Status_Req_Type *lp_ss_req;
     Tm_Sys_Status_Rsp_Type *lp_ss_rsp;
     Tm_RolloverCP_Req_Type *lp_rc_req;
     Tm_RolloverCP_Rsp_Type *lp_rc_rsp;
@@ -2901,7 +2898,7 @@ void tm_process_msg(BMS_SRE *pp_sre)
     }
     case TM_MSG_TYPE_CALLSTATUSSYSTEM:
     {
-         lp_ss_req = (Tm_Sys_Status_Req_Type *) la_recv_buffer;
+         //lp_ss_req = (Tm_Sys_Status_Req_Type *) la_recv_buffer;
          lp_ss_rsp = (Tm_Sys_Status_Rsp_Type *) la_send_buffer;
 
          TM_STATUSSYS *lp_system_status =  new TM_STATUSSYS();
@@ -2922,7 +2919,7 @@ void tm_process_msg(BMS_SRE *pp_sre)
     }
     case TM_MSG_TYPE_STATUSSYSTEM:
     {
-         lp_ss_req = (Tm_Sys_Status_Req_Type *) la_recv_buffer;
+         //lp_ss_req = (Tm_Sys_Status_Req_Type *) la_recv_buffer;
          lp_ss_rsp = (Tm_Sys_Status_Rsp_Type *) la_send_buffer;
 
          tm_fill_sys_status_buffer(lp_ss_rsp);
@@ -3369,7 +3366,7 @@ int main(int argc, char *argv[])
     msg_mon_get_my_info2(&lv_my_nid, // mon node-id
                          &lv_my_pid, // mon process-id
                          NULL,       // mon name
-                         NULL,       // mon name-len
+                         0,       // mon name-len
                          NULL,       // mon process-type
                          NULL,       // mon zone-id
                          NULL,       // os process-id

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmaudit.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmaudit.cpp b/core/sqf/src/tm/tmaudit.cpp
index 6bc9315..ca2f5a0 100644
--- a/core/sqf/src/tm/tmaudit.cpp
+++ b/core/sqf/src/tm/tmaudit.cpp
@@ -298,11 +298,11 @@ int32 TM_Audit::write_trans_state(TM_Transid_Type *pv_transid,
 {
     Audit_Transaction_State lv_state_rec;
     char      lv_write_buffer[REC_SIZE];
-    bool      lv_force = true;
+    //bool      lv_force = true;
     int32     lv_notify = 0;
 
     TMTrace(2, ("TM_Audit::write_trans_state: ENTRY \n"));
-    lv_force = prepare_trans_state(&lv_state_rec, lv_write_buffer, pv_transid,
+    prepare_trans_state(&lv_state_rec, lv_write_buffer, pv_transid,
                                    pv_nid, pv_state, pv_abort_flags);
 
 #ifdef USE_FILE_AUDIT
@@ -316,7 +316,7 @@ int32 TM_Audit::write_trans_state(TM_Transid_Type *pv_transid,
 void TM_Audit::write_shutdown(int32 pv_nid, int32 pv_state)
 {
     Audit_TM_Shutdown       lv_rec;
-    int64                   lv_vsn;
+    //int64                   lv_vsn;
     char                    lv_write_buffer[REC_SIZE];
 
     pv_nid = pv_nid; // 810
@@ -334,7 +334,7 @@ void TM_Audit::write_shutdown(int32 pv_nid, int32 pv_state)
 #endif
 
     iv_mutex.lock();
-    lv_vsn = iv_vsn++;
+    iv_vsn++;
     iv_mutex.unlock();
 
 
@@ -481,15 +481,15 @@ void TM_Audit::adp_module_terminate()
 void TM_Audit::adp_activate_cursor()
 {
    // If we're using a TLOG/TM then the index is nid.
-   AuditTrailPosition_Struct lv_low_pos, lv_high_pos;
+   //AuditTrailPosition_Struct lv_low_pos, lv_high_pos;
 
     if (!iv_initialized)
        return; // for now
 
-    lv_low_pos.Sequence = 0;
-    lv_low_pos.rba = 0;
-    lv_high_pos.Sequence = 0;
-    lv_high_pos.rba = 0;
+    //lv_low_pos.Sequence = 0;
+    //lv_low_pos.rba = 0;
+    //lv_high_pos.Sequence = 0;
+    //lv_high_pos.rba = 0;
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmauditobj.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmauditobj.cpp b/core/sqf/src/tm/tmauditobj.cpp
index 3f402bb..3b29871 100644
--- a/core/sqf/src/tm/tmauditobj.cpp
+++ b/core/sqf/src/tm/tmauditobj.cpp
@@ -207,14 +207,12 @@ void CTmAuditObj::write_buffer()
 {
     TMTrace(2, ("CTmAuditObj::write_buffer : ENTRY.\n"));
 
-    int32 lv_notify = -1;
-
     if (iv_prepared_to_write) // no lock means it was not called appropriately, error TODO
     {
         if (iv_write_buf_size > 0)
         {
             TMTrace(2, ("CTmAuditObj::write_buffer with size of %d: ENTRY.\n", iv_write_buf_size));
-            lv_notify = iv_mat.write_buffer(iv_write_buf_size, ia_write_buffer, iv_highest_fill_vsn);
+            iv_mat.write_buffer(iv_write_buf_size, ia_write_buffer, iv_highest_fill_vsn);
             iv_write_buf_size = 0;
         }
         else
@@ -226,7 +224,7 @@ void CTmAuditObj::write_buffer()
         prepare_to_write(true);
         if (iv_write_buf_size > 0)
         {  
-            lv_notify = iv_mat.write_buffer(iv_write_buf_size, ia_write_buffer, iv_highest_fill_vsn);
+            iv_mat.write_buffer(iv_write_buf_size, ia_write_buffer, iv_highest_fill_vsn);
             iv_write_buf_size = 0;
         }
         iv_double_write = false;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmddlrequests.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmddlrequests.cpp b/core/sqf/src/tm/tmddlrequests.cpp
index 5c45609..63661f1 100644
--- a/core/sqf/src/tm/tmddlrequests.cpp
+++ b/core/sqf/src/tm/tmddlrequests.cpp
@@ -36,7 +36,6 @@ using namespace std;
 JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInterface_createTableReq
   (JNIEnv *pp_env, jobject pv_object, jbyteArray pv_tableDescriptor, jobjectArray pv_keys, jint pv_numSplits, jint pv_keyLength, jlong pv_transid, jbyteArray pv_tblname){
 
-   short lv_ret;
    char la_tbldesc[TM_MAX_DDLREQUEST_STRING];
    char la_tblname[TM_MAX_DDLREQUEST_STRING];
    char* str_key;
@@ -76,7 +75,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
          pp_env->DeleteLocalRef(jba_keyarray);
       }
 
-      lv_ret = CREATETABLE(la_tbldesc, lv_tbldesc_length, la_tblname, la_keys, lv_numSplits, lv_keyLength, lv_transid);
+      CREATETABLE(la_tbldesc, lv_tbldesc_length, la_tblname, la_keys, lv_numSplits, lv_keyLength, lv_transid);
 
       pp_env->ReleaseByteArrayElements(pv_tableDescriptor, lp_tbldesc, 0);
       pp_env->ReleaseByteArrayElements(pv_tblname, lp_tblname, 0);
@@ -92,7 +91,6 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
 JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInterface_dropTableReq
   (JNIEnv *pp_env, jobject pv_object, jbyteArray pv_tblname, jlong pv_transid) {
 
-   short lv_ret; 
    char la_tblname[TM_MAX_DDLREQUEST_STRING];
 
    int lv_tblname_len = pp_env->GetArrayLength(pv_tblname);
@@ -106,7 +104,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
 
       long lv_transid = (long) pv_transid;
 
-      lv_ret = DROPTABLE(la_tblname, lv_tblname_len, lv_transid);
+      DROPTABLE(la_tblname, lv_tblname_len, lv_transid);
       pp_env->ReleaseByteArrayElements(pv_tblname, lp_tblname, 0);
    }
 }
@@ -119,7 +117,6 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
 JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInterface_truncateOnAbortReq
   (JNIEnv *pp_env, jobject pv_object, jbyteArray pv_tblname, jlong pv_transid) {
 
-   short lv_ret;
    char la_tblname[TM_MAX_DDLREQUEST_STRING];
 
    int lv_tblname_len = pp_env->GetArrayLength(pv_tblname);
@@ -133,7 +130,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
 
       long lv_transid = (long) pv_transid;
 
-      lv_ret = REGTRUNCATEONABORT(la_tblname, lv_tblname_len, lv_transid);
+      REGTRUNCATEONABORT(la_tblname, lv_tblname_len, lv_transid);
       pp_env->ReleaseByteArrayElements(pv_tblname, lp_tblname, 0);
    }
 }
@@ -146,7 +143,6 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
 JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInterface_alterTableReq
   (JNIEnv *pp_env, jobject pv_object, jbyteArray pv_tblName, jobjectArray pv_tableOptions, jlong pv_transID) {
 
-   short lv_ret;
    int tblopts_len =0;
    char la_tblname[TM_MAX_DDLREQUEST_STRING];
 
@@ -186,7 +182,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
       }
 
       long lv_transid = (long) pv_transID;
-      lv_ret = ALTERTABLE(la_tblname, lv_tblname_len, tbl_options, tblopts_len, tbloptions_cnt, lv_transid);
+      ALTERTABLE(la_tblname, lv_tblname_len, tbl_options, tblopts_len, tbloptions_cnt, lv_transid);
       pp_env->ReleaseByteArrayElements(pv_tblName, lp_tblname, 0);
    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmlib.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmlib.cpp b/core/sqf/src/tm/tmlib.cpp
index a2bf48b..54803f5 100644
--- a/core/sqf/src/tm/tmlib.cpp
+++ b/core/sqf/src/tm/tmlib.cpp
@@ -2730,21 +2730,20 @@ bool TMLIB::phandle_get(TPT_PTR(pp_phandle), int pv_node)
 
 void TMLIB::phandle_set (TPT_PTR(pp_phandle), int pv_node)
 {
-    short lv_error = 0;
 
     ia_tm_phandle[pv_node].iv_phandle = *pp_phandle;
     ia_tm_phandle[pv_node].iv_open = true;
     
     //call decompose to get out the nid/pid
-    lv_error = XPROCESSHANDLE_DECOMPOSE_(pp_phandle, 
+    XPROCESSHANDLE_DECOMPOSE_(pp_phandle, 
                                           NULL, // node - already know it
                                           &ia_tm_phandle[pv_node].iv_pid, // pid
                                           NULL, // don't care
                                           NULL, // don't care
+                                          0, // don't care
                                           NULL, // don't care
                                           NULL, // don't care
-                                          NULL, // don't care
-                                          NULL, // don't care
+                                          0, // don't care
                                           NULL, // don't care
                                           NULL); //sdon't care
 
@@ -2754,7 +2753,6 @@ void TMLIB::phandle_set (TPT_PTR(pp_phandle), int pv_node)
 
 void TMLIB::initialize()
 {
-   int lv_err = 0;
    msg_mon_get_process_info(NULL, &iv_my_nid,
                                     &iv_my_pid);
 
@@ -2766,7 +2764,7 @@ void TMLIB::initialize()
     //TODO: switch the following call to msg_mon_get_node_info2 when available.
     // This call has been changed so that the node count includes spare nodes, so 
     // will give the wrong value for iv_node_count.
-    lv_err = msg_mon_get_node_info(&iv_node_count, MAX_NODES, NULL);
+    msg_mon_get_node_info(&iv_node_count, MAX_NODES, NULL);
     is_initialized(true);
     // We don't use gv_tmlib_initialized but set it here just to keep things aligned.
     gv_tmlib_initialized = true;
@@ -3142,11 +3140,10 @@ short TMLIB::setupJNI()
 ///////////////////////////////////////////////
 short TMLIB::initConnection(short pv_nid)
 {
-   jboolean jresult = 0;
   jthrowable exc;
   jshort   jdtmid = pv_nid;
   //sleep(30);
-  jresult = _tlp_jenv->CallBooleanMethod(javaObj_, TMLibJavaMethods_[JM_INIT1].methodID, jdtmid);
+  _tlp_jenv->CallBooleanMethod(javaObj_, TMLibJavaMethods_[JM_INIT1].methodID, jdtmid);
   exc = _tlp_jenv->ExceptionOccurred();
   if(exc) {
     _tlp_jenv->ExceptionDescribe();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmpoolelement.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmpoolelement.h b/core/sqf/src/tm/tmpoolelement.h
index 5984351..ead2120 100644
--- a/core/sqf/src/tm/tmpoolelement.h
+++ b/core/sqf/src/tm/tmpoolelement.h
@@ -46,7 +46,7 @@ protected:
 
 public:
    CTmPoolElement();
-   ~CTmPoolElement();
+   virtual ~CTmPoolElement();
 
    // Required callbacks for CTmPool elements:
    static CTmPoolElement* constructPoolElement(int64);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmrecov.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmrecov.cpp b/core/sqf/src/tm/tmrecov.cpp
index d73b419..b3eb222 100644
--- a/core/sqf/src/tm/tmrecov.cpp
+++ b/core/sqf/src/tm/tmrecov.cpp
@@ -1244,7 +1244,6 @@ int32 TM_Recov::resolve_in_doubt_txs(int32 pv_dtm, int_32 delay)
 {
    TM_TX_Info * lp_txn = NULL;
    int64        lv_last_key = 0;
-   int32        lv_error = 0;
 
    // The total number of transactions to recover for this node has already been set when we created the Transaction State List
    //iv_total_txs_to_recover = ip_tm_info->num_active_txs() + txnStateList()->size();
@@ -1261,7 +1260,7 @@ int32 TM_Recov::resolve_in_doubt_txs(int32 pv_dtm, int_32 delay)
 
     while (lp_txn)
     {
-        lv_error = resolveTxn(lp_txn);
+        resolveTxn(lp_txn);
 
         lv_last_key = txnList()->curr_key();
         lp_txn = (TM_TX_Info *) txnList()->get_next();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmregisterregion.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmregisterregion.cpp b/core/sqf/src/tm/tmregisterregion.cpp
index 129abf3..97726b4 100644
--- a/core/sqf/src/tm/tmregisterregion.cpp
+++ b/core/sqf/src/tm/tmregisterregion.cpp
@@ -33,7 +33,6 @@ using namespace std;
 JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_TransactionState_registerRegion
 (JNIEnv *pp_env, jobject pv_object, jlong pv_transid, jlong pv_startid, jint pv_port, jbyteArray pv_hostname, jlong pv_startcode, jbyteArray pv_dos)
 {
-   short lv_ret;
    char la_hostname[TM_MAX_REGIONSERVER_STRING];
    char la_dos[TM_MAX_REGIONSERVER_STRING];
    memset(la_hostname, 0, TM_MAX_REGIONSERVER_STRING);
@@ -55,8 +54,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_client_transactional_Transac
           lp_dos,
           lv_dos_length);
 
-   lv_ret = REGISTERREGION(pv_transid, pv_startid, pv_port, la_hostname, lv_hostname_length, pv_startcode, la_dos, lv_dos_length);
-   //cout << "REGISTERREGION Error: " << lv_ret << endl;
+   REGISTERREGION(pv_transid, pv_startid, pv_port, la_hostname, lv_hostname_length, pv_startcode, la_dos, lv_dos_length);
    pp_env->ReleaseByteArrayElements(pv_hostname, lp_hostname, 0);
    pp_env->ReleaseByteArrayElements(pv_dos, lp_dos, 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmrmhbase.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmrmhbase.cpp b/core/sqf/src/tm/tmrmhbase.cpp
index ea26037..a0974dc 100644
--- a/core/sqf/src/tm/tmrmhbase.cpp
+++ b/core/sqf/src/tm/tmrmhbase.cpp
@@ -402,7 +402,6 @@ int32 RM_Info_HBASE::hb_ddl_operation(CTmTxBase *pp_txn, int64 pv_flags, CTmTxMe
 
    int len;
    int len_aligned;
-   int buffer_size;
    int index;
    char *ddlbuffer;
    char **buffer_keys;
@@ -437,7 +436,6 @@ int32 RM_Info_HBASE::hb_ddl_operation(CTmTxBase *pp_txn, int64 pv_flags, CTmTxMe
                          0);
          }
          else {
-            buffer_size = pv_numsplits*pv_keylen;
             buffer_keys = new char *[pv_numsplits];
 
             index = len_aligned;
@@ -480,7 +478,6 @@ int32 RM_Info_HBASE::hb_ddl_operation(CTmTxBase *pp_txn, int64 pv_flags, CTmTxMe
 
          ddlbuffer = pp_msg->getBuffer();
 
-         buffer_size = pv_numtblopts*pv_tbloptslen;
          buffer_opts = new char *[pv_numtblopts];
 
          index = len_aligned;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmrmtse.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmrmtse.cpp b/core/sqf/src/tm/tmrmtse.cpp
index f21c84b..8db953a 100644
--- a/core/sqf/src/tm/tmrmtse.cpp
+++ b/core/sqf/src/tm/tmrmtse.cpp
@@ -191,7 +191,6 @@ void RM_Info_TSE::remove_rm_by_index (int32 pv_index)
 int RM_Info_TSE::set_partic_and_transid(TM_Txid_Internal pv_transid, int32 pv_rmid )
 {
     bool lv_found = false;
-    bool lv_partic_added = false;
 
     int lv_idx = 0;
     while (lv_idx <= iv_high_index_used && !lv_found)
@@ -200,7 +199,7 @@ int RM_Info_TSE::set_partic_and_transid(TM_Txid_Internal pv_transid, int32 pv_rm
          // partic to true and set the transid
         if (ia_TSEBranches[lv_idx].rmid() == pv_rmid)
         {
-            lv_partic_added = ia_TSEBranches[lv_idx].add_partic(pv_transid);
+            ia_TSEBranches[lv_idx].add_partic(pv_transid);
             lv_found = true;
             iv_num_rm_partic++;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmtime.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmtime.h b/core/sqf/src/tm/tmtime.h
index 6f25c21..1602175 100644
--- a/core/sqf/src/tm/tmtime.h
+++ b/core/sqf/src/tm/tmtime.h
@@ -163,11 +163,10 @@ public:
    }
    static Ctimeval now()
    {  
-      struct timezone lv_tz =  {0, NULL};
       Ctimeval lv_now;
       //char la_buf[DTM_STRING_BUF_SIZE];
 
-      int lv_success = gettimeofday(&lv_now, &lv_tz);
+      int lv_success = gettimeofday(&lv_now, NULL);
       if (lv_success != 0)
       {
          // EMS DTM_GETTIME_FAIL

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmxarmmain.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmxarmmain.cpp b/core/sqf/src/tm/tmxarmmain.cpp
index 950b552..9fa60fa 100644
--- a/core/sqf/src/tm/tmxarmmain.cpp
+++ b/core/sqf/src/tm/tmxarmmain.cpp
@@ -544,7 +544,7 @@ void tm_process_xa_recover(CTmTxMessage * pp_msg)
    lv_recoverReply.iv_end = true;
    lv_recoverReply.iv_count = 0;
    //lv_recoverReply.iv_recovery_index = 0; not found in RM_Recover_Req_Type??
-   memset(&lv_recoverReply.iv_xid, NULL, sizeof(lv_recoverReply.iv_xid));
+   memset(&lv_recoverReply.iv_xid, 0, sizeof(lv_recoverReply.iv_xid));
 
    // Need to handle TMSTATRSCAN, TMENDRSCAN
    pp_msg->reply(XA_OK);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tmxatxn.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmxatxn.cpp b/core/sqf/src/tm/tmxatxn.cpp
index 9f7597a..9e52bf3 100644
--- a/core/sqf/src/tm/tmxatxn.cpp
+++ b/core/sqf/src/tm/tmxatxn.cpp
@@ -145,7 +145,7 @@ void CTmXaTxn::cleanup()
    iv_txnType = TM_TX_TYPE_XARM;
    iv_txnObj.ip_xaTxn = this;
    iv_rmid = -1;
-   memset(&iv_XID, NULL, sizeof(iv_XID));
+   memset(&iv_XID, 0, sizeof(iv_XID));
    iv_tx_state = TM_TX_STATE_NOTX;
    iv_in_use = false;
    
@@ -175,7 +175,7 @@ void CTmXaTxn::initialize(int32 pv_nid, int64 pv_flags, int32 pv_trace_level,
    iv_txnType = TM_TX_TYPE_XARM;
    iv_txnObj.ip_xaTxn = this;
    iv_rmid = -1;
-   memset(&iv_XID, NULL, sizeof(iv_XID));
+   memset(&iv_XID, 0, sizeof(iv_XID));
 
    CTmTxBase::initialize(pv_nid, pv_flags, pv_trace_level, pv_seq, pv_creator_nid, 
                          pv_creator_pid, pv_rm_wait_time);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tools/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tools/Makefile b/core/sqf/src/tm/tools/Makefile
index be32946..93aa948 100644
--- a/core/sqf/src/tm/tools/Makefile
+++ b/core/sqf/src/tm/tools/Makefile
@@ -48,6 +48,9 @@ endif
 
 #TESTAROBJS        = adp_read_test.o \
 
+#gcc 4.8 need explicit enable flag to search for dependent shared object
+CXXFLAGS       += -Xlinker --copy-dt-needed-entries
+
 PROGS = dtmci \
         tmshutdown 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/tools/dtmci.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tools/dtmci.cpp b/core/sqf/src/tm/tools/dtmci.cpp
index ce98eaf..c65259c 100644
--- a/core/sqf/src/tm/tools/dtmci.cpp
+++ b/core/sqf/src/tm/tools/dtmci.cpp
@@ -142,10 +142,9 @@ void print_transid_str(int32 pv_node, int32 pv_seqnum) {
 
 long now()
 {  
-   struct timezone lv_tz =  {0, NULL};
    timeval lv_now;
 
-   int lv_success = gettimeofday(&lv_now, &lv_tz);
+   int lv_success = gettimeofday(&lv_now, NULL);
    if (lv_success != 0)
    {
       printf("\n** gettimeofday returned error %d.", lv_success);
@@ -502,7 +501,6 @@ void process_tmstats_node(bool pv_reset, int32 pv_nid, bool json)
 
 void process_tmstats(bool pv_reset, int32 pv_node, bool json)
 {
-    int lv_error = 0;
     int lv_dtm_count = 0;
     bool del = false;
 
@@ -513,7 +511,7 @@ void process_tmstats(bool pv_reset, int32 pv_node, bool json)
         process_tmstats_node(pv_reset, pv_node, json);
     else
     {
-        lv_error = msg_mon_get_node_info        ( &lv_dtm_count,
+        msg_mon_get_node_info        ( &lv_dtm_count,
                                                   MAX_NODES,
                                                   NULL);
         
@@ -598,14 +596,13 @@ void process_statusalltransactions_node(int32 pv_node)
 
 void process_statusalltransactions(int32 pv_node)
 {
-  int lv_error = 0;
   int lv_dtm_count = 0;
 
   if(pv_node !=-1)
      cout << "Info specific node: " << pv_node << "\n";
   else
   {
-     lv_error = msg_mon_get_node_info(&lv_dtm_count,
+     msg_mon_get_node_info(&lv_dtm_count,
                                       MAX_NODES,
                                       NULL);
 
@@ -666,14 +663,13 @@ void process_list_node(int32 pv_node)
 
 void process_list(int32 pv_node)
 {
-    int lv_error = 0;
     int lv_dtm_count = 0;
 
     if (pv_node != -1)
         process_list_node(pv_node);
     else
     {
-        lv_error = msg_mon_get_node_info (&lv_dtm_count,
+        msg_mon_get_node_info (&lv_dtm_count,
                                           MAX_NODES,
                                           NULL);
 
@@ -1699,7 +1695,7 @@ int main(int argc, char *argv[])
                 lv_param1 = atoi(lp_nextcmd);
             }
             if (lv_param1 == 0)
-                lv_resume_error= RESUMETRANSACTION(NULL);
+                lv_resume_error= RESUMETRANSACTION(0);
             else
                 lv_resume_error= RESUMETRANSACTION(lv_param1);
                 cout << "RESUMETRANSACTION(" << lv_param1 << ") returned error " << lv_resume_error << endl;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/xarmapi.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/xarmapi.cpp b/core/sqf/src/tm/xarmapi.cpp
index 15d25e9..55b03bc 100644
--- a/core/sqf/src/tm/xarmapi.cpp
+++ b/core/sqf/src/tm/xarmapi.cpp
@@ -803,7 +803,7 @@ int xarm_recover_waitReply(int *pp_rmid, XID *pp_xids, int64 *pp_count,
    int32 lv_type = -1;
    bool  lv_retryLink = false;
 
-   if (!pp_rmid || !pp_xids || !pp_count || pp_count <= 0 || !pp_end || !pp_index || !pp_int_error)
+   if (!pp_rmid || !pp_xids || !pp_count || *pp_count <= 0 || !pp_end || !pp_index || !pp_int_error)
    {
       XATrace(XATM_TraceAPIError,("XARM: xarm_recover_waitReply failed with XAER_INVAL "
                                   "(invalid parameter or bad address)\n"));
@@ -1023,7 +1023,6 @@ int xarm_complete_one(int pv_rmid, int *pp_handle)
    char           la_buf[DTM_STRING_BUF_SIZE];
    int            lv_xaError = XA_OK;
    bool           lv_retryLink = false;
-   short          lv_event = 0;
 
    XATrace(XATM_TraceXAAPI,("XARM: xarm_complete_one ENTRY, rmid(%d), handle(%d).\n", 
          pv_rmid, *pp_handle));
@@ -1049,7 +1048,7 @@ int xarm_complete_one(int pv_rmid, int *pp_handle)
    }
 
    // Wait forever for a completion
-   lv_event = XWAIT(LDONE, -1);
+   XWAIT(LDONE, -1);
 
    // It's possible for us to have multiple outstanding requests
    // to the same RM (XARM, so DTM TM process) complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sqf/src/tm/xatmapi.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/xatmapi.cpp b/core/sqf/src/tm/xatmapi.cpp
index 0100ccc..b6c02d6 100644
--- a/core/sqf/src/tm/xatmapi.cpp
+++ b/core/sqf/src/tm/xatmapi.cpp
@@ -127,7 +127,7 @@ bool tm_XARM_amIaTM()
    msg_mon_get_my_info2(NULL,       // mon node-id
                         NULL,       // mon process-id
                         NULL,       // mon name
-                        NULL,       // mon name-len
+                        0,       // mon name-len
                         &lv_process_type, // mon process-type
                         NULL,       // mon zone-id
                         NULL,       // os process-id
@@ -1075,7 +1075,7 @@ int tm_xa_recover_waitReply(int *pp_rmid, XID *pp_xids, int64 *pp_count,
    int32 lv_type = -1;
    bool  lv_retryLink = false;
 
-   if (!pp_rmid || !pp_xids || !pp_count || pp_count <= 0 || !pp_end || !pp_index || !pp_int_error)
+   if (!pp_rmid || !pp_xids || !pp_count || *pp_count <= 0 || !pp_end || !pp_index || !pp_int_error)
    {
       XATrace(XATM_TraceAPIError,("XATM: tm_xa_recover_waitReply failed with XAER_INVAL "
                                   "(invalid parameter or bad address)\n"));
@@ -1295,7 +1295,6 @@ int complete_one(int pv_rmid, int *pp_handle)
    char           la_buf[DTM_STRING_BUF_SIZE];
    int            lv_xaError = XA_OK;
    bool           lv_retryLink = false;
-   short          lv_event = 0;
 
    XATrace(XATM_TraceXAAPI,("XATM: complete_one ENTRY, rmid(%d), handle(%d).\n", 
          pv_rmid, *pp_handle));
@@ -1321,7 +1320,7 @@ int complete_one(int pv_rmid, int *pp_handle)
    }
 
    // Wait forever for a completion
-   lv_event = XWAIT(LDONE, -1);
+   XWAIT(LDONE, -1);
 
    // It's possible for us to have multiple outstanding requests
    // to the same RM (XARM, so DTM TM process) complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/SqlCompilerDebugger/mk.sh
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/mk.sh b/core/sql/SqlCompilerDebugger/mk.sh
index 7056cc9..e752bbb 100644
--- a/core/sql/SqlCompilerDebugger/mk.sh
+++ b/core/sql/SqlCompilerDebugger/mk.sh
@@ -24,6 +24,11 @@ export LD_LIBRARY_PATH=$QT_TOOLKIT/lib:$LD_LIBRARY_PATH
 # Important: QT_TOOLKIT must not be bundled in Trafodion build
 #     QT License is not compatible with ASF license policy
 
+if [[ ! -d "$QT_TOOLKIT" ]]
+then
+  echo "Skipping Build of SQL Compiler Debugger"
+  exit 0
+fi
 
 qmake -o Makefile SqlCmpDbg.pro
 make

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 084a4fd..0e1b24b 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -145,7 +145,7 @@
 1143 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Validation of constraint $0~ConstraintName failed; incompatible data exists in referencing base table $1~TableName and referenced base table $2~String0.  To display the data that violates the constraint, please use the following DML statement: $3~String1
 1144 ZZZZZ 99999 BEGINNER MAJOR DBADMIN A quoted string was expected in first key clause for column $0~ColumnName on table $1~TableName, but the value detected is ($2~String0).
 1145 3D000 99999 BEGINNER MAJOR DBADMIN The catalog name $0~CatalogName is reserved for SQL metadata.
-1146 ZZZZZ 99999 BEGINNER MINOR DBADMIN Object $0~TableName could not be altered because it is not a $1~String0.
+1146 ZZZZZ 99999 BEGINNER MINOR DBADMIN Object $0~String0 could not be altered because it either does not exist or is not a table.
 1147 ZZZZZ 99999 BEGINNER MINOR DBADMIN System-generated column $0~ColumnName of base table $1~TableName cannot appear in a unique or primary key constraint definition.
 1148 23000 99999 BEGINNER MINOR DBADMIN System-generated column $0~ColumnName of base table $1~TableName cannot appear in a referential integrity constraint definition.
 1149 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Column $0~ColumnName does not exist in table $1~TableName.
@@ -247,8 +247,8 @@
 1252 ZZZZZ 99999 BEGINNER MAJOR DBADMIN The existing index $0~TableName to be used by a unique or primary constraint has not been populated.  Please populate the index and then try to add the constraint again.
 1253 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in.  ------   
 1254 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Duplicate unique constraints are not allowed with same set of columns.
-1255 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in ------  
-1256 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in ------  
+1255 ZZZZZ 99999 BEGINNER MINOR DBADMIN Constraint $0~String0 is the clustering key constraint for table $1~String1 and cannot be dropped.
+1256 ZZZZZ 99999 BEGINNER MINOR DBADMIN PRIMARY KEY constraint cannot be added since table $0~String0 already has a user specified clustering key. 
 1257 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in ------  
 1258 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in ------  
 1259 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU ---- Msg text will be merged in ------  
@@ -261,6 +261,7 @@
 1266 ZZZZZ 99999 BEGINNER MINOR DBADMIN Only EXECUTE privilege is supported for a procedure or routine.
 1267 ZZZZZ 99999 BEGINNER MINOR DBADMIN $0~string0 privilege is incompatible with this object type.
 1268 ZZZZZ 99999 BEGINNER MINOR DBADMIN Duplicate columns are not allowed in a GRANT or REVOKE statement.
+1269 ZZZZZ 99999 BEGINNER MINOR DBADMIN Column name $0~String0 is reserved for internal system usage. It cannot be specified as a user column.
 1270 ZZZZZ 99999 BEGINNER MAJOR DBADMIN ALLOCATE or DEALLOCATE failed for object $0~TableName due to file error $1~Int0 on $2~String0.
 1271 ZZZZZ 99999 BEGINNER MAJOR DBADMIN ALLOCATE failed for object $0~TableName because the number of extents to be allocated ($1~Int0) is greater than the MAXEXTENTS for a partition of the object.
 1272 ZZZZZ 99999 BEGINNER CRTCL DIALOUT The system is not licensed for use of SQL format tables.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index 58a77ba..a6b7f1a 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -93,6 +93,8 @@
 #include "LmLangManagerC.h"
 #include "LmLangManagerJava.h"
 #include "LmRoutine.h"
+#include "CmpDDLCatErrorCodes.h"
+#include "ExpLOBaccess.h"
 
 #define DISPLAY_DONE_WARNING 1032
 extern Lng32 getTotalTcbSpace(char * tdb, char * otherInfo, 
@@ -2454,7 +2456,8 @@ Lng32 SQLCLI_ProcessRetryQuery(
             return retcode;
         }
 
-      if (rootTdb->updDelInsertQuery())
+      if ((rootTdb->updDelInsertQuery()) ||
+          (rootTdb->ddlQuery()))
         {
           if (rootTdb->transactionReqd() &&
               (NOT exTransaction->xnInProgress()))
@@ -9393,7 +9396,7 @@ Lng32 SQLCLI_LOBcliInterface
  /*IN*/     char * inLobHandle,
  /*IN*/     Lng32  inLobHandleLen,
  /*IN*/     char * blackBox,
- /*INOUT*/  Lng32 *blackBoxLen,
+ /*INOUT*/  Int32 *blackBoxLen,
  /*OUT*/    char * outLobHandle,
  /*OUT*/    Lng32 * outLobHandleLen,
  /*IN*/     LOBcliQueryType qType,
@@ -9402,8 +9405,9 @@ Lng32 SQLCLI_LOBcliInterface
                                    OUT: for select */
  /*INOUT*/  Int64 * dataLen,    /* length of data.
                                    IN: for insert, out: for select */
- /*OUT*/    Int64 * outDescPartnKey,  /* returned after insert and select */
- /*OUT*/    Int64 * outDescSyskey,    /* returned after insert and select */
+ /*INOUT*/    Int64 * inoutDescPartnKey,  /* returned after insert and select 
+                                                                             
+ /*INOUT*/    Int64 * inoutDescSyskey,    /* returned after insert and select                                                                                 
  /*INOUT*/  void* *inCliInterface,
  /*IN*/     Int64 xnId          /* xn id of the parent process, if non-zero */
  )
@@ -9458,13 +9462,7 @@ Lng32 SQLCLI_LOBcliInterface
     ExpLOBoper::ExpGetLOBDescChunksName(schNameLen, schName, uid, lobNum,
 					lobDescChunksNameBuf, lobDescChunksNameLen);
   
-  char lobHdrNameBuf[1024];
-  Lng32 lobHdrNameLen = 1024;
-  char * lobHdrName = 
-    ExpLOBoper::ExpGetLOBHdrName(schNameLen, schName, uid, lobNum,
-				 lobHdrNameBuf, lobHdrNameLen);
-
-
+ 
   char * query = new(currContext.exHeap()) char[4096];
 
   if (outLobHandleLen)
@@ -9498,52 +9496,6 @@ Lng32 SQLCLI_LOBcliInterface
       SQL_EXEC_Xact(SQLTRANS_INHERIT, NULL);
       } 
 
-  /*  if ((qType == LOB_CLI_CREATE) ||
-      (qType == LOB_CLI_DROP) ||
-      (qType == LOB_CLI_INSERT) ||
-      (qType == LOB_CLI_INSERT_APPEND) ||
-      (qType == LOB_CLI_UPDATE_UNIQUE) ||
-      (qType == LOB_CLI_DELETE) ||
-      (qType == LOB_CLI_PURGEDATA))
-  */
-  if (0)
-    {
-      Int64 transId;
-      cliRC = GETTRANSID((short *)&transId);
-
-      if (xnId == 0) // no xn passed in
-	{
-	  if (cliRC == 75)  // no transid present
-	    {
-	      strcpy(query, "set transaction autocommit on;");
-	      cliRC = cliInterface->executeImmediate(query);
-	      
-	      xnAutoCommit = TRUE;
-	    }
-	}
-      else
-	{
-	  if ((cliRC == 0) && // transid present
-	      (xnId == transId))
-	    {
-	      // Same as the current transaction in progress.
-	      // do nothing.
-	    }
-	  else
-	    {
-	      cliRC = JOINTRANSACTION(xnId);
-	      if (cliRC)
-		return -EXE_BEGIN_TRANSACTION_ERROR;
-	      
-	      cliRC = GETTRANSID((short *)&transId);
-	      if ((cliRC) ||
-		  (xnId != transId))// transid present
-		return -EXE_BEGIN_TRANSACTION_ERROR;
-
-	      xnJoined = TRUE;
-	    }
-	}
-    }
  
   switch (qType)
     {
@@ -9565,8 +9517,7 @@ Lng32 SQLCLI_LOBcliInterface
 
     case LOB_CLI_CREATE:
       {
-	cliRC = cliInterface->executeImmediate("cqd pos hold;");
-	cliRC = cliInterface->executeImmediate("cqd pos 'OFF';");
+	
 
 	// create lob descriptor handle table salted	
    	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, numChunks int not null, lobLen largeint not null) salt using 8 partitions store by (descPartnKey, syskey) ",
@@ -9581,15 +9532,14 @@ Lng32 SQLCLI_LOBcliInterface
 
 	if (cliRC < 0)
 	  {
-	    cliInterface->executeImmediate("cqd pos restore;");
-
+	    
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
 	    
 	    goto error_return;
 	  }
 
            	// create lob descriptor chunks table salted
-       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, intParam largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
+       	str_sprintf(query, "create ghost table %s (descPartnKey largeint not null, descSysKey largeint not null, chunkNum int not null, chunkLen largeint not null, dataOffset largeint, stringParam varchar(400), primary key(descPartnKey, descSysKey, chunkNum)) salt using 8 partitions",
 	lobDescChunksName); 
 
 
@@ -9602,14 +9552,11 @@ Lng32 SQLCLI_LOBcliInterface
 
 	if (cliRC < 0)
 	  {
-	    cliInterface->executeImmediate("cqd pos restore;");
-
+	    
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
 	    
 	    goto error_return;
 	  }
-
-	cliInterface->executeImmediate("cqd pos restore;");
 	
 	cliRC = 0;
       }
@@ -9626,7 +9573,7 @@ Lng32 SQLCLI_LOBcliInterface
 	cliRC = cliInterface->executeImmediate(query);
 
 	currContext.resetSqlParserFlags(0x1);
-
+	
 	if (cliRC < 0)
 	  {
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
@@ -9644,6 +9591,7 @@ Lng32 SQLCLI_LOBcliInterface
 
 	currContext.resetSqlParserFlags(0x1);
 
+	
 	if (cliRC < 0)
 	  {
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
@@ -9651,6 +9599,7 @@ Lng32 SQLCLI_LOBcliInterface
 	    goto error_return;
 	  }
 
+	  
 	
 	cliRC = 0;
       }
@@ -9671,7 +9620,6 @@ Lng32 SQLCLI_LOBcliInterface
 	if (cliRC < 0)
 	  {
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
-	    
 	    goto error_return;
 	  }
 
@@ -9684,15 +9632,12 @@ Lng32 SQLCLI_LOBcliInterface
 	cliRC = cliInterface->executeImmediate(query);
 
 	currContext.resetSqlParserFlags(0x1);
-
+	
 	if (cliRC < 0)
 	  {
 	    cliInterface->retrieveSQLDiagnostics(myDiags);
-	    
 	    goto error_return;
-	  }
-
-	
+	  }	   
 	cliRC = 0;
       }
       break;
@@ -9715,8 +9660,7 @@ Lng32 SQLCLI_LOBcliInterface
 
 	if (cliRC < 0)
 	  {
-	    cliInterface->retrieveSQLDiagnostics(myDiags);
-	    
+	    cliInterface->retrieveSQLDiagnostics(myDiags);	    
 	    goto error_return;
 	  }
 
@@ -9751,11 +9695,11 @@ Lng32 SQLCLI_LOBcliInterface
 	    goto error_return;
 	  }
 
-	if (outDescPartnKey)
-	  *outDescPartnKey = descPartnKey;
+	if (inoutDescPartnKey)
+	  *inoutDescPartnKey = descPartnKey;
 
-	if (outDescSyskey)
-	  *outDescSyskey = descSyskey;
+	if (inoutDescSyskey)
+	  *inoutDescSyskey = descSyskey;
 
 	// update lob handle with the returned values
 	if (outLobHandle)
@@ -9766,7 +9710,9 @@ Lng32 SQLCLI_LOBcliInterface
 	    if (outLobHandleLen)
 	      *outLobHandleLen = inLobHandleLen;
 	  }
+       
 
+    
 	cliRC = 0;
       }
       break;
@@ -9825,7 +9771,8 @@ Lng32 SQLCLI_LOBcliInterface
 	    str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, %d, %Ld, %Ld, NULL)",
 			lobDescChunksName, descPartnKey, inDescSyskey, 
 			numChunks, (dataLen ? *dataLen : 0),
-			(dataOffset ? *dataOffset : 0));
+			(dataOffset ? *dataOffset : 0)
+			);
 	  }
 	
 	// set parserflags to allow ghost table
@@ -9841,7 +9788,14 @@ Lng32 SQLCLI_LOBcliInterface
 	    
 	    goto error_return;
 	  }
+      	if (inoutDescPartnKey)
+	  *inoutDescPartnKey = descPartnKey;
+
+	if (inoutDescSyskey)
+	  *inoutDescSyskey = inDescSyskey;
 
+        if(blackBoxLen)
+          *blackBoxLen = numChunks;
 	cliRC = 0;
 
 	//	if (outDescSyskey)
@@ -9923,7 +9877,7 @@ Lng32 SQLCLI_LOBcliInterface
 	    
 	    goto error_return;
 	  }
-
+       
 	// update lob handle with the returned values
 	if (outLobHandle)
 	  {
@@ -9933,7 +9887,11 @@ Lng32 SQLCLI_LOBcliInterface
 	    if (outLobHandleLen)
 	      *outLobHandleLen = inLobHandleLen;
 	  }
+	if (inoutDescPartnKey)
+	  *inoutDescPartnKey = descPartnKey;
 
+	if (inoutDescSyskey)
+	  *inoutDescSyskey = inDescSyskey;
 	cliRC = 0;
       }
       break;
@@ -9975,10 +9933,7 @@ Lng32 SQLCLI_LOBcliInterface
 	    
 	    goto error_return;
 	  }
-
-	cliRC = 0;
-	//	if (outDescSyskey)
-	//	  *outDescSyskey = inDescSyskey;
+        
       }
       break;
 
@@ -10038,7 +9993,7 @@ Lng32 SQLCLI_LOBcliInterface
 	  }
 	
 	// This lob has only one chunk. Read and return the single descriptor.
-	str_sprintf(query, "select c.chunkLen, c.intParam from table(ghost table %s) h, table(ghost table %s) c where h.descPartnKey = c.descPartnKey and h.syskey = c.descSyskey and h.descPartnKey = %Ld and h.syskey = %Ld and c.chunkNum = h.numChunks for read committed access",
+	str_sprintf(query, "select c.chunkLen, c.dataOffset from table(ghost table %s) h, table(ghost table %s) c where h.descPartnKey = c.descPartnKey and h.syskey = c.descSyskey and h.descPartnKey = %Ld and h.syskey = %Ld and c.chunkNum = h.numChunks for read committed access",
 		    lobDescHandleName, lobDescChunksName, 
 		    descPartnKey, inDescSyskey);
 
@@ -10081,11 +10036,11 @@ Lng32 SQLCLI_LOBcliInterface
 	    if (dataOffset)
 	      str_cpy_all((char*)dataOffset, ptr, len);
 
-	    if (outDescPartnKey)
-	      *outDescPartnKey = descPartnKey;
+	    if (inoutDescPartnKey)
+	      *inoutDescPartnKey = descPartnKey;
 
-	    if (outDescSyskey)
-	      *outDescSyskey = inDescSyskey;
+	    if (inoutDescSyskey)
+	      *inoutDescSyskey = inDescSyskey;
 	  }
 	//	else
 	//cliRC = -100;
@@ -10106,7 +10061,7 @@ Lng32 SQLCLI_LOBcliInterface
 
    case LOB_CLI_SELECT_CURSOR:
       {
-	str_sprintf(query, "select intParam, chunkLen from table(ghost table %s) where descPartnKey = %Ld and descSyskey = %Ld order by chunkNum for read committed access",
+	str_sprintf(query, "select dataOffset, chunkLen from table(ghost table %s) where descPartnKey = %Ld and descSyskey = %Ld order by chunkNum for read committed access",
 		    lobDescChunksName, descPartnKey, inDescSyskey);
 
 	// set parserflags to allow ghost table
@@ -10233,7 +10188,7 @@ Lng32 SQLCLI_LOBcliInterface
 	
 	//aggregate on chunklen for this lob.
 
-	str_sprintf (query,  "select sum(chunklen) from %s   where descpartnkey = %Ld and descsyskey = %Ld ", lobDescChunksName, descPartnKey, inDescSyskey );
+	str_sprintf (query,  "select sum(chunklen) from  %s   where descpartnkey = %Ld and descsyskey = %Ld ", lobDescChunksName, descPartnKey, inDescSyskey );
 
 	// set parserflags to allow ghost table
 	currContext.setSqlParserFlags(0x1);
@@ -10241,11 +10196,11 @@ Lng32 SQLCLI_LOBcliInterface
 
 	Int64 outlen = 0;Lng32 len = 0;
 	cliRC = cliInterface->executeImmediate(query,(char *)dataLen, &len, FALSE);
-	    if (outDescPartnKey)
-	      *outDescPartnKey = descPartnKey;
+	    if (inoutDescPartnKey)
+	      *inoutDescPartnKey = descPartnKey;
 
-	    if (outDescSyskey)
-	      *outDescSyskey = inDescSyskey;
+	    if (inoutDescSyskey)
+	      *inoutDescSyskey = inDescSyskey;
 	    
 
 
@@ -10262,6 +10217,7 @@ Lng32 SQLCLI_LOBcliInterface
 	cliRC = saveCliErr;
       }
       break;
+        
     } // switch 
 
   // normal return. Fall down to deallocate of structures.
@@ -10302,10 +10258,274 @@ Lng32 SQLCLI_LOBcliInterface
   else
     return 0;
 }
+/* The process for GC is as follows:
+1. Check LOB descriptor chunks table (per column) for any holes in the LOB sections.
+2. Create an in memory array that can be used to calculate new offsets.
+3. Update the lob descriptor chunks table to reflect the new offsets
+   if any error, return an error and rollback the user transaction.
+4. Compact the lob data file buy doing hte following :
+   a) Save a copy of the LOB data file.
+   b) Create a temp lob file to copy the sections contiguously from the lob data file to the temp file.
+        If any error return an error and rollback all updates to the lob descriptor chunks table.
+   c) Delete the lob data file. 
+   d) Rename the tempfile to original lob data file name.
+      If any error, restore the lob data file from the saved backup in step (a)
+   e) Purge the saved backup.
+*/
+
 
+Lng32 SQLCLI_LOB_GC_Interface
+(
+     /*IN*/     CliGlobals *cliGlobals,
+     /*IN*/     void *lobGlobals, // can be passed or NULL
+     /*IN*/     char * handle,
+     /*IN*/     Lng32  handleLen,
+     /*IN*/     char*  hdfsServer,
+     /*IN*/     Lng32  hdfsPort,
+     /*IN*/     char  *lobLocation,
+     /*IN*/    Int64 lobMaxMemChunkLen // if passed in as 0, will use default value of 1G for the in memory buffer to do compaction.
+ )
+{
+  Lng32 cliRC = 0;
+
+  ContextCli   & currContext = *(cliGlobals->currContext());
+  ComDiagsArea & diags       = currContext.diags();
+
+  ComDiagsArea * myDiags = ComDiagsArea::allocate(currContext.exHeap());
+
+  ExeCliInterface *cliInterface = NULL;
+  cliInterface = new (currContext.exHeap()) 
+    ExeCliInterface(currContext.exHeap(),
+		    SQLCHARSETCODE_UTF8,
+		    &currContext,
+		    NULL);
+  Int32 rc = 0;
+  Int16 flags = 0;
+  Lng32 lobType = 1;
+  Lng32 lobNum = 0;
+  Int64 uid = 0;
+  Int64 inDescSyskey, inDescPartnKey;
+  short schNameLen = 0;
+  char schName[512];
+  if (handle)
+    {
+      ExpLOBoper::extractFromLOBhandle(&flags, &lobType, &lobNum, &uid,  
+				       &inDescSyskey, &inDescPartnKey,
+				       &schNameLen, schName,
+				       handle);
+    }
+
+  char tgtLobNameBuf[100];
+  char * tgtLobName = 
+    ExpLOBoper::ExpGetLOBname(uid, lobNum, tgtLobNameBuf, 100);
+
+  char lobDescHandleNameBuf[1024];
+  Lng32 lobDescHandleNameLen = 1024;
+  char * lobDescHandleName = 
+    ExpLOBoper::ExpGetLOBDescHandleName(schNameLen, schName, uid, lobNum,
+					lobDescHandleNameBuf, lobDescHandleNameLen);
+  
+  char lobDescChunksNameBuf[1024];
+  Lng32 lobDescChunksNameLen = 1024;
+  char * lobDescChunksName = 
+    ExpLOBoper::ExpGetLOBDescChunksName(schNameLen, schName, uid, lobNum,
+					lobDescChunksNameBuf, lobDescChunksNameLen);
+  
+ 
+  char * query = new(currContext.exHeap()) char[4096];
+  //Find how many entries in the descchunks table to allocate 
+  //in memory array.
+  str_sprintf(query, "select count(*) from table(ghost table %s) ",
+              lobDescChunksName);		    
+
+  // set parserflags to allow ghost table
+  currContext.setSqlParserFlags(0x1);
+	
+  Lng32 numEntries = 0;
+  Lng32 len;
+  cliRC = cliInterface->executeImmediate(query, (char*)&numEntries, &len, FALSE);
+
+  currContext.resetSqlParserFlags(0x1);
+
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(myDiags);
+	    
+      goto error_return;
+    }  
+  {     
+  //Allocate an inmemory array of numEntries.
+  ExLobInMemoryDescChunksEntry *dcInMemoryArray = new ExLobInMemoryDescChunksEntry[numEntries];
+  //Read the desc chunks table into memory
+        
+  str_sprintf(query, "select dataOffset, descPartnKey,descSyskey,chunkLen,chunkNum from table(ghost table %s) order by dataOffset for read committed access",
+              lobDescChunksName);
+
+  // set parserflags to allow ghost table
+  currContext.setSqlParserFlags(0x1);
+	
+  cliRC = cliInterface->fetchRowsPrologue(query);
+
+  currContext.resetSqlParserFlags(0x1);
+
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(myDiags);
+	    
+      goto error_return;
+    }
+  cliRC = cliInterface->fetch();
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(myDiags);
+
+      cliInterface->fetchRowsEpilogue(0);
+
+      goto error_return;
+    }
+  
+  short i = 0;
+  Int64 currentOffset = 0;
+  Int64 descPartnKey = 0;
+  Int64 descSyskey = 0;
+  Int64 chunkLen = 0;
+  Int64 chunkNum = 0;
+  while (cliRC != 100)
+    {
+      char * ptr;
+      Lng32 len;
+
+      cliInterface->getPtrAndLen(1, ptr, len);	   
+      str_cpy_all((char*)&currentOffset, ptr, len);
+
+      cliInterface->getPtrAndLen(2, ptr, len);	    	    
+      str_cpy_all((char*)&descPartnKey, ptr, len);
+
+      cliInterface->getPtrAndLen(3, ptr, len);	    	    
+      str_cpy_all((char*)&descSyskey, ptr, len);
+
+      cliInterface->getPtrAndLen(4, ptr, len);	    	    
+      str_cpy_all((char*)&chunkLen, ptr, len);
+
+      cliInterface->getPtrAndLen(5, ptr, len);	    	    
+      str_cpy_all((char*)&chunkNum, ptr, len);
+           
+      dcInMemoryArray[i].setCurrentOffset(currentOffset);
+      dcInMemoryArray[i].setNewOffset(currentOffset);
+      dcInMemoryArray[i].setDescPartnKey(descPartnKey);
+      dcInMemoryArray[i].setSyskey(descSyskey);
+      dcInMemoryArray[i].setChunkLen(chunkLen);
+      dcInMemoryArray[i].setChunkNum(chunkNum);
+      cliRC = cliInterface->fetch();
+      i++;
+      if (cliRC < 0)
+        {
+          cliInterface->retrieveSQLDiagnostics(myDiags);
+
+          cliInterface->fetchRowsEpilogue(0);
+
+          goto error_return;
+        }
+    }
+	
+  cliRC = cliInterface->fetchRowsEpilogue(0);
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(myDiags);
+	    
+      goto error_return;
+    }
+ 
+  // adjust in memory array to calculate holes and new offsets.
+  ExpLOBoper::calculateNewOffsets(dcInMemoryArray,numEntries);
+        
+        
+  // Update the descChunks table with new offsets
+  //TBD start a separate transaction to manage this.
+  //For now use the transaction associated with the IUD operation 
+  //that triggered this GC
+
+  i = 0;
+  while (i < numEntries)
+    {
+      if (dcInMemoryArray[i].getCurrentOffset() == dcInMemoryArray[i].getNewOffset())
+        i++;
+      else
+        {
+          str_sprintf(query, "update table(ghost table %s) set dataOffset=%Ld, chunkLen = %Ld where descPartnKey = %Ld and descSysKey = %Ld",
+                      lobDescChunksName, 
+                      dcInMemoryArray[i].getNewOffset(),
+                      dcInMemoryArray[i].getChunkLen(),
+                      dcInMemoryArray[i].getDescPartnKey(), 
+                      dcInMemoryArray[i].getSyskey());
+          // set parserflags to allow ghost table
+          currContext.setSqlParserFlags(0x1);
+	
+          cliRC = cliInterface->executeImmediate(query);
+          currContext.resetSqlParserFlags(0x1);
+
+          if (cliRC < 0)
+            {
+              cliInterface->retrieveSQLDiagnostics(myDiags);
+	    
+              //tbd Give warning and rollback just these updates  and return with warning. For now return error and abort the iud operation itself since there is no support for nested transactions or SUSPEND and RESUME. 
+              goto error_return;
+            }
+          i++;
+        }
+    }
+       
+  // Compact into new temp file
+       
+        
+  rc = ExpLOBoper::compactLobDataFile(lobGlobals,dcInMemoryArray,numEntries,tgtLobName,lobMaxMemChunkLen, (void *)currContext.exHeap(), hdfsServer, hdfsPort,lobLocation);
+               
+  if (rc )
+    {
+      cliRC = 9999; // Warning 
+      ComDiagsArea * da = &diags;
+      ExRaiseSqlError(currContext.exHeap(), &da, 
+                      (ExeErrorCode)(8442), NULL, &cliRC    , 
+                      &rc, NULL, (char*)"Lob GC call",
+                      getLobErrStr(rc));
+      // TBD When local transaction support is in
+      // rollback all the updates to the lob desc chunks file too. 
+      // return with warning
+      // For now, return error for the IUD operation
+
+      // Restore original data file.
+      Int32 rc2=ExpLOBoper::restoreLobDataFile(lobGlobals,tgtLobName, (void *)currContext.exHeap(),hdfsServer,hdfsPort,lobLocation);
+      // if error restoring, this lob could become corrupt.
+      goto error_return;
+    }
+  else
+    {
+      //TBD :commit all updates and remove the saved copy of datafile
+      ExpLOBoper::purgeBackupLobDataFile(lobGlobals, tgtLobName,(void *)currContext.exHeap(),hdfsServer,hdfsPort,lobLocation);
+    }
+  }
+ error_return:
+
+  Lng32 tempCliRC = 0;
+  NADELETEBASIC(query, currContext.exHeap());
+
+
+  if (cliRC < 0)
+    {
+      if (myDiags->getNumber() > 0)
+	{
+	  diags.mergeAfter(*myDiags);
+	}
+      return cliRC;
+    }
+  else if (cliRC == 100)
+    return 100;
+  else
+    return 0;   
+}
 Lng32 SQLCLI_LOBddlInterface
 (
- /*IN*/     CliGlobals *cliGlobals,
+/*IN*/     CliGlobals *cliGlobals,
  /*IN*/     char * schName,
  /*IN*/     Lng32  schNameLen,
  /*IN*/     Int64  objectUID,
@@ -10314,8 +10534,11 @@ Lng32 SQLCLI_LOBddlInterface
  /*IN*/     short *lobNumList,
  /*IN*/     short *lobTypList,
  /*IN*/     char* *lobLocList,
+ /*IN*/     char *hdfsServer,
+ /*IN*/     Int32 hdfsPort,
  /*IN*/    Int64 lobMaxSize
  )
+ 
 {
   Lng32 cliRC = 0;
 
@@ -10343,22 +10566,14 @@ Lng32 SQLCLI_LOBddlInterface
     {
     case LOB_CLI_CREATE:
       {
-	cliRC = cliInterface->executeImmediate("cqd pos hold;");
-	cliRC = cliInterface->executeImmediate("cqd pos 'OFF';");
-
+	
 	// create lob metadata table
-	str_sprintf(query, "create ghost table %s (lobnum smallint not null, storagetype smallint not null, location varchar(4096) not null, primary key (lobnum)) location $system",
-		    //	str_sprintf(query, "create ghost table %s (lobnum smallint not null, storagetype smallint not null, location varchar(4096) not null, primary key (lobnum)) no partition",
-		    lobMDName);
+	str_sprintf(query, "create ghost table %s (lobnum smallint not null, storagetype smallint not null, location varchar(4096) not null, primary key (lobnum)) ",lobMDName);
 	
 	// set parserflags to allow ghost table
 	currContext.setSqlParserFlags(0x1);
 	
-	cliRC = cliInterface->executeImmediate(query);
-
-	cliInterface->executeImmediate("cqd pos restore;");
-
-	
+	cliRC = cliInterface->executeImmediate(query);	
 	currContext.resetSqlParserFlags(0x1);
 	
 	if (cliRC < 0)
@@ -10397,8 +10612,8 @@ Lng32 SQLCLI_LOBddlInterface
 	    // create lob data tables
 	    Lng32 rc = ExpLOBoper::createLOB
 	      (NULL, currContext.exHeap(),
-	       lobLocList[i],
-	       objectUID, lobNumList[i], lobMaxSize);
+	       lobLocList[i],  hdfsPort,hdfsServer,
+	       objectUID, lobNumList[i],lobMaxSize);
 	    
 	    if (rc)
 	      {
@@ -10407,6 +10622,7 @@ Lng32 SQLCLI_LOBddlInterface
 		ExRaiseSqlError(currContext.exHeap(), &da, 
 			    (ExeErrorCode)(8442), NULL, &cliRC    , 
 			    &rc, NULL, (char*)"ExpLOBInterfaceCreate",
+
 			    getLobErrStr(rc));
 		goto error_return;
 	      }
@@ -10457,10 +10673,11 @@ Lng32 SQLCLI_LOBddlInterface
 	cliRC = cliInterface->executeImmediate(query);
 	
 	currContext.resetSqlParserFlags(0x1);
-	
+
 	if (cliRC < 0)
 	  {
-	    cliInterface->retrieveSQLDiagnostics(&diags);	    
+	    cliInterface->retrieveSQLDiagnostics(&diags);
+	    
 	    goto error_return;
 	  }
 	
@@ -10469,7 +10686,7 @@ Lng32 SQLCLI_LOBddlInterface
 	  {
 	    Lng32 rc = ExpLOBoper::dropLOB
 	      (NULL, currContext.exHeap(),
-	       lobLocList[i],
+	       lobLocList[i],hdfsPort,hdfsServer,
 	       objectUID, lobNumList[i]);
 	    
 	    if (rc)
@@ -10541,7 +10758,7 @@ Lng32 SQLCLI_LOBddlInterface
 	  {
 	    Lng32 rc = ExpLOBoper::dropLOB
 	      (NULL, currContext.exHeap(),
-	       lobLocList[i],
+	       lobLocList[i],hdfsPort, hdfsServer,
 	       objectUID, lobNumList[i]);
 	    
 	    if (rc)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/cli/Cli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.h b/core/sql/cli/Cli.h
index 9bffc5c..db96c87 100644
--- a/core/sql/cli/Cli.h
+++ b/core/sql/cli/Cli.h
@@ -895,7 +895,7 @@ Lng32 SQLCLI_LOBcliInterface
  /*IN*/     char * inLobHandle,
  /*IN*/     Lng32  inLobHandleLen,
  /*IN*/     char * blackBox,
- /*IN*/     Lng32* blackBoxLen,
+ /*IN*/     Int32* blackBoxLen,
  /*OUT*/    char * outLobHandle,
  /*OUT*/    Lng32 * outLobHandleLen,
  /*IN*/     LOBcliQueryType qType,
@@ -909,6 +909,17 @@ Lng32 SQLCLI_LOBcliInterface
  /*INOUT*/  void* *inCliInterface,
  /*IN*/     Int64 xnId          /* xn id of the parent process, if non-zero */
  );
+Lng32 SQLCLI_LOB_GC_Interface
+(
+ /*IN*/     CliGlobals *cliGlobals,
+ /*IN*/     void *lobGlobals, // can be passed or NULL
+ /*IN*/     char * handle,
+ /*IN*/     Lng32  handleLen,
+ /*IN*/     char*  hdfsServer,
+ /*IN*/     Lng32  hdfsPort,
+ /*IN*/     char *lobLocation,
+ /*IN*/    Int64 lobMaxMemChunkLen // if passed in as 0, will use default value of 1G for the in memory buffer to do compaction.
+ );
 
 Lng32 SQLCLI_LOBddlInterface
 (
@@ -921,6 +932,8 @@ Lng32 SQLCLI_LOBddlInterface
  /*IN*/     short *lobNumList,
  /*IN*/     short *lobTypList,
  /*IN*/     char* *lobLocList,
+ /*IN*/    char *hdfsServer,
+ /*IN*/    Int32 hdfsPort,
  /*IN*/     Int64 lobMaxSize
  );
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/cli/CliExpExchange.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliExpExchange.cpp b/core/sql/cli/CliExpExchange.cpp
index b313040..871985d 100644
--- a/core/sql/cli/CliExpExchange.cpp
+++ b/core/sql/cli/CliExpExchange.cpp
@@ -207,14 +207,17 @@ ex_expr::exp_return_type InputOutputExpr::describeOutput(void * output_desc_,
 	  
           // Use SQLDESC_CHAR_SET_NAM (one-part name) for charset
 
-	  if ( DFS2REC::isAnyCharacter(operand->getDatatype()) ) {
-	    output_desc->setDescItem(entry, SQLDESC_CHAR_SET_NAM, 0, 
-	      (char*)CharInfo::getCharSetName(operand->getCharSet()));
+	  if ( DFS2REC::isAnyCharacter(operand->getDatatype()) || 
+               (operand->getDatatype() == REC_BLOB) || 
+               (operand->getDatatype() == REC_CLOB )) 
+            {
+              output_desc->setDescItem(entry, SQLDESC_CHAR_SET_NAM, 0, 
+                                       (char*)CharInfo::getCharSetName(operand->getCharSet()));
 
-            // reset the length for Unicode
+              // reset the length for Unicode
             if ( operand->getCharSet() == CharInfo::UNICODE ||
                  CharInfo::is_NCHAR_MP(operand->getCharSet())
-               )
+                 )
 	      {
 		length = operand->getLength()/SQL_DBCHAR_SIZE;
 	      }
@@ -2240,8 +2243,9 @@ ex_expr::exp_return_type InputOutputExpr::describeInput(void * input_desc_,
           }
 	
           // Use SQLDESC_CHAR_SET_NAM (one-part name) for charset
-	  if ((dataType >= REC_MIN_CHARACTER) &&
-              (dataType <= REC_MAX_CHARACTER)) {
+	  if (((dataType >= REC_MIN_CHARACTER) &&
+               (dataType <= REC_MAX_CHARACTER)) )
+            {
 	    input_desc->setDescItem(entry, SQLDESC_CHAR_SET_NAM, 0, 
 	      (char*)CharInfo::getCharSetName(operand->getCharSet()));
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/cli/CliExtern.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliExtern.cpp b/core/sql/cli/CliExtern.cpp
index 127380f..e5dd796 100644
--- a/core/sql/cli/CliExtern.cpp
+++ b/core/sql/cli/CliExtern.cpp
@@ -7359,7 +7359,7 @@ SQLCLI_LIB_FUNC Lng32 SQL_EXEC_LOBcliInterface
  /*IN*/     char * inLobHandle,
  /*IN*/     Lng32  inLobHandleLen,
  /*IN*/     char * blackBox,
- /*IN*/     Lng32* blackBoxLen,
+ /*IN*/     Int32* blackBoxLen,
  /*OUT*/    char * outLobHandle,
  /*OUT*/    Lng32 * outLobHandleLen,
  /*IN*/     LOBcliQueryType qType,
@@ -7415,6 +7415,51 @@ SQLCLI_LIB_FUNC Lng32 SQL_EXEC_LOBcliInterface
   RecordError(NULL, retcode);
   return retcode;
 }
+Lng32 SQL_EXEC_LOB_GC_Interface
+(
+ /*IN*/     void *lobGlobals, // can be passed or NULL
+ /*IN*/     char * handle,
+ /*IN*/     Lng32  handleLen,
+ /*IN*/     char*  hdfsServer,
+ /*IN*/     Lng32  hdfsPort,
+ /*IN*/     char *lobLocation,
+ /*IN*/    Int64 lobMaxMemChunkLen // if passed in as 0, will use default value of 1G for the in memory buffer to do compaction.
+ )
+{
+  Lng32 retcode;
+ CLISemaphore *tmpSemaphore;
+   ContextCli   *threadContext;
+  CLI_NONPRIV_PROLOGUE(retcode);
+  try
+    {
+      tmpSemaphore = getCliSemaphore(threadContext);
+      tmpSemaphore->get();
+      threadContext->incrNumOfCliCalls();
+      retcode = SQLCLI_LOB_GC_Interface(GetCliGlobals(),
+                                        lobGlobals,
+                                        handle,
+                                        handleLen,
+                                        hdfsServer,
+                                        hdfsPort,lobLocation,
+                                        lobMaxMemChunkLen);
+    }
+  catch(...)
+    {
+      retcode = -CLI_INTERNAL_ERROR;
+#if defined(_THROW_EXCEPTIONS)
+      if (cliWillThrow())
+	{
+          threadContext->decrNumOfCliCalls();
+	  tmpSemaphore->release();
+	  throw;
+	}
+#endif
+     }
+  threadContext->decrNumOfCliCalls();
+  tmpSemaphore->release();
+  RecordError(NULL, retcode);
+  return retcode;
+ }
 
 Lng32 SQL_EXEC_LOBddlInterface
 (
@@ -7426,6 +7471,8 @@ Lng32 SQL_EXEC_LOBddlInterface
  /*IN*/     short *lobNumList,
  /*IN*/     short *lobTypList,
  /*IN*/     char* *lobLocList,
+ /*IN*/     char *hdfsServer,
+ /*IN*/     Int32 hdfsPort,
  /*IN */    Int64 lobMaxSize
  )
 {
@@ -7446,7 +7493,10 @@ Lng32 SQL_EXEC_LOBddlInterface
 				      qType,
 				      lobNumList,
 				      lobTypList,
-				       lobLocList, lobMaxSize);
+				       lobLocList,
+                                       hdfsServer,
+                                       hdfsPort, 
+                                       lobMaxSize);
     }
   catch(...)
     {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/cli/Descriptor.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Descriptor.cpp b/core/sql/cli/Descriptor.cpp
index 7cf666a..e369ee6 100644
--- a/core/sql/cli/Descriptor.cpp
+++ b/core/sql/cli/Descriptor.cpp
@@ -2931,9 +2931,9 @@ RETCODE Descriptor::setDescItem(Lng32 entry, Lng32 what_to_set,
           if ( charset_name == NULL )
              charset_name = (char*)CharInfo::getCharSetName(newCharSet);
 
-          if ( !DFS2REC::isAnyCharacter(descItem.datatype) || 
-               !CharInfo::isCharSetSupported(newCharSet) 
-             ) 
+          if (( !DFS2REC::isAnyCharacter(descItem.datatype)  || 
+               !CharInfo::isCharSetSupported(newCharSet)  
+                ) && !((descItem.datatype != REC_BLOB) ||(descItem.datatype != REC_CLOB)))
           {
               //Error 8895: An invalid character set name for the descriptor item SQLDESC_CHAR_SET.
       	      diags << DgSqlCode(-CLI_INVALID_CHARSET_FOR_DESCRIPTOR) << DgString0(charset_name);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/comexe/ComQueue.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComQueue.h b/core/sql/comexe/ComQueue.h
index 7dbfe89..b42c472 100644
--- a/core/sql/comexe/ComQueue.h
+++ b/core/sql/comexe/ComQueue.h
@@ -203,7 +203,7 @@ NA_EIDPROC
 NA_EIDPROC
   void * get();
 
-  // returns the i'th entry
+  // returns the i'th entry. 0 based. First entry is i = 0
 NA_EIDPROC
   void * get(ULng32 i);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/comexe/ComTdb.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdb.h b/core/sql/comexe/ComTdb.h
index 5846fd8..a7f7d25 100644
--- a/core/sql/comexe/ComTdb.h
+++ b/core/sql/comexe/ComTdb.h
@@ -995,6 +995,7 @@ class ComTdbVirtTableIndexInfo : public ComTdbVirtTableBase
 
   const char * baseTableName;
   const char * indexName;
+  Int64 indexUID;
   Lng32 keytag;
   Lng32 isUnique;
   Lng32 isExplicit;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/comexe/ComTdbHbaseAccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHbaseAccess.cpp b/core/sql/comexe/ComTdbHbaseAccess.cpp
index 7d3c3b1..e30787d 100644
--- a/core/sql/comexe/ComTdbHbaseAccess.cpp
+++ b/core/sql/comexe/ComTdbHbaseAccess.cpp
@@ -335,7 +335,7 @@ ComTdbHbaseAccess::getExpressionName(Int32 expNum) const
     case 3: 
       return "UpdateExpr";
     case 4: 
-      return "MergeInsertExpr";
+      return ((getAccessType() == DELETE_) ? "LobDeleteExpr" : "MergeInsertExpr");
     case 5:
       return "LowKeyExpr";
     case 6:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/comexe/ComTdbHbaseAccess.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHbaseAccess.h b/core/sql/comexe/ComTdbHbaseAccess.h
index 909a2ed..f430b39 100644
--- a/core/sql/comexe/ComTdbHbaseAccess.h
+++ b/core/sql/comexe/ComTdbHbaseAccess.h
@@ -154,7 +154,7 @@ public:
     return NULL;
   };
 
-  ComTdbAccessType getAccessType() { return ComTdbAccessType(accessType_); }
+  ComTdbAccessType getAccessType() const { return ComTdbAccessType(accessType_); }
 
   class HbaseScanRows : public NAVersionedObject
   {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/CharType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/CharType.cpp b/core/sql/common/CharType.cpp
index 40d258d..6f9e8a3 100644
--- a/core/sql/common/CharType.cpp
+++ b/core/sql/common/CharType.cpp
@@ -1536,6 +1536,7 @@ SQLBlob::SQLBlob(
 	   externalFormat,
 	   extFormatLen)
 {
+  setCharSet(CharInfo::ISO88591);//lobhandle can only be in ISO format
 }
 
 NAType *SQLBlob::newCopy(NAMemory* h) const
@@ -1588,7 +1589,7 @@ SQLClob::SQLClob(
 	   externalFormat,
 	   extFormatLen)
 {
-  setCharSet(CharInfo::DefaultCharSet);
+  setCharSet(CharInfo::ISO88591); //lob handle can only be in this format
 }
 
 NAType *SQLClob::newCopy(NAMemory* h) const

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/CharType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/CharType.h b/core/sql/common/CharType.h
index f76f574..7d0c383 100644
--- a/core/sql/common/CharType.h
+++ b/core/sql/common/CharType.h
@@ -817,7 +817,7 @@ public:
 	  NABoolean allowSQLnull	= TRUE,
 	  NABoolean inlineIfPossible = FALSE,
 	  NABoolean externalFormat = FALSE,
-	  Lng32 extFormatLen = 100);
+	  Lng32 extFormatLen = 1024);
  SQLClob(const SQLClob & aClob,NAMemory * heap)
    :SQLlob(aClob,heap)
     {}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/ComMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.cpp b/core/sql/common/ComMisc.cpp
index b9b94a5..76313a2 100644
--- a/core/sql/common/ComMisc.cpp
+++ b/core/sql/common/ComMisc.cpp
@@ -228,4 +228,17 @@ NAString ComConvertTrafNameToNativeName(
   return convertedName;
 }
 
+NABoolean ComTrafReservedColName(
+     const NAString &colName)
+{
+
+  if ((colName == TRAF_SALT_COLNAME) ||
+      (colName == TRAF_SYSKEY_COLNAME))
+    return TRUE;
 
+  if ((memcmp(colName.data(), TRAF_DIVISION_COLNAME_PREFIX, strlen(TRAF_DIVISION_COLNAME_PREFIX)) == 0) &&
+      (colName.data()[colName.length()-1] == '_'))
+    return TRUE;
+
+  return FALSE;
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/ComMisc.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.h b/core/sql/common/ComMisc.h
index 65aca95..8049209 100644
--- a/core/sql/common/ComMisc.h
+++ b/core/sql/common/ComMisc.h
@@ -65,4 +65,12 @@ NAString ComConvertTrafNameToNativeName(
                                          const NAString &schemaName,
                                          const NAString &objectName);
 
+// returns TRUE if specified name is a reserved name.
+// Currently, reserved names for traf internal usage are:
+//   SYSKEY
+//   _SALT_
+//   _DIVISION_*_   :_DIVISION_ prefix followed by division number and ending
+//                   with underscore(_)
+NABoolean ComTrafReservedColName(const NAString &colName);
+
 #endif // COMMISC_H

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/ComSmallDefs.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSmallDefs.h b/core/sql/common/ComSmallDefs.h
index 9a10fc8..f83e199 100644
--- a/core/sql/common/ComSmallDefs.h
+++ b/core/sql/common/ComSmallDefs.h
@@ -122,7 +122,9 @@ typedef NABoolean               ComBoolean;
 #define SEABASE_OLD_PRIVMGR_SCHEMA         "PRIVMGR_MD"
 #define SEABASE_PRIVMGR_SCHEMA         "_PRIVMGR_MD_"
 #define SEABASE_UDF_SCHEMA             "_UDF_"
-
+#define LOB_MD_PREFIX                  "LOBMD_"
+#define LOB_DESC_CHUNK_PREFIX          "LOBDescChunks_"
+#define LOB_DESC_HANDLE_PREFIX         "LOBDescHandle_"
 #define SEABASE_DEFAULT_COL_FAMILY "#1"
 
 // reserved names for seabase metadata where SQL table information is kept
@@ -169,6 +171,16 @@ typedef NABoolean               ComBoolean;
 
 #define SEABASE_REGRESS_DEFAULT_SCHEMA "SCH"
 
+// Trafodion system library and procedures reserved schema
+// Procedures are defined in CmpSeabaseDDLroutine.h
+#define SEABASE_LIBMGR_SCHEMA "_LIBMGR_"
+#define SEABASE_LIBMGR_LIBRARY "DB__LIBMGRNAME"
+
+// reserved column names for traf internal system usage
+#define TRAF_SALT_COLNAME "_SALT_"
+#define TRAF_DIVISION_COLNAME_PREFIX "_DIVISION_"
+#define TRAF_SYSKEY_COLNAME "SYSKEY"
+
 // length of explain_plan column in metric_query_table.
 // explain_plan greater than this length are chunked and store in multiple
 // rows in metric_text_table

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/ComUser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComUser.cpp b/core/sql/common/ComUser.cpp
index 504ce06..7e7d7ca 100644
--- a/core/sql/common/ComUser.cpp
+++ b/core/sql/common/ComUser.cpp
@@ -347,3 +347,57 @@ Int16 ComUser::getAuthNameFromAuthID(Int32   authID,
 
   return FEOK;
 }
+
+// ----------------------------------------------------------------------------
+// method: getRoleList
+//
+// Returns the list of system roles
+// Params:
+//   (out) roleList - the list of roles, space is managed by the caller
+//   (out) actualLen - the length of the returned role list
+//   ( in) maxLen - the size of the roleList allocated by the caller
+//   ( in) delimited - delimiter to use (defaults to single quote)
+//   ( in) separator - specified what separator to use (defaults to comma)
+//   ( in) includeSpecialAuths - includes the special auths (PUBLIC and _SYSTEM) 
+//
+//  Returns:  FEOK -- found
+//            FEBUFTOOSMALL -- space allocated for role list is too small 
+// ----------------------------------------------------------------------------
+Int32 ComUser::getRoleList (char * roleList,
+                            Int32 &actualLen,
+                            const Int32 maxLen,
+                            const char delimiter,
+                            const char separator,
+                            const bool includeSpecialAuths)
+{
+  Int32 numberRoles = sizeof(systemRoles)/sizeof(SystemRolesStruct);
+  Int32 roleListLen = (MAX_AUTHNAME_LEN*numberRoles)+(numberRoles * 4); // 4 = 2 del + 2 sep
+  char generatedRoleList[roleListLen];
+  char *pRoles = generatedRoleList;
+  char roleName[MAX_AUTHNAME_LEN + 4];
+  char currentSeparator = ' ';
+  for (Int32 i = 0; i < numberRoles; i++)
+  {
+    const SystemRolesStruct &roleDefinition = systemRoles[i];
+    if (!includeSpecialAuths && roleDefinition.isSpecialAuth)
+      continue;
+
+    // str_sprintf does not support the %c format
+    sprintf(roleName, "%c%c%s%c",
+                currentSeparator, delimiter, roleDefinition.roleName, delimiter);
+    str_cpy_all(pRoles, roleName, sizeof(roleName)-1); // don't copy null terminator 
+    currentSeparator = separator;
+    pRoles = pRoles + strlen(roleName);
+  }
+
+  pRoles = '\0'; // null terminate string
+  pRoles = generatedRoleList;
+  actualLen = strlen(pRoles);
+  if (actualLen > maxLen) 
+    return FEBUFTOOSMALL;
+ 
+  str_cpy_all(roleList, pRoles, strlen(pRoles));
+  roleList[strlen(pRoles)] = 0; // null terminate string
+  return FEOK;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/ComUser.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComUser.h b/core/sql/common/ComUser.h
index d5f5c2e..ea00c88 100644
--- a/core/sql/common/ComUser.h
+++ b/core/sql/common/ComUser.h
@@ -90,6 +90,12 @@ class ComUser
      static Int16 getAuthIDFromAuthName (const char  * authName,
                                          Int32 & authID);
 
+     static Int32 getRoleList (char *roleList,
+                               Int32 &actualLen,
+                               const Int32 maxLen,
+                               const char delimiter = '\'',
+                               const char separator =',',
+                               const bool includeSpecialAuths = false);
 private:
    // default constructor
    ComUser ();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/NAString.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/NAString.cpp b/core/sql/common/NAString.cpp
index 8de31fc..3b9830e 100644
--- a/core/sql/common/NAString.cpp
+++ b/core/sql/common/NAString.cpp
@@ -280,6 +280,29 @@ NAString Int64ToNAString(Int64 l)
   return NAString(resultstr);
 }
 
+NAString &replaceAll(NAString &source, const NAString &searchFor,
+                     const NAString &replaceWith)
+{
+  size_t indexOfReplace = NA_NPOS;
+  indexOfReplace = source.index(searchFor);
+  if (indexOfReplace != NA_NPOS)
+    {
+      // Replace all occurences of searchFor with replaceWith. When no
+      // more occurences are found or end of string is reached, index()
+      // will return NA_NPOS.
+      while (indexOfReplace != NA_NPOS)
+        {
+          source.replace(indexOfReplace, searchFor.length(), 
+                         replaceWith);
+          // Find index of next occurence to replace.
+          indexOfReplace = 
+            source.index(searchFor, indexOfReplace + replaceWith.length()); 
+        }
+    }
+
+  return source;
+}
+
 // ---------------------------------------------------------------------
 // Hash function for NAString types in NAKeyLookup
 // ---------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/NAString.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAString.h b/core/sql/common/NAString.h
index d87cf42..10fd288 100644
--- a/core/sql/common/NAString.h
+++ b/core/sql/common/NAString.h
@@ -160,6 +160,9 @@ void	  RemoveTrailingZeros(NAString &ns);
 
 NAString Latin1StrToUTF8(const NAString & latin1Str, NAMemory * heap = NULL);
 
+NAString &replaceAll(NAString &source, const NAString &searchFor,
+                     const NAString &replaceWith);
+
 
 // See notes at NAString.cpp specialSQL_TEXT[].
 //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/NAUserId.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAUserId.h b/core/sql/common/NAUserId.h
index 992c2c3..46de6bc 100644
--- a/core/sql/common/NAUserId.h
+++ b/core/sql/common/NAUserId.h
@@ -42,23 +42,28 @@
 #define MAX_USERNAME_LEN 128
 #define MAX_AUTHNAME_LEN 128
 #define MAX_AUTHID_AS_STRING_LEN 20
+
 #define MIN_USERID 33333
 #define MAX_USERID 999999
 #define MIN_ROLEID 1000000
-#define MAX_ROLEID 1490000
+#define MAX_ROLEID_RANGE1 1490000
+#define MAX_ROLEID        1500000
 #define NA_UserId Int32
 #define NA_AuthID Int32
 #define NA_UserIdDefault 0
 
-// Defines for special users
-#define SYSTEM_AUTH_NAME "_SYSTEM"
-#define DB__ROOT         "DB__ROOT"
-
 // Defines for special roles
+// For new system roles, add a define and include it in the
+// systemRoles constant
 #define PUBLIC_AUTH_NAME "PUBLIC"
 #define DB__HIVEROLE     "DB__HIVEROLE"
 #define DB__HBASEROLE    "DB__HBASEROLE"
 #define DB__ROOTROLE     "DB__ROOTROLE"
+#define DB__LIBMGRROLE   "DB__LIBMGRROLE"
+
+// Defines for special users
+#define SYSTEM_AUTH_NAME "_SYSTEM"
+#define DB__ROOT         "DB__ROOT"
 
 #define SUPER_USER_LIT "33333"
 
@@ -71,5 +76,22 @@
 #define HIVE_ROLE_ID     1490000 
 #define HBASE_ROLE_ID    1490001
 
+struct SystemRolesStruct
+{
+   const char *roleName;
+   bool       isSpecialAuth;
+   int32_t    roleID;
+};
+
+static const SystemRolesStruct systemRoles[] 
+{ { DB__HIVEROLE, false, HIVE_ROLE_ID },
+  { DB__HBASEROLE, false, HBASE_ROLE_ID },
+  { DB__ROOTROLE, false, ROOT_ROLE_ID },
+  { DB__LIBMGRROLE, false, NA_UserIdDefault },
+  { PUBLIC_AUTH_NAME, true, PUBLIC_USER },
+  { SYSTEM_AUTH_NAME, true, SYSTEM_USER } };
+
+#define NUMBER_SPECIAL_SYSTEM_ROLES 2;
+
 
 #endif  /*  NAUSERID_H*/

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/common/OperTypeEnum.h
----------------------------------------------------------------------
diff --git a/core/sql/common/OperTypeEnum.h b/core/sql/common/OperTypeEnum.h
index 12cc0cf..30b4fa5 100644
--- a/core/sql/common/OperTypeEnum.h
+++ b/core/sql/common/OperTypeEnum.h
@@ -857,6 +857,7 @@ enum OperatorTypeEnum {
                         DDL_ALTER_TABLE_TOGGLE_ONLINE,
                         DDL_ALTER_TABLE_NAMESPACE,
                         DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE,
+                        DDL_ALTER_TABLE_ALTER_COLUMN_RENAME,
                         DDL_ALTER_TABLE_ALTER_COLUMN_DEFAULT_VALUE,
                         DDL_ALTER_TABLE_ALTER_COLUMN_SET_SG_OPTION,
                         DDL_ALTER_TABLE_ALTER_HBASE_OPTIONS,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index 1db4bee..cc481a2 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -2980,7 +2980,8 @@ short ExExeUtilLobExtractTcb::work()
 	       LOB_CLI_SELECT_UNIQUE,
 	       lobNumList,
 	       lobTypList,
-	       lobLocList,0);
+	       lobLocList,lobTdb().getLobHdfsServer(),
+               lobTdb().getLobHdfsPort(),0);
 	    if (cliRC < 0)
 	      {
 		getDiagsArea()->mergeAfter(diags);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/executor/ExHbaseAccess.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseAccess.h b/core/sql/executor/ExHbaseAccess.h
index 1c0208e..ae32a1c 100644
--- a/core/sql/executor/ExHbaseAccess.h
+++ b/core/sql/executor/ExHbaseAccess.h
@@ -205,6 +205,9 @@ protected:
   inline ex_expr *mergeInsertExpr() const 
     { return hbaseAccessTdb().mergeInsertExpr_; }
 
+  inline ex_expr *lobDelExpr() const 
+    { return hbaseAccessTdb().mergeInsertExpr_; }
+
   inline ex_expr *mergeInsertRowIdExpr() const 
     { return hbaseAccessTdb().mergeInsertRowIdExpr_; }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/executor/ExHbaseIUD.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseIUD.cpp b/core/sql/executor/ExHbaseIUD.cpp
index 522c741..296f6c2 100644
--- a/core/sql/executor/ExHbaseIUD.cpp
+++ b/core/sql/executor/ExHbaseIUD.cpp
@@ -1853,6 +1853,7 @@ ExWorkProcRetcode ExHbaseUMDtrafUniqueTaskTcb::work(short &rc)
 	      step_ = HANDLE_ERROR;
 	    else if ((tcb_->hbaseAccessTdb().getAccessType() == ComTdbHbaseAccess::DELETE_) &&
 		     (! tcb_->scanExpr()) &&
+                     (! tcb_->lobDelExpr()) &&
 		     (NOT tcb_->hbaseAccessTdb().returnRow()))
 	      step_ = DELETE_ROW;
 	    else
@@ -2243,7 +2244,19 @@ ExWorkProcRetcode ExHbaseUMDtrafUniqueTaskTcb::work(short &rc)
 		step_ = HANDLE_ERROR;
 		break;
 	      }
-	    
+
+            // delete entries from LOB desc table, if needed
+            if (tcb_->lobDelExpr())
+              {
+                ex_expr::exp_return_type exprRetCode =
+		  tcb_->lobDelExpr()->eval(pentry_down->getAtp(), tcb_->workAtp_);
+		if (exprRetCode == ex_expr::EXPR_ERROR)
+		  {
+		    step_ = HANDLE_ERROR;
+		    break;
+		  }
+              }
+
 	    if (tcb_->getHbaseAccessStats())
 	      tcb_->getHbaseAccessStats()->incUsedRows();
 
@@ -3006,6 +3019,18 @@ ExWorkProcRetcode ExHbaseUMDtrafSubsetTaskTcb::work(short &rc)
 		break;
 	      }
 	    
+            // delete entries from LOB desc table, if needed
+            if (tcb_->lobDelExpr())
+              {
+                ex_expr::exp_return_type exprRetCode =
+		  tcb_->lobDelExpr()->eval(pentry_down->getAtp(), tcb_->workAtp_);
+		if (exprRetCode == ex_expr::EXPR_ERROR)
+		  {
+		    step_ = HANDLE_ERROR;
+		    break;
+		  }
+              }
+
 	    if (tcb_->getHbaseAccessStats())
 	      tcb_->getHbaseAccessStats()->incUsedRows();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/executor/hiveHook.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/hiveHook.cpp b/core/sql/executor/hiveHook.cpp
index 523bf0a..a83ead4 100644
--- a/core/sql/executor/hiveHook.cpp
+++ b/core/sql/executor/hiveHook.cpp
@@ -591,7 +591,7 @@ struct hive_bkey_desc* populateBucketingCols(HiveMetaData *md, Int32 sdID,
         // this is the last bucket col
       }
       NAText nameStr = tblStr->substr(pos, foundB-pos);
-      pos = foundB;
+      pos = foundB + 1;
       
       hive_bkey_desc* newBkey  = new (CmpCommon::contextHeap())
         struct hive_bkey_desc(nameStr.c_str(),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpHbaseInterface.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpHbaseInterface.h b/core/sql/exp/ExpHbaseInterface.h
index 53f2143..aeccee4 100644
--- a/core/sql/exp/ExpHbaseInterface.h
+++ b/core/sql/exp/ExpHbaseInterface.h
@@ -42,7 +42,6 @@
 
 #include <iostream>
 
-#include <boost/lexical_cast.hpp>
 #include <protocol/TBinaryProtocol.h>
 #include <transport/TSocket.h>
 #include <transport/TTransportUtils.h>



[37/50] [abbrv] incubator-trafodion git commit: merge Prashanth's change

Posted by db...@apache.org.
merge Prashanth's change


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

Branch: refs/heads/master
Commit: 1af3985b5fb574867ae423067b836d18e9374611
Parents: 681cad6
Author: mashengchen <ma...@gmail.com>
Authored: Wed Mar 23 06:27:58 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Wed Mar 23 06:27:58 2016 +0000

----------------------------------------------------------------------
 .../transactional/TransactionManager.java       |  44 +-
 .../TransactionRegionLocation.java              |  12 +
 .../transactional/SplitBalanceHelper.java       |  24 +-
 .../transactional/TrxRegionEndpoint.java.tmpl   |  38 +-
 .../generated/TrxRegionProtos.java              | 547 ++++++++++++-------
 .../transactional/TrxTransactionState.java.tmpl |  17 +
 .../hbase-trx/src/main/protobuf/TrxRegion.proto |   2 +
 core/sql/cli/SessionDefaults.cpp                |   2 +
 core/sql/regress/core/DIFF116.KNOWN.SB          |  21 -
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |  39 +-
 10 files changed, 504 insertions(+), 242 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
index b10214e..7eb03e7 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
@@ -624,7 +624,9 @@ public class TransactionManager {
      */
     public Integer doPrepareX(final byte[] regionName, final long transactionId, final int participantNum, final TransactionRegionLocation location)
           throws IOException, CommitUnsuccessfulException {
-       if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- ENTRY txid: " + transactionId );
+       if (LOG.isTraceEnabled()) LOG.trace("doPrepareX -- ENTRY txid: " + transactionId
+                                                                        + " RegionName " + Bytes.toString(regionName)
+                                                                        + " TableName " + table.toString() );
        int commitStatus = 0;
        boolean refresh = false;
        boolean retry = false;
@@ -647,6 +649,7 @@ public class TransactionManager {
                    builder.setRegionName(ByteString.copyFromUtf8(Bytes.toString(regionName)));
                    builder.setParticipantNum(participantNum);
 
+                   builder.setDropTableRecorded(location.isTableRecodedDropped());
                    instance.commitRequest(controller, builder.build(), rpcCallback);
                    return rpcCallback.get();
                 }
@@ -894,7 +897,9 @@ public class TransactionManager {
 
        } while (retryCount < RETRY_ATTEMPTS && retry == true);
        }
-       if (LOG.isTraceEnabled()) LOG.trace("commitStatus for transId(" + transactionId + "): " + commitStatus);
+       if (LOG.isTraceEnabled()) LOG.trace("commitStatus for transId(" + transactionId + "): " + commitStatus
+                                                                       + " TableName " + table.toString()
+                                                                       + " Region Name " + Bytes.toString(regionName));
        boolean canCommit = true;
        boolean readOnly = false;
 
@@ -944,7 +949,7 @@ public class TransactionManager {
      * Return  : Ignored
      * Purpose : Call abort for a given regionserver
      */
-    public Integer doAbortX(final byte[] regionName, final long transactionId, final int participantNum) throws IOException{
+    public Integer doAbortX(final byte[] regionName, final long transactionId, final int participantNum, final boolean dropTableRecorded) throws IOException{
         if(LOG.isDebugEnabled()) LOG.debug("doAbortX -- ENTRY txID: " + transactionId + " participantNum "
                         + participantNum + " region " + regionName.toString());
         boolean retry = false;
@@ -968,6 +973,7 @@ public class TransactionManager {
                 builder.setTransactionId(transactionId);
                 builder.setParticipantNum(participantNum);
                 builder.setRegionName(ByteString.copyFromUtf8(Bytes.toString(regionName)));
+                builder.setDropTableRecorded(dropTableRecorded);
                 instance.abortTransaction(controller, builder.build(), rpcCallback);
                 return rpcCallback.get();
               }
@@ -1983,7 +1989,7 @@ public class TransactionManager {
                   public Integer call() throws CommitUnsuccessfulException, IOException {
 
                       return doAbortX(location.getRegionInfo().getRegionName(),
-                              transactionState.getTransactionId(), participantNum);
+                              transactionState.getTransactionId(), participantNum, location.isTableRecodedDropped());
                   }
               });
               completedList.add(location);
@@ -2345,7 +2351,7 @@ public class TransactionManager {
             		+ participantNum + ", region: " + location.getRegionInfo().getRegionNameAsString());
             threadPool.submit(new TransactionManagerCallable(transactionState, location, connection) {
               public Integer call() throws IOException {
-                return doAbortX(regionName, transactionState.getTransactionId(), participantNum);
+                return doAbortX(regionName, transactionState.getTransactionId(), participantNum, location.isTableRecodedDropped());
               }
             });
           } catch (Exception e) {
@@ -2980,6 +2986,14 @@ public class TransactionManager {
 
             // Set transaction state object as participating in ddl transaction.
             transactionState.setDDLTx(true);
+           
+            // Also set a flag in all current participating regions belonging to this table
+            // to indicate this table is recorded for drop.
+            for(TransactionRegionLocation trl : transactionState.getParticipatingRegions())
+            {
+                if(trl.getRegionInfo().getTable().toString().compareTo(tblName) == 0)
+                    trl.setTableRecordedDropped();
+            }
         }
         catch (Exception e) {
             LOG.error("dropTable Exception TxId: " + transactionState.getTransactionId() + "TableName:" + tblName + "Exception: " + e);
@@ -2990,17 +3004,17 @@ public class TransactionManager {
     //Called only by Abort or Commit processing.
     public void deleteTable(final TransactionState transactionState, final String tblName)
             throws Exception{
-        if (LOG.isTraceEnabled()) LOG.trace("deleteTable ENTRY, TxId: " + transactionState.getTransactionId() + "tableName" + tblName);
+        if (LOG.isTraceEnabled()) LOG.trace("deleteTable ENTRY, TxId: " + transactionState.getTransactionId() + " tableName " + tblName);
         try{
             disableTable(transactionState, tblName);
         }
         catch (TableNotEnabledException e) {
             //If table is not enabled, no need to throw exception. Continue.
             //if (LOG.isTraceEnabled()) LOG.trace("deleteTable , TableNotEnabledException. This is a expected exception.  Step: disableTable, TxId: " +
-            //    transactionState.getTransactionId() + "TableName" + tblName + "Exception: " + e);
+            //    transactionState.getTransactionId() + " TableName " + tblName + "Exception: " + e);
         }
         catch (Exception e) {
-            LOG.error("deleteTable Exception TxId: " + transactionState.getTransactionId() + "TableName" + tblName + "Exception: " + e);
+            LOG.error("deleteTable Exception TxId: " + transactionState.getTransactionId() + " TableName " + tblName + "Exception: " + e);
             throw e;
         }
 
@@ -3008,7 +3022,7 @@ public class TransactionManager {
             hbadmin.deleteTable(tblName);
         }
         catch (Exception e) {
-            LOG.error("deleteTable Exception TxId: " + transactionState.getTransactionId() + "TableName" + tblName  + "Exception: " + e);
+            LOG.error("deleteTable Exception TxId: " + transactionState.getTransactionId() + " TableName " + tblName  + "Exception: " + e);
             throw e;
         }
     }
@@ -3016,12 +3030,13 @@ public class TransactionManager {
     //Called only by Abort processing.
     public void enableTable(final TransactionState transactionState, String tblName)
             throws Exception{
-        if (LOG.isTraceEnabled()) LOG.trace("enableTable ENTRY, TxID: " + transactionState.getTransactionId() + "tableName" + tblName);
+        if (LOG.isTraceEnabled()) LOG.trace("enableTable ENTRY, TxID: " + transactionState.getTransactionId() + " tableName " + tblName);
         try {
             hbadmin.enableTable(tblName);
         }
         catch (Exception e) {
-            LOG.error("enableTable Exception TxId: " + transactionState.getTransactionId() + "TableName" + tblName + "Exception: " + e);
+            //LOG.error("enableTable Exception TxId: " + transactionState.getTransactionId() + " TableName " + tblName + "Exception: " + e);
+            //Let the caller log this and handle exception. Some scenarios this exception is expected.
             throw e;
         }
     }
@@ -3044,7 +3059,7 @@ public class TransactionManager {
             hbadmin.close();
         }
         catch (Exception e) {
-            LOG.error("truncateTable Exception TxId: " + transactionState.getTransactionId() + "TableName" + tblName+  "Exception: " + e);
+            LOG.error("truncateTable Exception TxId: " + transactionState.getTransactionId() + " TableName " + tblName+  "Exception: " + e);
             throw e;
         }
     }
@@ -3052,15 +3067,16 @@ public class TransactionManager {
     //Called only by DoPrepare.
     public void disableTable(final TransactionState transactionState, String tblName)
             throws Exception{
-        if (LOG.isTraceEnabled()) LOG.trace("disableTable ENTRY, TxID: " + transactionState.getTransactionId() + "tableName" + tblName);
+        if (LOG.isTraceEnabled()) LOG.trace("disableTable ENTRY, TxID: " + transactionState.getTransactionId() + " tableName " + tblName);
         try {
             hbadmin.disableTable(tblName);
         }
         catch (Exception e) {
-            //LOG.error("disableTable Exception TxId: " + transactionState.getTransactionId() + "TableName" + tblName + "Exception: " + e);
+            //LOG.error("disableTable Exception TxId: " + transactionState.getTransactionId() + " TableName " + tblName + "Exception: " + e);
             //Let the caller handle this exception since table being disabled could be redundant many times.
             throw e;
         }
+        if (LOG.isTraceEnabled()) LOG.trace("disableTable EXIT, TxID: " + transactionState.getTransactionId() + " tableName " + tblName);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionRegionLocation.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionRegionLocation.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionRegionLocation.java
index e2ff67b..d3118db 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionRegionLocation.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionRegionLocation.java
@@ -37,6 +37,7 @@ public class TransactionRegionLocation extends HRegionLocation {
 
   static final Log LOG = LogFactory.getLog(TransactionRegionLocation.class);
 
+  public boolean tableRecordedDropped;
   /*
    public TransactionRegionLocation(HRegionInfo regionInfo, final String hostname, final int port) {
      //ServerName
@@ -47,6 +48,17 @@ public class TransactionRegionLocation extends HRegionLocation {
 
   public TransactionRegionLocation(HRegionInfo regionInfo, ServerName servName) {
     super(regionInfo, servName);
+    tableRecordedDropped = false;
+  }
+
+  public void setTableRecordedDropped()
+  {
+    tableRecordedDropped = true;
+    if (LOG.isTraceEnabled()) LOG.trace("Table recorded dropped for region:" + super.getRegionInfo());
+  }
+  public boolean isTableRecodedDropped()
+  {
+    return tableRecordedDropped;
   }
 
    @Override

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
index d91565e..0d76b55 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/SplitBalanceHelper.java
@@ -215,7 +215,29 @@ public class SplitBalanceHelper {
     }
 
     protected boolean pendingListClear(Set<TrxTransactionState> commitPendingTransactions) throws IOException {
-        return commitPendingTransactions.isEmpty();
+        if (commitPendingTransactions.isEmpty()) {
+            if (LOG.isDebugEnabled())
+                LOG.debug("pendingListClear is true because commitPendingTransactions is empty " + hri.getRegionNameAsString());
+            return true;
+        } else {
+            // Check to see if all of the TrxTransaction state objects
+            // have dropTable Recorded, in which case the pending list is
+            // considered clear of pending list.
+            for (TrxTransactionState transactionState : commitPendingTransactions) {
+                // if even one transaction state does not have drop table recorded
+                // then pendingList is not yet clear.
+                if (!transactionState.dropTableRecorded()) {
+                    if (LOG.isDebugEnabled())
+                        LOG.debug("pendingListClear is false commitPendingTransactions is not empty "
+                                + hri.getRegionNameAsString());
+                    return false;
+                }
+            }
+            // Reaching here means pendingListClear.
+            if (LOG.isDebugEnabled())
+                LOG.debug("pendingListClear is true because dropTableRecorded is true " + hri.getRegionNameAsString());
+            return true;
+        }
     }
 
     protected boolean scannersListClear(ConcurrentHashMap<Long, TransactionalRegionScannerHolder> scanners) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
index 9c14965..b0e87d3 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
@@ -427,8 +427,9 @@ CoprocessorService, Coprocessor {
     AbortTransactionResponse response = AbortTransactionResponse.getDefaultInstance();
 
     long transactionId = request.getTransactionId();
-
-    if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: abortTransaction - txId " + transactionId + ", regionName " + regionInfo.getRegionNameAsString());
+    boolean dropTableRecorded = request.getDropTableRecorded();
+    if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: abortTransaction - txId " + transactionId +
+             ", dropTableRecoded " + dropTableRecorded + ", regionName " + regionInfo.getRegionNameAsString());
 
     IOException ioe = null;
     UnknownTransactionException ute = null;
@@ -440,7 +441,7 @@ CoprocessorService, Coprocessor {
 
     // First test if this region matches our region name
     if (!name.equals(regionInfo.getRegionNameAsString())) {
-       wre = new WrongRegionException("Request Region Name, " +
+        wre = new WrongRegionException("Request Region Name, " +
         name + ",  does not match this region, " +
         regionInfo.getRegionNameAsString());
         if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor:abortTransaction threw WrongRegionException" +
@@ -452,7 +453,7 @@ CoprocessorService, Coprocessor {
     {
       // Process in local memory
       try {
-        abortTransaction(transactionId);
+        abortTransaction(transactionId, dropTableRecorded);
       } catch (UnknownTransactionException u) {
         if (LOG.isDebugEnabled()) LOG.debug("TrxRegionEndpoint coprocessor:abort - txId " 
 					    + transactionId 
@@ -848,9 +849,11 @@ CoprocessorService, Coprocessor {
     WrongRegionException wre = null;
     long transactionId = request.getTransactionId();
     int participantNum = request.getParticipantNum();
+    boolean dropTableRecorded = request.getDropTableRecorded();
 
     if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitRequest - txId "
-         + transactionId + ", participantNum " + participantNum + ", regionName " + regionInfo.getRegionNameAsString());
+         + transactionId + ", participantNum " + participantNum + ", dropTableRecorded " + dropTableRecorded + 
+         ", regionName " + regionInfo.getRegionNameAsString());
 
     /*  commenting out for the time being
     java.lang.String name = ((com.google.protobuf.ByteString) request.getRegionName()).toStringUtf8();
@@ -868,7 +871,7 @@ CoprocessorService, Coprocessor {
     {
       // Process local memory
       try {
-        status = commitRequest(transactionId, participantNum);
+        status = commitRequest(transactionId, participantNum, dropTableRecorded);
       } catch (UnknownTransactionException u) {
         if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: commitRequest - txId " + transactionId + ", Caught UnknownTransactionException after internal commitRequest call - " + u.toString());
         ute = u;
@@ -5086,11 +5089,17 @@ CoprocessorService, Coprocessor {
    * @throws IOException
    */
   public int commitRequest(final long transactionId, final int participantNum) throws IOException, UnknownTransactionException {
-     return commitRequest(transactionId, participantNum, true);
+     return commitRequest(transactionId, participantNum, true, false);
   }
 
-  public int commitRequest(final long transactionId, final int participantNum, boolean flushHLOG) throws IOException,
-                                                                               UnknownTransactionException {
+  public int commitRequest(final long transactionId, final int participantNum, final boolean dropTableRecorded)
+                                                    throws IOException, UnknownTransactionException {
+      return commitRequest(transactionId, participantNum, true, dropTableRecorded);
+  }
+  
+  public int commitRequest(final long transactionId, final int participantNum, boolean flushHLOG,
+                                                               boolean dropTableRecorded) throws IOException,
+                                                                                UnknownTransactionException {
     long txid = 0;
     String lv_regionName = new String(m_Region.getRegionInfo().getRegionNameAsString());
     if (LOG.isDebugEnabled()) LOG.debug("TrxRegionEndpoint coprocessor: commitRequest -- ENTRY txId: "
@@ -5170,6 +5179,7 @@ CoprocessorService, Coprocessor {
             putBySequenceOperations.getAndIncrement();
          }
          // Order is important
+         state.setDropTableRecorded(dropTableRecorded);
          state.setStatus(Status.COMMIT_PENDING);
          state.setCPEpoch(controlPointEpoch.get());
          commitPendingTransactions.add(state);
@@ -5368,6 +5378,10 @@ CoprocessorService, Coprocessor {
     return state.hasConflict();
   }
 
+  public void abortTransaction(final long transactionId) throws IOException, UnknownTransactionException {
+      abortTransaction(transactionId, false);
+  }
+
   /**
    * Abort the transaction.
    * 
@@ -5375,8 +5389,7 @@ CoprocessorService, Coprocessor {
    * @throws IOException
    * @throws UnknownTransactionException
    */
-
-  public void abortTransaction(final long transactionId) throws IOException, UnknownTransactionException {
+  public void abortTransaction(final long transactionId, final boolean dropTableRecorded) throws IOException, UnknownTransactionException {
     long txid = 0;
 
     if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: abort transactionId: " + transactionId + " " + m_Region.getRegionInfo().getRegionNameAsString());
@@ -5404,6 +5417,9 @@ CoprocessorService, Coprocessor {
     state.setStatus(Status.ABORTED);
     }
 
+    if(dropTableRecorded)
+        state.resetDropTableRecorded();
+
     if (state.hasWrite()) {
     // TODO log
     //  this.transactionLog.writeAbortToLog(m_Region.getRegionInfo(),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
index 564c517..b430768 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
@@ -61,6 +61,16 @@ public final class TrxRegionProtos {
      * <code>required int32 participantNum = 3;</code>
      */
     int getParticipantNum();
+
+    // required bool dropTableRecorded = 4;
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    boolean hasDropTableRecorded();
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    boolean getDropTableRecorded();
   }
   /**
    * Protobuf type {@code AbortTransactionRequest}
@@ -128,6 +138,11 @@ public final class TrxRegionProtos {
               participantNum_ = input.readInt32();
               break;
             }
+            case 32: {
+              bitField0_ |= 0x00000008;
+              dropTableRecorded_ = input.readBool();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -216,10 +231,27 @@ public final class TrxRegionProtos {
       return participantNum_;
     }
 
+    // required bool dropTableRecorded = 4;
+    public static final int DROPTABLERECORDED_FIELD_NUMBER = 4;
+    private boolean dropTableRecorded_;
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    public boolean hasDropTableRecorded() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    public boolean getDropTableRecorded() {
+      return dropTableRecorded_;
+    }
+
     private void initFields() {
       regionName_ = com.google.protobuf.ByteString.EMPTY;
       transactionId_ = 0L;
       participantNum_ = 0;
+      dropTableRecorded_ = false;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -238,6 +270,10 @@ public final class TrxRegionProtos {
         memoizedIsInitialized = 0;
         return false;
       }
+      if (!hasDropTableRecorded()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
       memoizedIsInitialized = 1;
       return true;
     }
@@ -254,6 +290,9 @@ public final class TrxRegionProtos {
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         output.writeInt32(3, participantNum_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeBool(4, dropTableRecorded_);
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -275,6 +314,10 @@ public final class TrxRegionProtos {
         size += com.google.protobuf.CodedOutputStream
           .computeInt32Size(3, participantNum_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBoolSize(4, dropTableRecorded_);
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -397,6 +440,8 @@ public final class TrxRegionProtos {
         bitField0_ = (bitField0_ & ~0x00000002);
         participantNum_ = 0;
         bitField0_ = (bitField0_ & ~0x00000004);
+        dropTableRecorded_ = false;
+        bitField0_ = (bitField0_ & ~0x00000008);
         return this;
       }
 
@@ -437,6 +482,10 @@ public final class TrxRegionProtos {
           to_bitField0_ |= 0x00000004;
         }
         result.participantNum_ = participantNum_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000008;
+        }
+        result.dropTableRecorded_ = dropTableRecorded_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -462,6 +511,9 @@ public final class TrxRegionProtos {
         if (other.hasParticipantNum()) {
           setParticipantNum(other.getParticipantNum());
         }
+        if (other.hasDropTableRecorded()) {
+          setDropTableRecorded(other.getDropTableRecorded());
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -479,6 +531,10 @@ public final class TrxRegionProtos {
           
           return false;
         }
+        if (!hasDropTableRecorded()) {
+          
+          return false;
+        }
         return true;
       }
 
@@ -603,6 +659,39 @@ public final class TrxRegionProtos {
         return this;
       }
 
+      // required bool dropTableRecorded = 4;
+      private boolean dropTableRecorded_ ;
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public boolean hasDropTableRecorded() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public boolean getDropTableRecorded() {
+        return dropTableRecorded_;
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public Builder setDropTableRecorded(boolean value) {
+        bitField0_ |= 0x00000008;
+        dropTableRecorded_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public Builder clearDropTableRecorded() {
+        bitField0_ = (bitField0_ & ~0x00000008);
+        dropTableRecorded_ = false;
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:AbortTransactionRequest)
     }
 
@@ -5993,6 +6082,16 @@ public final class TrxRegionProtos {
      * <code>required int32 participantNum = 3;</code>
      */
     int getParticipantNum();
+
+    // required bool dropTableRecorded = 4;
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    boolean hasDropTableRecorded();
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    boolean getDropTableRecorded();
   }
   /**
    * Protobuf type {@code CommitRequestRequest}
@@ -6060,6 +6159,11 @@ public final class TrxRegionProtos {
               participantNum_ = input.readInt32();
               break;
             }
+            case 32: {
+              bitField0_ |= 0x00000008;
+              dropTableRecorded_ = input.readBool();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -6148,10 +6252,27 @@ public final class TrxRegionProtos {
       return participantNum_;
     }
 
+    // required bool dropTableRecorded = 4;
+    public static final int DROPTABLERECORDED_FIELD_NUMBER = 4;
+    private boolean dropTableRecorded_;
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    public boolean hasDropTableRecorded() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    /**
+     * <code>required bool dropTableRecorded = 4;</code>
+     */
+    public boolean getDropTableRecorded() {
+      return dropTableRecorded_;
+    }
+
     private void initFields() {
       regionName_ = com.google.protobuf.ByteString.EMPTY;
       transactionId_ = 0L;
       participantNum_ = 0;
+      dropTableRecorded_ = false;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -6170,6 +6291,10 @@ public final class TrxRegionProtos {
         memoizedIsInitialized = 0;
         return false;
       }
+      if (!hasDropTableRecorded()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
       memoizedIsInitialized = 1;
       return true;
     }
@@ -6186,6 +6311,9 @@ public final class TrxRegionProtos {
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         output.writeInt32(3, participantNum_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeBool(4, dropTableRecorded_);
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -6207,6 +6335,10 @@ public final class TrxRegionProtos {
         size += com.google.protobuf.CodedOutputStream
           .computeInt32Size(3, participantNum_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBoolSize(4, dropTableRecorded_);
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -6329,6 +6461,8 @@ public final class TrxRegionProtos {
         bitField0_ = (bitField0_ & ~0x00000002);
         participantNum_ = 0;
         bitField0_ = (bitField0_ & ~0x00000004);
+        dropTableRecorded_ = false;
+        bitField0_ = (bitField0_ & ~0x00000008);
         return this;
       }
 
@@ -6369,6 +6503,10 @@ public final class TrxRegionProtos {
           to_bitField0_ |= 0x00000004;
         }
         result.participantNum_ = participantNum_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000008;
+        }
+        result.dropTableRecorded_ = dropTableRecorded_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -6394,6 +6532,9 @@ public final class TrxRegionProtos {
         if (other.hasParticipantNum()) {
           setParticipantNum(other.getParticipantNum());
         }
+        if (other.hasDropTableRecorded()) {
+          setDropTableRecorded(other.getDropTableRecorded());
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -6411,6 +6552,10 @@ public final class TrxRegionProtos {
           
           return false;
         }
+        if (!hasDropTableRecorded()) {
+          
+          return false;
+        }
         return true;
       }
 
@@ -6535,6 +6680,39 @@ public final class TrxRegionProtos {
         return this;
       }
 
+      // required bool dropTableRecorded = 4;
+      private boolean dropTableRecorded_ ;
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public boolean hasDropTableRecorded() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public boolean getDropTableRecorded() {
+        return dropTableRecorded_;
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public Builder setDropTableRecorded(boolean value) {
+        bitField0_ |= 0x00000008;
+        dropTableRecorded_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>required bool dropTableRecorded = 4;</code>
+       */
+      public Builder clearDropTableRecorded() {
+        bitField0_ = (bitField0_ & ~0x00000008);
+        dropTableRecorded_ = false;
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:CommitRequestRequest)
     }
 
@@ -39583,190 +39761,191 @@ public final class TrxRegionProtos {
   static {
     java.lang.String[] descriptorData = {
       "\n\017TrxRegion.proto\032\013HBase.proto\032\023ClusterS" +
-      "tatus.proto\032\014Client.proto\"\\\n\027AbortTransa" +
+      "tatus.proto\032\014Client.proto\"w\n\027AbortTransa" +
       "ctionRequest\022\022\n\nregionName\030\001 \002(\014\022\025\n\rtran" +
-      "sactionId\030\002 \002(\003\022\026\n\016participantNum\030\003 \002(\005\"" +
-      "C\n\030AbortTransactionResponse\022\021\n\texception" +
-      "\030\001 \001(\t\022\024\n\014hasException\030\002 \001(\010\"d\n\037AbortTra" +
-      "nsactionMultipleRequest\022\022\n\nregionName\030\001 " +
-      "\003(\014\022\025\n\rtransactionId\030\002 \002(\003\022\026\n\016participan" +
-      "tNum\030\003 \002(\005\"K\n AbortTransactionMultipleRe" +
-      "sponse\022\021\n\texception\030\001 \003(\t\022\024\n\014hasExceptio",
-      "n\030\002 \001(\010\"D\n\027BeginTransactionRequest\022\025\n\rtr" +
-      "ansactionId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\"C\n" +
-      "\030BeginTransactionResponse\022\021\n\texception\030\001" +
-      " \001(\t\022\024\n\014hasException\030\002 \001(\010\"}\n\rCommitRequ" +
-      "est\022\022\n\nregionName\030\001 \002(\014\022\025\n\rtransactionId" +
-      "\030\002 \002(\003\022\026\n\016participantNum\030\003 \002(\005\022)\n!ignore" +
-      "UnknownTransactionException\030\004 \001(\010\"9\n\016Com" +
-      "mitResponse\022\021\n\texception\030\001 \001(\t\022\024\n\014hasExc" +
-      "eption\030\002 \001(\010\"\205\001\n\025CommitMultipleRequest\022\022" +
-      "\n\nregionName\030\001 \003(\014\022\025\n\rtransactionId\030\002 \002(",
-      "\003\022\026\n\016participantNum\030\003 \002(\005\022)\n!ignoreUnkno" +
-      "wnTransactionException\030\004 \001(\010\"A\n\026CommitMu" +
-      "ltipleResponse\022\021\n\texception\030\001 \003(\t\022\024\n\014has" +
-      "Exception\030\002 \001(\010\"Y\n\024CommitRequestRequest\022" +
-      "\022\n\nregionName\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002" +
-      "(\003\022\026\n\016participantNum\030\003 \002(\005\"P\n\025CommitRequ" +
-      "estResponse\022\016\n\006result\030\001 \002(\005\022\021\n\texception" +
-      "\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"a\n\034CommitRe" +
-      "questMultipleRequest\022\022\n\nregionName\030\001 \003(\014" +
-      "\022\025\n\rtransactionId\030\002 \002(\003\022\026\n\016participantNu",
-      "m\030\003 \002(\005\"X\n\035CommitRequestMultipleResponse" +
-      "\022\016\n\006result\030\001 \003(\005\022\021\n\texception\030\002 \003(\t\022\024\n\014h" +
-      "asException\030\003 \001(\010\"\\\n\027CommitIfPossibleReq" +
+      "sactionId\030\002 \002(\003\022\026\n\016participantNum\030\003 \002(\005\022" +
+      "\031\n\021dropTableRecorded\030\004 \002(\010\"C\n\030AbortTrans" +
+      "actionResponse\022\021\n\texception\030\001 \001(\t\022\024\n\014has" +
+      "Exception\030\002 \001(\010\"d\n\037AbortTransactionMulti" +
+      "pleRequest\022\022\n\nregionName\030\001 \003(\014\022\025\n\rtransa" +
+      "ctionId\030\002 \002(\003\022\026\n\016participantNum\030\003 \002(\005\"K\n" +
+      " AbortTransactionMultipleResponse\022\021\n\texc",
+      "eption\030\001 \003(\t\022\024\n\014hasException\030\002 \001(\010\"D\n\027Be" +
+      "ginTransactionRequest\022\025\n\rtransactionId\030\001" +
+      " \002(\003\022\022\n\nregionName\030\002 \002(\014\"C\n\030BeginTransac" +
+      "tionResponse\022\021\n\texception\030\001 \001(\t\022\024\n\014hasEx" +
+      "ception\030\002 \001(\010\"}\n\rCommitRequest\022\022\n\nregion" +
+      "Name\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002(\003\022\026\n\016par" +
+      "ticipantNum\030\003 \002(\005\022)\n!ignoreUnknownTransa" +
+      "ctionException\030\004 \001(\010\"9\n\016CommitResponse\022\021" +
+      "\n\texception\030\001 \001(\t\022\024\n\014hasException\030\002 \001(\010\"" +
+      "\205\001\n\025CommitMultipleRequest\022\022\n\nregionName\030",
+      "\001 \003(\014\022\025\n\rtransactionId\030\002 \002(\003\022\026\n\016particip" +
+      "antNum\030\003 \002(\005\022)\n!ignoreUnknownTransaction" +
+      "Exception\030\004 \001(\010\"A\n\026CommitMultipleRespons" +
+      "e\022\021\n\texception\030\001 \003(\t\022\024\n\014hasException\030\002 \001" +
+      "(\010\"t\n\024CommitRequestRequest\022\022\n\nregionName" +
+      "\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002(\003\022\026\n\016partici" +
+      "pantNum\030\003 \002(\005\022\031\n\021dropTableRecorded\030\004 \002(\010" +
+      "\"P\n\025CommitRequestResponse\022\016\n\006result\030\001 \002(" +
+      "\005\022\021\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001" +
+      "(\010\"a\n\034CommitRequestMultipleRequest\022\022\n\nre",
+      "gionName\030\001 \003(\014\022\025\n\rtransactionId\030\002 \002(\003\022\026\n" +
+      "\016participantNum\030\003 \002(\005\"X\n\035CommitRequestMu" +
+      "ltipleResponse\022\016\n\006result\030\001 \003(\005\022\021\n\texcept" +
+      "ion\030\002 \003(\t\022\024\n\014hasException\030\003 \001(\010\"\\\n\027Commi" +
+      "tIfPossibleRequest\022\022\n\nregionName\030\001 \002(\014\022\025" +
+      "\n\rtransactionId\030\002 \002(\003\022\026\n\016participantNum\030" +
+      "\003 \002(\005\"C\n\030CommitIfPossibleResponse\022\021\n\texc" +
+      "eption\030\001 \001(\t\022\024\n\014hasException\030\002 \001(\010\"\241\001\n\025C" +
+      "heckAndDeleteRequest\022\025\n\rtransactionId\030\001 " +
+      "\002(\003\022\022\n\nregionName\030\002 \002(\014\022\013\n\003row\030\003 \002(\014\022\016\n\006",
+      "family\030\004 \002(\014\022\021\n\tqualifier\030\005 \002(\014\022\r\n\005value" +
+      "\030\006 \002(\014\022\036\n\006delete\030\007 \002(\0132\016.MutationProto\"Q" +
+      "\n\026CheckAndDeleteResponse\022\016\n\006result\030\001 \002(\010" +
+      "\022\021\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001(" +
+      "\010\"\233\001\n\022CheckAndPutRequest\022\025\n\rtransactionI" +
+      "d\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\013\n\003row\030\003 \002(\014" +
+      "\022\016\n\006family\030\004 \002(\014\022\021\n\tqualifier\030\005 \002(\014\022\r\n\005v" +
+      "alue\030\006 \002(\014\022\033\n\003put\030\007 \002(\0132\016.MutationProto\"" +
+      "N\n\023CheckAndPutResponse\022\016\n\006result\030\001 \002(\010\022\021" +
+      "\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"",
+      "S\n\023CloseScannerRequest\022\025\n\rtransactionId\030" +
+      "\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\021\n\tscannerId\030\003" +
+      " \002(\003\"?\n\024CloseScannerResponse\022\021\n\texceptio" +
+      "n\030\001 \001(\t\022\024\n\014hasException\030\002 \001(\010\"o\n\"DeleteM" +
+      "ultipleTransactionalRequest\022\025\n\rtransacti" +
+      "onId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\036\n\006delete" +
+      "\030\003 \003(\0132\016.MutationProto\"g\n#DeleteMultiple" +
+      "TransactionalResponse\022\027\n\006result\030\001 \001(\0132\007." +
+      "Result\022\021\n\texception\030\002 \001(\t\022\024\n\014hasExceptio" +
+      "n\030\003 \001(\010\"g\n\032DeleteTransactionalRequest\022\025\n",
+      "\rtransactionId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014" +
+      "\022\036\n\006delete\030\003 \002(\0132\016.MutationProto\"_\n\033Dele" +
+      "teTransactionalResponse\022\027\n\006result\030\001 \001(\0132" +
+      "\007.Result\022\021\n\texception\030\002 \001(\t\022\024\n\014hasExcept" +
+      "ion\030\003 \001(\010\"W\n\027GetTransactionalRequest\022\025\n\r" +
+      "transactionId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022" +
+      "\021\n\003get\030\003 \002(\0132\004.Get\"\\\n\030GetTransactionalRe" +
+      "sponse\022\027\n\006result\030\001 \001(\0132\007.Result\022\021\n\texcep" +
+      "tion\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"T\n\022Open" +
+      "ScannerRequest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n",
+      "\nregionName\030\002 \002(\014\022\023\n\004scan\030\003 \002(\0132\005.Scan\"Q" +
+      "\n\023OpenScannerResponse\022\021\n\tscannerId\030\001 \002(\003" +
+      "\022\021\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001(" +
+      "\010\"\223\001\n\022PerformScanRequest\022\025\n\rtransactionI" +
+      "d\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\021\n\tscannerId" +
+      "\030\003 \002(\003\022\024\n\014numberOfRows\030\004 \002(\005\022\024\n\014closeSca" +
+      "nner\030\005 \002(\010\022\023\n\013nextCallSeq\030\006 \002(\003\"\214\001\n\023Perf" +
+      "ormScanResponse\022\027\n\006result\030\001 \003(\0132\007.Result" +
+      "\022\r\n\005count\030\002 \002(\003\022\023\n\013nextCallSeq\030\003 \002(\003\022\017\n\007" +
+      "hasMore\030\004 \002(\010\022\021\n\texception\030\005 \001(\t\022\024\n\014hasE",
+      "xception\030\006 \001(\010\"a\n\027PutTransactionalReques" +
+      "t\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregionName\030\002" +
+      " \002(\014\022\033\n\003put\030\003 \002(\0132\016.MutationProto\"\\\n\030Put" +
+      "TransactionalResponse\022\027\n\006result\030\001 \001(\0132\007." +
+      "Result\022\021\n\texception\030\002 \001(\t\022\024\n\014hasExceptio" +
+      "n\030\003 \001(\010\"i\n\037PutMultipleTransactionalReque" +
+      "st\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregionName\030" +
+      "\002 \002(\014\022\033\n\003put\030\003 \003(\0132\016.MutationProto\"d\n Pu" +
+      "tMultipleTransactionalResponse\022\027\n\006result" +
+      "\030\001 \001(\0132\007.Result\022\021\n\texception\030\002 \001(\t\022\024\n\014ha",
+      "sException\030\003 \001(\010\"Q\n\026RecoveryRequestReque" +
+      "st\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregionName\030" +
+      "\002 \002(\014\022\014\n\004tmId\030\003 \002(\005\"R\n\027RecoveryRequestRe" +
+      "sponse\022\016\n\006result\030\001 \003(\003\022\021\n\texception\030\002 \001(" +
+      "\t\022\024\n\014hasException\030\003 \001(\010\"~\n\021TlogDeleteReq" +
       "uest\022\022\n\nregionName\030\001 \002(\014\022\025\n\rtransactionI" +
-      "d\030\002 \002(\003\022\026\n\016participantNum\030\003 \002(\005\"C\n\030Commi" +
-      "tIfPossibleResponse\022\021\n\texception\030\001 \001(\t\022\024" +
-      "\n\014hasException\030\002 \001(\010\"\241\001\n\025CheckAndDeleteR" +
-      "equest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregionN" +
-      "ame\030\002 \002(\014\022\013\n\003row\030\003 \002(\014\022\016\n\006family\030\004 \002(\014\022\021" +
-      "\n\tqualifier\030\005 \002(\014\022\r\n\005value\030\006 \002(\014\022\036\n\006dele",
-      "te\030\007 \002(\0132\016.MutationProto\"Q\n\026CheckAndDele" +
-      "teResponse\022\016\n\006result\030\001 \002(\010\022\021\n\texception\030" +
-      "\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"\233\001\n\022CheckAnd" +
-      "PutRequest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nreg" +
-      "ionName\030\002 \002(\014\022\013\n\003row\030\003 \002(\014\022\016\n\006family\030\004 \002" +
-      "(\014\022\021\n\tqualifier\030\005 \002(\014\022\r\n\005value\030\006 \002(\014\022\033\n\003" +
-      "put\030\007 \002(\0132\016.MutationProto\"N\n\023CheckAndPut" +
-      "Response\022\016\n\006result\030\001 \002(\010\022\021\n\texception\030\002 " +
-      "\001(\t\022\024\n\014hasException\030\003 \001(\010\"S\n\023CloseScanne" +
-      "rRequest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregio",
-      "nName\030\002 \002(\014\022\021\n\tscannerId\030\003 \002(\003\"?\n\024CloseS" +
-      "cannerResponse\022\021\n\texception\030\001 \001(\t\022\024\n\014has" +
-      "Exception\030\002 \001(\010\"o\n\"DeleteMultipleTransac" +
-      "tionalRequest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\n" +
-      "regionName\030\002 \002(\014\022\036\n\006delete\030\003 \003(\0132\016.Mutat" +
-      "ionProto\"g\n#DeleteMultipleTransactionalR" +
-      "esponse\022\027\n\006result\030\001 \001(\0132\007.Result\022\021\n\texce" +
-      "ption\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"g\n\032Del" +
-      "eteTransactionalRequest\022\025\n\rtransactionId" +
-      "\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\036\n\006delete\030\003 \002",
-      "(\0132\016.MutationProto\"_\n\033DeleteTransactiona" +
-      "lResponse\022\027\n\006result\030\001 \001(\0132\007.Result\022\021\n\tex" +
-      "ception\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"W\n\027G" +
-      "etTransactionalRequest\022\025\n\rtransactionId\030" +
-      "\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\021\n\003get\030\003 \002(\0132\004" +
-      ".Get\"\\\n\030GetTransactionalResponse\022\027\n\006resu" +
-      "lt\030\001 \001(\0132\007.Result\022\021\n\texception\030\002 \001(\t\022\024\n\014" +
-      "hasException\030\003 \001(\010\"T\n\022OpenScannerRequest" +
-      "\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nregionName\030\002 " +
-      "\002(\014\022\023\n\004scan\030\003 \002(\0132\005.Scan\"Q\n\023OpenScannerR",
-      "esponse\022\021\n\tscannerId\030\001 \002(\003\022\021\n\texception\030" +
-      "\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"\223\001\n\022PerformS" +
-      "canRequest\022\025\n\rtransactionId\030\001 \002(\003\022\022\n\nreg" +
-      "ionName\030\002 \002(\014\022\021\n\tscannerId\030\003 \002(\003\022\024\n\014numb" +
-      "erOfRows\030\004 \002(\005\022\024\n\014closeScanner\030\005 \002(\010\022\023\n\013" +
-      "nextCallSeq\030\006 \002(\003\"\214\001\n\023PerformScanRespons" +
-      "e\022\027\n\006result\030\001 \003(\0132\007.Result\022\r\n\005count\030\002 \002(" +
-      "\003\022\023\n\013nextCallSeq\030\003 \002(\003\022\017\n\007hasMore\030\004 \002(\010\022" +
-      "\021\n\texception\030\005 \001(\t\022\024\n\014hasException\030\006 \001(\010" +
-      "\"a\n\027PutTransactionalRequest\022\025\n\rtransacti",
-      "onId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\033\n\003put\030\003 " +
-      "\002(\0132\016.MutationProto\"\\\n\030PutTransactionalR" +
-      "esponse\022\027\n\006result\030\001 \001(\0132\007.Result\022\021\n\texce" +
-      "ption\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"i\n\037Put" +
-      "MultipleTransactionalRequest\022\025\n\rtransact" +
-      "ionId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\033\n\003put\030\003" +
-      " \003(\0132\016.MutationProto\"d\n PutMultipleTrans" +
-      "actionalResponse\022\027\n\006result\030\001 \001(\0132\007.Resul" +
-      "t\022\021\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001" +
-      "(\010\"Q\n\026RecoveryRequestRequest\022\025\n\rtransact",
-      "ionId\030\001 \002(\003\022\022\n\nregionName\030\002 \002(\014\022\014\n\004tmId\030" +
-      "\003 \002(\005\"R\n\027RecoveryRequestResponse\022\016\n\006resu" +
-      "lt\030\001 \003(\003\022\021\n\texception\030\002 \001(\t\022\024\n\014hasExcept" +
-      "ion\030\003 \001(\010\"~\n\021TlogDeleteRequest\022\022\n\nregion" +
-      "Name\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002(\003\022\023\n\004sca" +
-      "n\030\003 \002(\0132\005.Scan\022\023\n\013auditSeqNum\030\004 \002(\003\022\024\n\014a" +
-      "geCommitted\030\005 \002(\010\"e\n\022TlogDeleteResponse\022" +
-      "\027\n\006result\030\001 \003(\0132\007.Result\022\r\n\005count\030\002 \002(\003\022" +
-      "\021\n\texception\030\003 \001(\t\022\024\n\014hasException\030\004 \001(\010" +
-      "\"\273\001\n\020TlogWriteRequest\022\022\n\nregionName\030\001 \002(",
-      "\014\022\025\n\rtransactionId\030\002 \002(\003\022\033\n\003put\030\003 \002(\0132\016." +
-      "MutationProto\022\013\n\003row\030\004 \002(\014\022\016\n\006family\030\005 \002" +
-      "(\014\022\021\n\tqualifier\030\006 \002(\014\022\r\n\005value\030\007 \002(\014\022\020\n\010" +
-      "commitId\030\010 \002(\003\022\016\n\006forced\030\t \001(\010\"L\n\021TlogWr" +
-      "iteResponse\022\016\n\006result\030\001 \003(\003\022\021\n\texception" +
-      "\030\002 \001(\t\022\024\n\014hasException\030\003 \001(\010\"\321\001\n(TlogTra" +
-      "nsactionStatesFromIntervalRequest\022\022\n\nreg" +
-      "ionName\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002(\003\022\021\n\t" +
-      "clusterId\030\003 \002(\003\022\023\n\013auditSeqNum\030\004 \002(\003\022\021\n\t" +
-      "scannerId\030\005 \002(\003\022\024\n\014numberOfRows\030\006 \002(\005\022\023\n",
-      "\013nextCallSeq\030\007 \002(\003\022\024\n\014closeScanner\030\010 \002(\010" +
-      "\"\242\001\n)TlogTransactionStatesFromIntervalRe" +
-      "sponse\022\027\n\006result\030\001 \003(\0132\007.Result\022\r\n\005count" +
-      "\030\002 \002(\003\022\023\n\013nextCallSeq\030\003 \002(\003\022\017\n\007hasMore\030\004" +
-      " \002(\010\022\021\n\texception\030\005 \001(\t\022\024\n\014hasException\030" +
-      "\006 \001(\010\"\243\001\n\035TransactionalAggregateRequest\022" +
-      "\022\n\nregionName\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002" +
-      "(\003\022\036\n\026interpreter_class_name\030\003 \002(\t\022\023\n\004sc" +
-      "an\030\004 \002(\0132\005.Scan\022\"\n\032interpreter_specific_" +
-      "bytes\030\005 \001(\014\"I\n\036TransactionalAggregateRes",
-      "ponse\022\022\n\nfirst_part\030\003 \003(\014\022\023\n\013second_part" +
-      "\030\004 \001(\014\"c\n\022TransactionPersist\022\016\n\006txById\030\001" +
-      " \003(\003\022\024\n\014seqNoListSeq\030\002 \003(\003\022\024\n\014seqNoListT" +
-      "xn\030\003 \003(\003\022\021\n\tnextSeqId\030\004 \002(\003\"\372\001\n\023Transact" +
-      "ionStateMsg\022\014\n\004txId\030\001 \002(\003\022\033\n\003put\030\002 \003(\0132\016" +
-      ".MutationProto\022\036\n\006delete\030\003 \003(\0132\016.Mutatio" +
-      "nProto\022\020\n\010putOrDel\030\004 \003(\010\022\023\n\013txnsToCheck\030" +
-      "\005 \003(\003\022\023\n\013startSeqNum\030\006 \002(\003\022\016\n\006seqNum\030\007 \002" +
-      "(\003\022\020\n\010logSeqId\030\010 \002(\003\022\022\n\nreinstated\030\t \002(\010" +
-      "\022\016\n\006status\030\n \002(\005\022\026\n\016commitProgress\030\013 \002(\005",
-      "2\262\020\n\020TrxRegionService\022G\n\020abortTransactio" +
-      "n\022\030.AbortTransactionRequest\032\031.AbortTrans" +
-      "actionResponse\022_\n\030abortTransactionMultip" +
-      "le\022 .AbortTransactionMultipleRequest\032!.A" +
-      "bortTransactionMultipleResponse\022G\n\020begin" +
-      "Transaction\022\030.BeginTransactionRequest\032\031." +
-      "BeginTransactionResponse\022A\n\016checkAndDele" +
-      "te\022\026.CheckAndDeleteRequest\032\027.CheckAndDel" +
-      "eteResponse\0228\n\013checkAndPut\022\023.CheckAndPut" +
-      "Request\032\024.CheckAndPutResponse\022;\n\014closeSc",
-      "anner\022\024.CloseScannerRequest\032\025.CloseScann" +
-      "erResponse\022)\n\006commit\022\016.CommitRequest\032\017.C" +
-      "ommitResponse\022G\n\020commitIfPossible\022\030.Comm" +
-      "itIfPossibleRequest\032\031.CommitIfPossibleRe" +
-      "sponse\022V\n\025commitRequestMultiple\022\035.Commit" +
-      "RequestMultipleRequest\032\036.CommitRequestMu" +
-      "ltipleResponse\022A\n\016commitMultiple\022\026.Commi" +
-      "tMultipleRequest\032\027.CommitMultipleRespons" +
-      "e\022>\n\rcommitRequest\022\025.CommitRequestReques" +
-      "t\032\026.CommitRequestResponse\022C\n\006delete\022\033.De",
-      "leteTransactionalRequest\032\034.DeleteTransac" +
-      "tionalResponse\022[\n\016deleteMultiple\022#.Delet" +
-      "eMultipleTransactionalRequest\032$.DeleteMu" +
-      "ltipleTransactionalResponse\022:\n\003get\022\030.Get" +
-      "TransactionalRequest\032\031.GetTransactionalR" +
-      "esponse\0228\n\013performScan\022\023.PerformScanRequ" +
-      "est\032\024.PerformScanResponse\0228\n\013openScanner" +
-      "\022\023.OpenScannerRequest\032\024.OpenScannerRespo" +
-      "nse\022:\n\003put\022\030.PutTransactionalRequest\032\031.P" +
-      "utTransactionalResponse\022R\n\013putMultiple\022 ",
-      ".PutMultipleTransactionalRequest\032!.PutMu" +
-      "ltipleTransactionalResponse\022D\n\017recoveryR" +
-      "equest\022\027.RecoveryRequestRequest\032\030.Recove" +
-      "ryRequestResponse\022<\n\021deleteTlogEntries\022\022" +
-      ".TlogDeleteRequest\032\023.TlogDeleteResponse\022" +
-      "0\n\007putTlog\022\021.TlogWriteRequest\032\022.TlogWrit" +
-      "eResponse\022w\n\036getTransactionStatesPriorTo" +
-      "Asn\022).TlogTransactionStatesFromIntervalR" +
-      "equest\032*.TlogTransactionStatesFromInterv" +
-      "alResponse\022I\n\006GetMax\022\036.TransactionalAggr",
-      "egateRequest\032\037.TransactionalAggregateRes" +
-      "ponse\022I\n\006GetMin\022\036.TransactionalAggregate" +
-      "Request\032\037.TransactionalAggregateResponse" +
-      "\022I\n\006GetSum\022\036.TransactionalAggregateReque" +
-      "st\032\037.TransactionalAggregateResponse\022L\n\tG" +
-      "etRowNum\022\036.TransactionalAggregateRequest" +
-      "\032\037.TransactionalAggregateResponse\022I\n\006Get" +
-      "Avg\022\036.TransactionalAggregateRequest\032\037.Tr" +
-      "ansactionalAggregateResponse\022I\n\006GetStd\022\036" +
-      ".TransactionalAggregateRequest\032\037.Transac",
-      "tionalAggregateResponse\022L\n\tGetMedian\022\036.T" +
-      "ransactionalAggregateRequest\032\037.Transacti" +
-      "onalAggregateResponseBS\n;org.apache.hado" +
-      "op.hbase.coprocessor.transactional.gener" +
-      "atedB\017TrxRegionProtosH\001\210\001\001"
+      "d\030\002 \002(\003\022\023\n\004scan\030\003 \002(\0132\005.Scan\022\023\n\013auditSeq" +
+      "Num\030\004 \002(\003\022\024\n\014ageCommitted\030\005 \002(\010\"e\n\022TlogD" +
+      "eleteResponse\022\027\n\006result\030\001 \003(\0132\007.Result\022\r" +
+      "\n\005count\030\002 \002(\003\022\021\n\texception\030\003 \001(\t\022\024\n\014hasE",
+      "xception\030\004 \001(\010\"\273\001\n\020TlogWriteRequest\022\022\n\nr" +
+      "egionName\030\001 \002(\014\022\025\n\rtransactionId\030\002 \002(\003\022\033" +
+      "\n\003put\030\003 \002(\0132\016.MutationProto\022\013\n\003row\030\004 \002(\014" +
+      "\022\016\n\006family\030\005 \002(\014\022\021\n\tqualifier\030\006 \002(\014\022\r\n\005v" +
+      "alue\030\007 \002(\014\022\020\n\010commitId\030\010 \002(\003\022\016\n\006forced\030\t" +
+      " \001(\010\"L\n\021TlogWriteResponse\022\016\n\006result\030\001 \003(" +
+      "\003\022\021\n\texception\030\002 \001(\t\022\024\n\014hasException\030\003 \001" +
+      "(\010\"\321\001\n(TlogTransactionStatesFromInterval" +
+      "Request\022\022\n\nregionName\030\001 \002(\014\022\025\n\rtransacti" +
+      "onId\030\002 \002(\003\022\021\n\tclusterId\030\003 \002(\003\022\023\n\013auditSe",
+      "qNum\030\004 \002(\003\022\021\n\tscannerId\030\005 \002(\003\022\024\n\014numberO" +
+      "fRows\030\006 \002(\005\022\023\n\013nextCallSeq\030\007 \002(\003\022\024\n\014clos" +
+      "eScanner\030\010 \002(\010\"\242\001\n)TlogTransactionStates" +
+      "FromIntervalResponse\022\027\n\006result\030\001 \003(\0132\007.R" +
+      "esult\022\r\n\005count\030\002 \002(\003\022\023\n\013nextCallSeq\030\003 \002(" +
+      "\003\022\017\n\007hasMore\030\004 \002(\010\022\021\n\texception\030\005 \001(\t\022\024\n" +
+      "\014hasException\030\006 \001(\010\"\243\001\n\035TransactionalAgg" +
+      "regateRequest\022\022\n\nregionName\030\001 \002(\014\022\025\n\rtra" +
+      "nsactionId\030\002 \002(\003\022\036\n\026interpreter_class_na" +
+      "me\030\003 \002(\t\022\023\n\004scan\030\004 \002(\0132\005.Scan\022\"\n\032interpr",
+      "eter_specific_bytes\030\005 \001(\014\"I\n\036Transaction" +
+      "alAggregateResponse\022\022\n\nfirst_part\030\003 \003(\014\022" +
+      "\023\n\013second_part\030\004 \001(\014\"c\n\022TransactionPersi" +
+      "st\022\016\n\006txById\030\001 \003(\003\022\024\n\014seqNoListSeq\030\002 \003(\003" +
+      "\022\024\n\014seqNoListTxn\030\003 \003(\003\022\021\n\tnextSeqId\030\004 \002(" +
+      "\003\"\372\001\n\023TransactionStateMsg\022\014\n\004txId\030\001 \002(\003\022" +
+      "\033\n\003put\030\002 \003(\0132\016.MutationProto\022\036\n\006delete\030\003" +
+      " \003(\0132\016.MutationProto\022\020\n\010putOrDel\030\004 \003(\010\022\023" +
+      "\n\013txnsToCheck\030\005 \003(\003\022\023\n\013startSeqNum\030\006 \002(\003" +
+      "\022\016\n\006seqNum\030\007 \002(\003\022\020\n\010logSeqId\030\010 \002(\003\022\022\n\nre",
+      "instated\030\t \002(\010\022\016\n\006status\030\n \002(\005\022\026\n\016commit" +
+      "Progress\030\013 \002(\0052\262\020\n\020TrxRegionService\022G\n\020a" +
+      "bortTransaction\022\030.AbortTransactionReques" +
+      "t\032\031.AbortTransactionResponse\022_\n\030abortTra" +
+      "nsactionMultiple\022 .AbortTransactionMulti" +
+      "pleRequest\032!.AbortTransactionMultipleRes" +
+      "ponse\022G\n\020beginTransaction\022\030.BeginTransac" +
+      "tionRequest\032\031.BeginTransactionResponse\022A" +
+      "\n\016checkAndDelete\022\026.CheckAndDeleteRequest" +
+      "\032\027.CheckAndDeleteResponse\0228\n\013checkAndPut",
+      "\022\023.CheckAndPutRequest\032\024.CheckAndPutRespo" +
+      "nse\022;\n\014closeScanner\022\024.CloseScannerReques" +
+      "t\032\025.CloseScannerResponse\022)\n\006commit\022\016.Com" +
+      "mitRequest\032\017.CommitResponse\022G\n\020commitIfP" +
+      "ossible\022\030.CommitIfPossibleRequest\032\031.Comm" +
+      "itIfPossibleResponse\022V\n\025commitRequestMul" +
+      "tiple\022\035.CommitRequestMultipleRequest\032\036.C" +
+      "ommitRequestMultipleResponse\022A\n\016commitMu" +
+      "ltiple\022\026.CommitMultipleRequest\032\027.CommitM" +
+      "ultipleResponse\022>\n\rcommitRequest\022\025.Commi",
+      "tRequestRequest\032\026.CommitRequestResponse\022" +
+      "C\n\006delete\022\033.DeleteTransactionalRequest\032\034" +
+      ".DeleteTransactionalResponse\022[\n\016deleteMu" +
+      "ltiple\022#.DeleteMultipleTransactionalRequ" +
+      "est\032$.DeleteMultipleTransactionalRespons" +
+      "e\022:\n\003get\022\030.GetTransactionalRequest\032\031.Get" +
+      "TransactionalResponse\0228\n\013performScan\022\023.P" +
+      "erformScanRequest\032\024.PerformScanResponse\022" +
+      "8\n\013openScanner\022\023.OpenScannerRequest\032\024.Op" +
+      "enScannerResponse\022:\n\003put\022\030.PutTransactio",
+      "nalRequest\032\031.PutTransactionalResponse\022R\n" +
+      "\013putMultiple\022 .PutMultipleTransactionalR" +
+      "equest\032!.PutMultipleTransactionalRespons" +
+      "e\022D\n\017recoveryRequest\022\027.RecoveryRequestRe" +
+      "quest\032\030.RecoveryRequestResponse\022<\n\021delet" +
+      "eTlogEntries\022\022.TlogDeleteRequest\032\023.TlogD" +
+      "eleteResponse\0220\n\007putTlog\022\021.TlogWriteRequ" +
+      "est\032\022.TlogWriteResponse\022w\n\036getTransactio" +
+      "nStatesPriorToAsn\022).TlogTransactionState" +
+      "sFromIntervalRequest\032*.TlogTransactionSt",
+      "atesFromIntervalResponse\022I\n\006GetMax\022\036.Tra" +
+      "nsactionalAggregateRequest\032\037.Transaction" +
+      "alAggregateResponse\022I\n\006GetMin\022\036.Transact" +
+      "ionalAggregateRequest\032\037.TransactionalAgg" +
+      "regateResponse\022I\n\006GetSum\022\036.Transactional" +
+      "AggregateRequest\032\037.TransactionalAggregat" +
+      "eResponse\022L\n\tGetRowNum\022\036.TransactionalAg" +
+      "gregateRequest\032\037.TransactionalAggregateR" +
+      "esponse\022I\n\006GetAvg\022\036.TransactionalAggrega" +
+      "teRequest\032\037.TransactionalAggregateRespon",
+      "se\022I\n\006GetStd\022\036.TransactionalAggregateReq" +
+      "uest\032\037.TransactionalAggregateResponse\022L\n" +
+      "\tGetMedian\022\036.TransactionalAggregateReque" +
+      "st\032\037.TransactionalAggregateResponseBS\n;o" +
+      "rg.apache.hadoop.hbase.coprocessor.trans" +
+      "actional.generatedB\017TrxRegionProtosH\001\210\001\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -39778,7 +39957,7 @@ public final class TrxRegionProtos {
           internal_static_AbortTransactionRequest_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_AbortTransactionRequest_descriptor,
-              new java.lang.String[] { "RegionName", "TransactionId", "ParticipantNum", });
+              new java.lang.String[] { "RegionName", "TransactionId", "ParticipantNum", "DropTableRecorded", });
           internal_static_AbortTransactionResponse_descriptor =
             getDescriptor().getMessageTypes().get(1);
           internal_static_AbortTransactionResponse_fieldAccessorTable = new
@@ -39838,7 +40017,7 @@ public final class TrxRegionProtos {
           internal_static_CommitRequestRequest_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_CommitRequestRequest_descriptor,
-              new java.lang.String[] { "RegionName", "TransactionId", "ParticipantNum", });
+              new java.lang.String[] { "RegionName", "TransactionId", "ParticipantNum", "DropTableRecorded", });
           internal_static_CommitRequestResponse_descriptor =
             getDescriptor().getMessageTypes().get(11);
           internal_static_CommitRequestResponse_fieldAccessorTable = new

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
index 6994745..0eac088 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
@@ -151,11 +151,27 @@ public class TrxTransactionState extends TransactionState {
     private List<WriteAction> writeOrdering = Collections.synchronizedList(new LinkedList<WriteAction>());
     private Set<TrxTransactionState> transactionsToCheck = Collections.synchronizedSet(new HashSet<TrxTransactionState>());
     private WALEdit e;
+    private boolean dropTableRecorded;
 
     public TrxTransactionState(final long transactionId, final long rLogStartSequenceId, AtomicLong hlogSeqId,
             final HRegionInfo regionInfo, HTableDescriptor htd, WAL hLog, boolean logging) {
         super(transactionId, rLogStartSequenceId, hlogSeqId, regionInfo, htd, hLog, logging);
         this.e = new WALEdit();
+        dropTableRecorded = false;
+    }
+
+    public void setDropTableRecorded(boolean dropTableRecord) {
+        if (LOG.isTraceEnabled()) LOG.trace("setDropTableRecorded:" + dropTableRecord + " Region " + regionInfo.getRegionNameAsString());
+        dropTableRecorded = dropTableRecord;
+    }
+    
+    public void resetDropTableRecorded() {
+        if (LOG.isTraceEnabled()) LOG.trace("resetDropTableRecorded,  Region :" + regionInfo.getRegionNameAsString());
+        dropTableRecorded = false;
+    }
+    
+    public boolean dropTableRecorded() {
+        return dropTableRecorded;
     }
 
     public synchronized void addRead(final byte[] rowKey) {
@@ -330,6 +346,7 @@ public class TrxTransactionState extends TransactionState {
         clearDeletes();
         clearTags();
         clearWALEdit();
+        dropTableRecorded = false;
     }
 
     public void clearTransactionsToCheck() {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto b/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
index bf5656f..ecfe69b 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/protobuf/TrxRegion.proto
@@ -36,6 +36,7 @@ message AbortTransactionRequest{
   required bytes regionName = 1;
   required int64 transactionId = 2;
   required int32 participantNum = 3;
+  required bool dropTableRecorded = 4;
 }
 
 message AbortTransactionResponse {
@@ -92,6 +93,7 @@ message CommitRequestRequest{
   required bytes regionName = 1;
   required int64 transactionId = 2;
   required int32 participantNum = 3;
+  required bool dropTableRecorded = 4;
 }
 
 message CommitRequestResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sql/cli/SessionDefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/SessionDefaults.cpp b/core/sql/cli/SessionDefaults.cpp
index bc5bd13..2306e29 100644
--- a/core/sql/cli/SessionDefaults.cpp
+++ b/core/sql/cli/SessionDefaults.cpp
@@ -840,6 +840,8 @@ static const AQRInfo::AQRErrorMap aqrErrorMap[] =
   // view not found
   AQREntry(   8598,      0,      1,     0,      1,   0, "",    0,     0), 
 
+  AQREntry(   8606,     73,      3,    60,      0,   0, "",    0,     0), 
+
   AQREntry(   8606,     97,      1,     0,      5,   0, "",    0,     0),
 
   // privileges may have been revoked

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sql/regress/core/DIFF116.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/DIFF116.KNOWN.SB b/core/sql/regress/core/DIFF116.KNOWN.SB
index 7db919b..e69de29 100644
--- a/core/sql/regress/core/DIFF116.KNOWN.SB
+++ b/core/sql/regress/core/DIFF116.KNOWN.SB
@@ -1,21 +0,0 @@
-467c467,469
-< --- SQL operation complete.
----
-> *** ERROR[8606] Transaction subsystem TMF returned error 73 on a commit transaction.
-> 
-> --- SQL operation failed with errors.
-470,471c472
-< -- Definition of table #CAT.#SCH.T116T1
-< -- Definition current
----
-> *** ERROR[4254] Object #CAT.#SCH.T116T1 has invalid state and cannot be accessed. Use cleanup command to drop it.
-473,475c474
-<  (
-<  A INT NO DEFAULT NOT NULL NOT DROPPABLE
-<  )
----
-> *** ERROR[4082] Object #CAT.#SCH.T116T1 does not exist or is inaccessible.
-477c476
-< --- SQL operation complete.
----
-> --- SQL operation failed with errors.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1af3985b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 921369f..b01b580 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -445,6 +445,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
    int32_t rowCount = 0;
    bool someObjectsCouldNotBeDropped = false;
    Queue * objectsQueue = NULL;
+   Queue * otherObjectsQueue = NULL;
 
    NABoolean dirtiedMetadata = FALSE;
 
@@ -539,6 +540,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
      }
    }
 
+#ifdef __ignore
    // Drop histogram tables first
    objectsQueue->position();
    for (size_t i = 0; i < objectsQueue->numEntries(); i++)
@@ -555,6 +557,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
           someObjectsCouldNotBeDropped = true;
      }
    }
+#endif
 
    // Drop procedures (SPJs), UDFs (functions), and views 
     objectsQueue->position();
@@ -723,19 +726,17 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
                  getSystemCatalog(),SEABASE_MD_SCHEMA,SEABASE_OBJECTS,
                  (char*)catName.data(),(char*)schName.data(), 
                  COM_INDEX_OBJECT_LIT);
-   
-   cliRC = cliInterface.fetchAllRows(objectsQueue,query,0,FALSE,FALSE,TRUE);
+   cliRC = cliInterface.fetchAllRows(otherObjectsQueue,query,0,FALSE,FALSE,TRUE);
    if (cliRC < 0)
    {
       cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
       goto label_error;
    }
 
-   objectsQueue->position();
-   for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
+   otherObjectsQueue->position();
+   for (int idx = 0; idx < otherObjectsQueue->numEntries(); idx++)
    {
-      OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
-
+      OutputInfo * vi = (OutputInfo*)otherObjectsQueue->getNext(); 
       char * objName = vi->get(0);
       NAString objType = vi->get(1);
    
@@ -765,18 +766,17 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
                (char*)catName.data(),(char*)schName.data(), 
                COM_SEQUENCE_GENERATOR_OBJECT_LIT);
   
-   cliRC = cliInterface.fetchAllRows(objectsQueue,query,0,FALSE,FALSE,TRUE);
+   cliRC = cliInterface.fetchAllRows(otherObjectsQueue,query,0,FALSE,FALSE,TRUE);
    if (cliRC < 0)
    {
       cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
       goto label_error;
    }
 
-   objectsQueue->position();
-   for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
+   otherObjectsQueue->position();
+   for (int idx = 0; idx < otherObjectsQueue->numEntries(); idx++)
    {
-      OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
-
+      OutputInfo * vi = (OutputInfo*)otherObjectsQueue->getNext(); 
       char * objName = vi->get(0);
       NAString objType = vi->get(1);
     
@@ -794,6 +794,23 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
       }  
    }  
 
+   // Drop histogram tables last
+   objectsQueue->position();
+   for (size_t i = 0; i < objectsQueue->numEntries(); i++)
+   {
+     OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
+     NAString objName = vi->get(0);
+
+     if (isHistogramTable(objName))
+     {
+       dirtiedMetadata = TRUE;
+       if (dropOneTable(cliInterface,(char*)catName.data(),
+                        (char*)schName.data(),(char*)objName.data(),
+                        isVolatile, dropSchemaNode->ddlXns()))
+          someObjectsCouldNotBeDropped = true;
+     }
+   }
+
    // For volatile schemas, sometimes only the objects get dropped.    
    // If the dropObjectsOnly flag is set, just exit now, we are done.
    if (dropSchemaNode->dropObjectsOnly())


[11/50] [abbrv] incubator-trafodion git commit: support hdp2_3

Posted by db...@apache.org.
support hdp2_3


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

Branch: refs/heads/master
Commit: 362aef5eca965d00a34ba3bbedd2b901b1679182
Parents: 38c9005
Author: traf <tr...@aven01.novalocal>
Authored: Tue Mar 15 12:46:14 2016 +0000
Committer: traf <tr...@aven01.novalocal>
Committed: Tue Mar 15 12:46:14 2016 +0000

----------------------------------------------------------------------
 core/sqf/conf/install_features | 2 +-
 core/sqf/sqenvcom.sh           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/362aef5e/core/sqf/conf/install_features
----------------------------------------------------------------------
diff --git a/core/sqf/conf/install_features b/core/sqf/conf/install_features
index 184670e..0fd7e98 100644
--- a/core/sqf/conf/install_features
+++ b/core/sqf/conf/install_features
@@ -62,5 +62,5 @@
 # verify the hadoop distro versions are correct as well as 
 # perform some additional support for this.
 export CDH_5_3_HDP_2_2_SUPPORT="N"
-export HDP_2_3_SUPPORT="N"
+export HDP_2_3_SUPPORT="Y"
 export CDH_5_4_SUPPORT="Y"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/362aef5e/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 6dadb19..a640793 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -380,8 +380,7 @@ elif [[ -n "$(ls /etc/init.d/ambari* 2>/dev/null)" ]]; then
   export HIVE_JAR_DIRS="/usr/hdp/current/hive-client/lib"
   export HIVE_JAR_FILES="/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core*.jar"
 
-  export HBASE_TRX_JAR=hbase-trx-hdp2_2-${TRAFODION_VER}.jar
-
+  export HBASE_TRX_JAR=${HBASE_TRX_ID_HDP}-${TRAFODION_VER}.jar
   # Configuration directories
 
   export HADOOP_CNF_DIR=/etc/hadoop/conf
@@ -573,6 +572,7 @@ EOF
     lv_hbase_cp=`hbase classpath`
 
     # end of code for Apache Hadoop/HBase installation w/o distro
+    export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
   else
     # print usage information, not enough information about Hadoop/HBase
     vanilla_apache_usage


[12/50] [abbrv] incubator-trafodion git commit: Update trafodion_install

Posted by db...@apache.org.
Update trafodion_install

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

Branch: refs/heads/master
Commit: accd1570f1c7831eeb35ebbe83787d1147becf0d
Parents: 362aef5
Author: mashengchen <ma...@gmail.com>
Authored: Wed Mar 16 00:56:34 2016 +0800
Committer: mashengchen <ma...@gmail.com>
Committed: Wed Mar 16 00:56:34 2016 +0800

----------------------------------------------------------------------
 install/installer/trafodion_install | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/accd1570/install/installer/trafodion_install
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_install b/install/installer/trafodion_install
index 4bb6649..1d9a43e 100755
--- a/install/installer/trafodion_install
+++ b/install/installer/trafodion_install
@@ -103,11 +103,12 @@ do
                   exit -1
                fi
             else
-               supportedHBase=$(echo $version | grep "1.1.1" | wc -l)
-               if [[ $supportedHBase -eq "0" ]]; then
-                  echo "***ERROR: HBase installed must be 1.1.1 on node $node"
+               supportedHBase=${version:0:3} 
+               if [[ $supportedHBase -ne "1.1" ]]; then
+                  echo "***ERROR: HBase installed must be 1.1.x on node $node"
                   exit -1
                fi
+               
             fi
          else
             supportedHBase=$(echo $version | grep "0.98.4" | wc -l)


[44/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/odbc_linux.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/odbc_linux.adoc b/docs/client_install/src/asciidoc/_chapters/odbc_linux.adoc
index 09cad34..e0419e3 100644
--- a/docs/client_install/src/asciidoc/_chapters/odbc_linux.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/odbc_linux.adoc
@@ -21,14 +21,19 @@
 ////
 
 = Install Linux ODBC Driver
-These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
 
-== Installation Packaged
+== Installation Requirements
+
+The driver for Linux requires `libgcc 3.4.3` and `libstd++ 6.0`.
+
+If you are building ODBC applications, please use the preferred build platform, RedHat 6.x or CentOS 6.x.
+
+== Installation Instructions
 
-The distribution file for the Trafodion ODBC Driver for Linux is packaged within the Trafodion clients tar file,
-`clients-1.3.*_n_*.tar.gz`, on the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
+You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
 
-`TRAF_ODBC_Linux_Driver_64.tar.gz` is used to install the Trafodion ODBC Driver for Linux. It contains the following files:
+The package file contains the Trafodion ODBC distribution file, `TRAF_ODBC_Linux_Driver_64.tar.gz`, which is extracted to the `clients` subdirectory.
+It contains the following files:
 
 ```
 connect_test.cpp 
@@ -43,44 +48,21 @@ MD5SUM
 TRAFDSN 
 ```
 
-By default, a new version of the Trafodion ODBC driver will be installed in the following directories unless you specify a different directory
+By default, a new version of the Trafodion ODBC driver is installed in the following directories unless you specify a different directory
 during installation:
 
 * `/usr/lib64`
 * `/etc/odbc`
 
-NOTE: The following header files are not packaged with the Trafodion ODBC driver:
-
-* `sql.h`
-* `sqlext.h`
-* `sqltypes.h`
-* `sqlucode.h`
-
+NOTE: The following header files are not packaged with the Trafodion ODBC driver: +
+ +
+- `sql.h` +
+- `sqlext.h` +
+- `sqltypes.h` +
+- `sqlucode.h` +
+ +
 To install those header files, <<win_odbc_client_env, Setting Up the Client Environment>>..
 
-<<<
-== Installation Requirements
-
-The driver for Linux requires `libgcc 3.4.3` and `libstd++ 6.0`.
-
-If you are building ODBC applications, please use the preferred build platform, RedHat 6.4 or CentOS 6.4.
-
-== Installation Instructions
-
-=== Download Linux ODBC Driver
-
-1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to http://trafodion.incubator.apache.org/download.html.
-3.  Click on the `clients-1.3.*_n_*.tar.gz` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `clients-1.3.*_n_*.tar.gz` file into the download folder.
-5.  Unpack the `clients-1.3.*_n_*.tar.gz` file.
-+
-```
-tar -xzf clients-1.3.0.tar.gz
-```
-
-The package file contains the Trafodion ODBC distribution file, `TRAF_ODBC_Linux_Driver_64.tar.gz`, which is extracted to the clients subdirectory.
-
 === Install/Reinstall Linux ODBC Driver
 
 NOTE: You must have root access to install the Trafodion ODBC Driver for Linux at the default system location.
@@ -100,7 +82,7 @@ tar –xvf TRAF_ODBC_Linux_Driver_64.tar
 +
 ```
 cd PkgTmp 
-./install.sh
+sudo ./install.sh
 ```
 +
 Except for the sample file, the `install.sh` script saves a copy (`.SAV`) of your previous installation files if they exist.
@@ -109,6 +91,7 @@ Except for the sample file, the `install.sh` script saves a copy (`.SAV`) of you
 6.  Enter a directory for the data-source template file, or press *Enter* to use the default directory (`/etc/odbc`).
 7.  Enter a directory for the sample program, or press *Enter* to use the default directory (`/etc/odbc`).
 
+<<<
 === Set Up Client Environment
 
 If you selected default options during installation, ensure that:
@@ -122,7 +105,7 @@ installation.
 The driver expects the `TRAFDSN` file to be present in either the default location (`/etc/odbc`) or the current working directory (`CWD`) of the
 application.
 
-If you are building ODBC applications, you will need to install these header files in your build environment:
+If you are building ODBC applications, you need to install these header files in your build environment:
 
 * `sql.h`
 * `sqlext.h`
@@ -132,7 +115,7 @@ If you are building ODBC applications, you will need to install these header fil
 To install those header files from the latest packages, run this `yum` command:
 
 ```
-yum install libiodbc libiodbc-devel
+sudo yum -y install libiodbc libiodbc-devel
 ```
 
 The `yum` command automatically installs the header files in the `/usr/include` and `/usr/include/libiodbc` directories.
@@ -175,7 +158,7 @@ The `_compression-level_` is one of these values:
 
 NOTE: For better performance, we recommend that you use at least version `2.3._x_` of unixODBC.
 
-* If you are using an external driver manager, you must point to `libtrafodbc_drvr64.so` and not to `libtrafodbc64.so`.
+* If you are using an external driver manager, then you must point to `libtrafodbc_drvr64.so` and not to `libtrafodbc64.so`.
 * The driver, `libtrafodbc_l64_drvr.so`, has been verified with iODBC and unixODBC driver managers.
 * These driver managers, as well as documentation, can be found at these Web sites:
 * http://www.iodbc.org/
@@ -183,6 +166,7 @@ NOTE: For better performance, we recommend that you use at least version `2.3._x
 * For information on the necessary data-source configuration options, you will need to add to the respective configuration files (for example,
 to `odbc.ini`).
 
+<<<
 === Run Sample Program (`connect_test`)
 
 NOTE: The examples after each step assume that you have default installation directories.
@@ -205,6 +189,12 @@ cd /etc/odbc
 ```
 export LD_LIBRARY_PATH=<path-to-odbc-library-files or /usr/lib64>
 ```
++
+*Example*
++
+```
+export LD_LIBRARY_PATH=/usr/lib64
+```
 
 3.  In the `/etc/odbc/TRAFDSN` file, add the correct IP address to the `Server` parameter for the `Default_DataSource`.
 +
@@ -217,16 +207,18 @@ Catalog = TRAFODION
 Schema = SEABASE
 DataLang = 0
 FetchBufferSize = SYSTEM_DEFAULT
-Server = TCP:1.2.3.4:37800 <- _Set IP Address_
+Server = TCP:1.2.3.4:23400 <- _Set IP Address_
 SQL_ATTR_CONNECTION_TIMEOUT = SYSTEM_DEFAULT
 SQL_LOGIN_TIMEOUT = SYSTEM_DEFAULT
 SQL_QUERY_TIMEOUT = NO_TIMEOUT
 ```
++
+<<<
 
 4.  Compile the sample program.
 +
 ```
-g++ -g connect_test.cpp -L/usr/lib64 -I/usr/include/odbc -ltrafodbc64 -o connect_test
+sudo g++ -g connect_test.cpp -L/usr/lib64 -I/usr/include/odbc -ltrafodbc64 -o connect_test
 ```
 
 5.  Run the sample program:
@@ -266,8 +258,6 @@ export LD_LIBRARY_PATH=<path-to-odbc-driver-dlls>
 
 3.  In the `/etc/odbc/TRAFDSN` file, add the correct IP address to the `Server` parameter for the `Default_DataSource`. For example:
 +
-<<<
-+
 *Example*
 +
 ```
@@ -277,11 +267,13 @@ Catalog = TRAFODION
 Schema = SEABASE
 DataLang = 0
 FetchBufferSize = SYSTEM_DEFAULT
-Server = TCP:1.2.3.4:37800 
+Server = TCP:1.2.3.4:23400 
 SQL_ATTR_CONNECTION_TIMEOUT = SYSTEM_DEFAULT
 SQL_LOGIN_TIMEOUT = SYSTEM_DEFAULT
 SQL_QUERY_TIMEOUT = NO_TIMEOUT
 ```
++
+<<<
 
 4.  Compile the sample program.
 +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc b/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
index 739d0e6..98995b9 100644
--- a/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
@@ -20,29 +20,34 @@
  */
 ////
 
+[[install-windows-odbc-driver]]
 = Install Windows ODBC Driver
-These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
 
-== Installation Package
-The installer file for the Trafodion ODBC Driver for Windows is packaged within the Trafodion clients tar file, `Trafodion Clients`, on the
-Trafodion downloads site http://trafodion.incubator.apache.org/download.html. Use this installer file to install the Trafodion ODBC Driver for Windows:
+WARNING: License issues prevent us from including the ODBC Driver for Windows in this release. Contact the
+Trafodion user e-mail list (user@trafodion.incubator.apache.org) for help obtaining the driver.
 
-[cols="25%l,25%,50%",options="header"]
+== Installation Requirements
+
+[cols="40%s,60%",options="header"]
 |===
-| Installer File           | Description                | Client Operating System
-| TFODBC64-1.3.*_n_*.msi   | Windows MSI installer file | Windows 64-bit
+| Item             | Requirement
+| Computer         | Windows compatible PC workstation
+| Memory           | Recommended minimum 32 MB
+| Disk Space       | Minimum 30 MB additional free space
+| Operating System | x64 Edition of Microsoft Windows 7, Windows 8, Windows 10, or Windows Server 2008
+| Network Software | TCP/IP
 |===
 
-By default, a new version of the ODBC driver will be installed in this directory and its folders unless you specify a different directory
-during installation:
+== Installation Instructions
+[[win_odbc_install]]
 
-[cols="40%l,60%",options="header"]
-|===
-| Default Installation Directory    | Client Operating System
-| C:\Program Files\Trafodion\TRAF   | ODBC 1.0 Windows 64-bit
-|===
+=== Install Windows ODBC Driver
+
+NOTE: To install the driver on your PC, you must be logged on with a user ID that has administrator privileges.
+
+You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
 
-The ODBC client installation file installs or links to multiple client components:
+The ODBC client installation file, `TFODBC64-*.exe`, which installs or links to multiple client components:
 
 [cols="40%s,60%",options="header"]
 |===
@@ -53,91 +58,59 @@ correct driver.
 | Microsoft ODBC Administrator | Adds, configures, and removes ODBC data sources on client workstations.
 |===
 
-<<<
-== Installation Requirements
+By default, a new version of the ODBC driver is installed in this directory and its folders unless you specify a different directory
+during installation:
 
-[cols="40%s,60%",options="header"]
+[cols="40%l,60%",options="header"]
 |===
-| Item             | Requirement
-| Computer         | Windows compatible PC workstation
-| Memory           | Recommended minimum 32 MB
-| Disk Space       | Minimum 30 MB additional free space
-| Operating System | x64 Edition of Microsoft Windows 7, Windows 8, or Windows Server 2008
-| Network Software | TCP/IP
+| Default Installation Directory    | Client Operating System
+| C:\Program Files\Trafodion\TRAF   | ODBC _version_ Windows 64-bit
 |===
 
-== Installation Instructions
-[[win_odbc_install]]
-=== Install Windows ODBC Driver
-NOTE: To install the driver on your PC, you must be logged on with a user ID that has administrator privileges.
-
-==== Task 1: Download the ODBC client installation file
-1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html
-3.  Click on the `Trafodion Clients` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `*.tar.gz file` into the download folder.
-5.  Extract the contents of the `*.tar.gz` file by using an extract tool like WinZip. The package file contains the
-`TFODBC64-1.3.*_n_*.msi` installer file, which is extracted to the clients sub-directory.
-
-==== Task 2: Start the InstallShield wizard
+=== Start the InstallShield wizard
 The InstallShield wizard walks you through the steps to install the client components (Trafodion ODBC 1.0) on your workstation. You can
 perform the installation in _interactive mode_, in which you provide input or accept defaults when prompted as ODBC is installed. 
 Please refer to <<win_odbc_interactive_mode,Interactive Mode Installation>> below.
 
-<<<
 [[win_odbc_interactive_mode]]
-===== Interactive Mode Installation
-1.  Double-click the `.msi` distribution file to start the InstallShield wizard.
+==== Interactive Mode Installation
+
+1.  Double-click the `TFODBC64-*.exe` distribution file to start the InstallShield wizard.
 2.  On the *Welcome* page, click *Next*.
-3.  On the *Destination Folder* page, click *Next* to select the default location: `C:\Program Files\Trafodion\TRAF ODBC 1.0\` 
+3.  Read and select the *I accept the agreement* radio button. Click *Next*. 
+4.  On the *Destination Folder* page, click *Install* to select the default location: `C:\Program Files\Trafodion\TRAF ODBC _version_\` 
 +
 This location is the installation directory for ODBC header and help files. All other ODBC files are installed in `%SYSTEMROOT%\system32`.
-4.  On the *Set Certificate Directory* page, click *Next* to accept the default location for the security certificate (`SYSTEM_DEFAULT`).
-5.  On the *Ready to Install the Program* page, click *Install*. The installation begins. The *Installing Trafodion ODBC64 1.0* page displays a
-progress bar.
-6.  On the *InstallShield Wizard Completed* page, click *Finish* to exit the wizard. Do not add a new `Trafodion ODBC` data source to the MS ODBC
-Administrator until you have restarted your system.
 
-==== Task 3: Add a client data source
+5. Read and accept the Microsoft C++ license agreement by checking the *I agree to the license terms and conditions*. Click *Install*.
+6. Click *Close*.
+7. Click *Finish* to exit the installation wizard.
+
+=== Add a client data source
 1.  Start the Microsoft ODBC Administrator:
-* On Windows 7: *Start>All Programs>Trafodion ODBC 1.0>MS ODBC Administrator*
-* On Windows 8: Right-click the *Trafodion ODBC 1.0* icon on the desktop and select MS ODBC Administrator.
+* On Windows 7: *Start>All Programs>Trafodion ODBC _version_>MS ODBC Administrator*
+* On Windows 8: Right-click the *Trafodion ODBC _version_* icon on the desktop and select MS ODBC Administrator.
+* On Windows 10: Right-click the Windows icon in the menu bar. Select *Settings*. Search for *Set up ODBC data sources (64-bit)*. Click on the found item. 
+
 2.  In the *ODBC Data Source Administrator* dialog box, click *Add*.
-3.  Select *TRAF ODBC 1.0*, and then click *Finish* to start the *Create a New Trafodion ODBC Data Source* wizard.
+3.  Select *TRAF ODBC _version_*, and then click *Finish* to start the *Create a New Trafodion ODBC Data Source* wizard.
 4.  Enter the data source name (for example, `Default_DataSource_Schema1`) and an optional description, and click *Next*.
-5.  Enter the `IP address` or `host name` for the database platform. Enter the port number as *37800*. Leave the defaults as is, and click *Next*.
+5.  Enter the `IP address` or `host name` for the database platform. Enter the default port number as *23400*^1^. Leave the defaults as is, and click *Next*.
 6.  Enter the schema name. The default schema name is `SEABASE`. Click *Next*.
 7.  Enter the translate DLL name and its option, if you have one. If not, leave it blank. Leave the localization defaults as is.
 +
-<<<
-+
 The Replacement Character replaces any character that is incompatible for translation when retrieving data. It is one character (one or two
 bytes long). The Replacement Character is assumed to be in the character set specified in the Client/Server Character Set Interaction. If it is not specified, `?` is used as the default.
 +
-Click *Next*.
-8.  Select the trace options, if desired. Change the *Log File Path* to the location you want, or leave the default as is, and click *Finish*.
-9.  The wizard gives you an opportunity to test the connection. Click *Test Connection* and click *OK*.
-10.  The server ID and schema are filled in for you. Enter a valid user name and password, and click *OK*.
-+
-The wizard attempts to connect to the data source and displays a message stating whether it was successful or not.
-11.  Click *OK* to save the data source, or click *Cancel* _twice_ to quit the *Create Data Source* wizard.
-
-=== Reinstall Windows ODBC Driver
-To reinstall the driver, we recommend that you fully remove your ODBC driver and then install the new version. Please refer to
-<<win_odbc_uninstall,Uninstalling the Trafodion ODBC Driver for Windows>> and then <<win_odbc_install, Installing the Trafodion ODBC Driver for Windows>>.
+Click *Finish*.
 
-[[win_odbc_uninstall]]
-=== Uninstalling Windows ODBC Driver
-1.  Start to remove the ODBC driver:
-* On Windows 7: *Start>All Programs>Trafodion ODBC 1.0>Remove TRAF ODBC 1.0*
-* On Windows 8: Right-click the *Trafodion ODBC 1.0* icon on the desktop and select *Remove TRAF ODBC 1.0*.
-2.  When the *Windows Installer* dialog box asks you if you want to uninstall this product, click *Yes*.
-3.  The *Trafodion ODBC 1.0* dialog box displays the status and asks you to wait while `Windows configures Trafodion ODBC 1.0` (that is, removes
-the Trafodion ODBC Driver from your Windows workstation).
+8.  The wizard gives you an opportunity to test the connection. Click *Test Connection* and click *OK*.
+9.  The server ID and schema are filled in for you. Enter a valid user name and password, and click *OK*.
 +
-After this dialog box disappears, Trafodion ODBC 1.0 is no longer on your workstation.
+The wizard attempts to connect to the data source and displays a message stating whether it was successful or not.
+10.  Click *OK* to save the data source, or click *Cancel* _twice_ to quit the *Create Data Source* wizard.
 
-NOTE: Uninstalling the ODBC driver does not remove pre-existing data source definitions from the Windows registry.
+^1^ Your specific installation may use a different port number. Check with your Trafodion administrator.
 
 <<<
 [[win_odbc_client_env]]
@@ -157,25 +130,32 @@ definitions with different schemas on the workstation. The client data source wi
 To create a data source on the client workstation, follow these steps:
 
 1.  Launch the *MS ODBC Administrator*. 
-+
-For example, on Windows 7, select *Start>All Programs>Trafodion ODBC 1.0>MS ODBC Administrator*.
+* On Windows 7: *Start>All Programs>Trafodion ODBC _version_>MS ODBC Administrator*
+* On Windows 8: Right-click the *Trafodion ODBC _version_* icon on the desktop and select MS ODBC Administrator.
+* On Windows 10: Right-click the Windows icon in the menu bar. Select *Settings*. Search for *Set up ODBC data sources (64-bit)*. Click on the found item. 
+
 2.  In the *ODBC Data Source Administrator* dialog box, select the *User DSN* tab, and click *Add*.
-3.  Select the *TRAF ODBC 1.0* driver, and then click *Finish*.
+3.  Select the *TRAF ODBC _version_* driver, and then click *Finish*.
 +
 A new dialog box appears, prompting you to create a new data source.
 4.  Enter the name of the data source, `Default_DataSource`, and click *Next* to continue.
-5.  Enter the IP address and port number of the Trafodion system to which will be connecting. The port number must be *37800*. 
+5.  Enter the IP address and port number of the Trafodion system to which will be connecting. By default, the port number is *23400*^1^. 
 Click *Next* to continue.
-6.  Select the default schema. If you do not select a schema, the default is `USR`. Click Next to continue.
+6.  Select the default schema. If you do not select a schema, the default is `SEABASE`. Click *Next* to continue.
++
+<<<
 7.  If desired, configure the *translate dll*, which translates data from one character set to another, and configure the localization. By
-default, the client error message language is English, and the client’s local character set is used. Click *Next* to continue.
-8.  If desired, set the trace options and the file path of the trace log. Click *Finish*.
+default, the client error message language is English, and the client’s local character set is used. Click *Finish* to continue.
 +
 The *Test Trafodion ODBC Connection* dialog box appears, allowing you to test the connection using the data source that you created.
-9.  Click *Test Connection*.
-10.  When prompted, enter your user name and password, and click *OK*.
+
+8.  Click *Test Connection*.
+9.  When prompted, enter your user name and password, and, optionally, schema. Click *OK*.
 +
 If the connection is successful, you will see `Connected Successfully` in the *Test Trafodion ODBC Connection* dialog box.
+10.  Click *OK* to save the data source, or click *Cancel* _twice_ to quit the *Create Data Source* wizard.
+
+^1^ Your specific installation may use a different port number. Check with your Trafodion administrator.
 
 === Enable Compression
 When compression is enabled in the ODBC driver, the ODBC driver can send and receive large volumes of data quickly and efficiently to and from
@@ -183,12 +163,18 @@ the Trafodion Database Connectivity Services (DCS) server over a TCP/IP network.
 
 To enable compression in the ODBC driver or to change the compression setting, follow these steps:
 
-1.  Launch the MS ODBC Administrator. For example, on Windows 7, select *Start>All Programs>Trafodion ODBC 1.0>MS ODBC Administrator*.
+1.  Launch the MS ODBC Administrator. 
+* On Windows 7: *Start>All Programs>Trafodion ODBC _version_>MS ODBC Administrator*
+* On Windows 8: Right-click the *Trafodion ODBC _version_* icon on the desktop and select MS ODBC Administrator.
+* On Windows 10: Right-click the Windows icon in the menu bar. Select *Settings*. Search for *Set up ODBC data sources (64-bit)*. Click on the found item. 
+
 2.  In the *ODBC Data Source Administrator* dialog box, select the *User DSN* tab, select the name of your data source under 
 *User Data Sources*, and click *Configure*. If you did not create a data source, please refer to 
 <<win_odbc_client_env, Setting Up the Client Environment>>.
 +
 A new dialog box appears, showing the configuration of your data source.
++
+<<<
 3.  Select the *Network* tab, and then select one of these values for *Compression*:
 * `SYSTEM_DEFAULT`, which is the same as no compression
 * `no compression`
@@ -237,3 +223,22 @@ Data selected: 1000 CREATE REPORTS 2014-3-22
 Basic SQL ODBC Test Passed!
 ```
 
+<<<
+== Reinstall Windows ODBC Driver
+To reinstall the driver, we recommend that you fully remove your ODBC driver and then install the new version. Please refer to
+<<win_odbc_uninstall,Uninstalling the Trafodion ODBC Driver for Windows>> and then <<win_odbc_install, Installing the Trafodion ODBC Driver for Windows>>.
+
+[[win_odbc_uninstall]]
+== Uninstalling Windows ODBC Driver
+1.  Start to remove the ODBC driver:
+* On Windows 7: *Start>All Programs>Trafodion ODBC _version_>Remove TRAF ODBC _version_*
+* On Windows 8: Right-click the *Trafodion ODBC _version_* icon on the desktop and select *Remove TRAF ODBC _version_*.
+* On Windows 10: Right-click the Windows icon in the menu bar. Select *Control Panel*. Click on *Uninstall a program*. Locate *Trafodion ODBC64 _version_* and select it. Click on *Uninstall*.
+
+2.  When the *Windows Installer* dialog box asks you if you want to uninstall this product, click *Yes*.
+3.  The *Trafodion ODBC _version_* dialog box displays the status and asks you to wait while `Windows configures Trafodion ODBC _version_` (that is, removes
+the Trafodion ODBC Driver from your Windows workstation).
++
+After this dialog box disappears, Trafodion ODBC _version_ is no longer on your workstation.
+
+NOTE: Uninstalling the ODBC driver does not remove pre-existing data source definitions from the Windows registry.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/sample_prog.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/sample_prog.adoc b/docs/client_install/src/asciidoc/_chapters/sample_prog.adoc
index dfe7b2e..138322c 100644
--- a/docs/client_install/src/asciidoc/_chapters/sample_prog.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/sample_prog.adoc
@@ -34,7 +34,7 @@ Copy and paste the code from this appendix into the recommended files. To build
 
 === `basicsql.cpp` Source Code
 You can download the `basicsql.cpp` example from
-http://trafodion.incubator.apache.org/docs/latest/client_install/resources/source/basicsql.cpp.
+http://trafodion.incubator.apache.org/docs/client_install/resources/source/basicsql.cpp.
 
 Alternatively, copy and paste the following code into a file named `basicsql.cpp`:
 
@@ -52,7 +52,7 @@ see the instructions in <<win_odbc_run_basicsql, Run Sample Program (`basicsql`)
 
 ==== `build.bat` (Build Script)
 You can download the `build.bat` example from
-http://trafodion.incubator.apache.org/docs/latest/client_install/resources/source/build.bat.
+http://trafodion.incubator.apache.org/docs/client_install/resources/source/build.bat.
 
 Alternatively, copy and paste the following code into a file named `build.bat`, which is used to build the sample program on Windows:
 
@@ -64,7 +64,7 @@ To build the sample program on Windows, see the instructions in <<win_odbc_run_b
 
 ==== Run `run.bat`
 You can download the `run.bat` example from
-http://trafodion.incubator.apache.org/docs/latest/client_install/resources/source/run.bat.
+http://trafodion.incubator.apache.org/docs/client_install/resources/source/run.bat.
 
 Alternatively, copy and paste the following code into a file named `run.bat`, which is used to run the sample program on Windows:
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/_chapters/trafci.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/trafci.adoc b/docs/client_install/src/asciidoc/_chapters/trafci.adoc
index f670587..2a21d2a 100644
--- a/docs/client_install/src/asciidoc/_chapters/trafci.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/trafci.adoc
@@ -20,137 +20,46 @@
  */
 ////
 
-= Install TrafCI
-These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
-
-== Installation Package
-
-The distribution file for the Trafodion Command Interface (TrafCI) is packaged within the Trafodion clients tar file,
-`clients-1.3.*_n_*.tar.gz`, on the Trafodion downloads site http://trafodion.incubator.apache.org/download.html.
-Use this distribution file to install TrafCI:
-
-[cols="35%l,35%,30%",options="header"]
-|===
-| Distribution File | Description | Client Operating System
-| trafci.zip        | Zip file    | Windows or Linux
-|===
-
-The distribution zip file contains this installer file: `trafciInstaller.jar`, an executable JAR file.
+[[trafci]]
+= Install trafci
 
+[[trafci-installation-requirements]]
 == Installation Requirements
 
-The Trafodion Command Interface (TrafCI) runs on Windows and Linux. Before installing TrafCI on the client workstation, follow these
-instructions:
-
-* <<trafci_JRE, Install Java Runtime Environment>>
-* <<trafci_install_jdbct4, Install JDBC Type-4 Driver>>
-* <<trafci_perl_python, Install Perl or Python>>
-
-[[trafci_JRE]]
-=== Install/Verify Java Runtime Environment
-
-TrafCI and the Trafodion JDBC Type 4 Driver require that a compatible Java version be installed on the client workstation and that the Java
-path be set to the correct location. The supported Java version is 1.7 or higher.
-
-To determine the Java version that you have installed on your client workstation and to install a supported version, see
-<<jdbct4_JRE, Install Java Runtime Environment (JRE)>>.
-
-[[trafci_install_jdbct4]]
-=== Install/Verify JDBC Type-4 Driver
-TrafCI requires a compatible version of the Trafodion JDBC Type 4 Driver to be installed on the client workstation before you install TrafCI.
-
-==== Install JDBC Type-4 Driver
-To install and use the JDBC driver, see <<jdbct4_JRE, Install Java Runtime Environment (JRE)>>.
-
-==== Verify JDBC Type-4 Driver
-To display the version of the JDBC driver that is already installed on the client workstation:
+The Trafodion Command Interface (trafci) runs on Windows and Linux. Before installing trafci on the client workstation, 
+ensure that you've installed the JDBC Type-4 driver. See the <<jdbct4, Install JDBC Type-4 Driver>> chapter above.
 
-1.  Change the directory to the lib directory, which contains the JDBC driver JAR file:
-* On Windows, enter this command:
-+
-```
-cd jdbc-installation-directory\lib
-```
-+
-`_jdbc-installation-directory_` is the directory where you installed the JDBC driver.
-
-* On Linux, enter this command:
-+
-```
-cd jdbc-installation-directory/lib
-```
-+
-`_jdbc-installation-directory_` is the directory where you installed the JDBC driver.
-
-2.  Enter this command to return version information:
-+
-```
-java -jar jdbcT4.jar
-```
-+
-```
-C:\> cd "\<user-specified directory>\lib"
-C:\<user-specified directory>\lib> java -jar jdbcT4.jar
-Traf_JDBC_Type4_Build_40894
-
-C:\<user-specified directory>\lib>
-```
-
-If the JAR file is inaccessible or the returned version is not supported, see <<trafci_install_jdbct4, Install/Verify JDBC Type-4 Driver>>.
-
-<<<
 [[trafci_perl_python]]
 === Install Perl or Python
 
-If you plan to use Perl or Python scripts with TrafCI, verify that you have Perl or Python installed on the client workstation. TrafCI supports
+If you plan to use Perl or Python scripts with trafci, verify that you have Perl or Python installed on the client workstation. trafci supports
 these versions of Perl and Python:
 
 * Perl version 5.8.8
 * Python version 2.3.4
 
-If you do not have Perl or Python, download it from any open source software provider. You can perform this installation procedure anytime
-before or after installing TrafCI.
+If you do not have Perl or Python, download it from any open-source software provider. You can perform this installation procedure anytime
+before or after installing trafci.
 
-If you plan to run the sample scripts provided with TrafCI, verify that you have the Perl JavaServer and Jython (Java implementation of Python)
-installed on your client workstation. Use the TrafCI Installation Wizard to automatically download and install both the Perl JavaServer and
+If you plan to run the sample scripts provided with trafci, verify that you have the Perl JavaServer and Jython (Java implementation of Python)
+installed on your client workstation. Use the trafci Installation Wizard to automatically download and install both the Perl JavaServer and
 Jython open source extensions. To download them manually, see the `README` in the samples directory.
 
+<<<
+[[trafci-installation-instructions]]
 == Installation Instructions
 
-NOTE: Before following the installation procedures, you must install the Trafodion JDBC Type 4 Driver on the client workstation. For more
-information, see <<trafci_install_jdbct4, Install JDBC Type-4 Driver>>.
-
-Follow these instructions to download and install TrafCI on the client workstation.
-
-* <<trafci_download_installer, Download Installer>>
-* <<trafci_run_installer, Run Executable JAR Installer>>
-
-To uninstall TrafCI, see <<trafci_uninstall, Uninstall_TrafCI>>.
+You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
 
-[[trafci_download_installer]]
-=== Download Installer
+1.  Change the directory to the `clients` subdirectory.
 
-1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download/html
-3.  Click on the `clients-1.3.*_n_*.tar.gz` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `clients-1.3.*_n_*.tar.gz` file into the download folder.
-+
-<<<
-5.  Unpack the `clients-1.3.*_n_*.tar.gz` file.
-+
-```
-tar -xzf clients-1.3.0.tar.gz
-```
-+
-The package file contains the trafci.zip distribution file, which is extracted to the clients subdirectory.
-
-6.  Change the directory to the clients subdirectory.
-
-7.  Extract the contents of the `trafci.zip` file to a location on your client workstation by using the unzip command (or the WinZip extract
-tool):
+2.  Extract the contents of the `trafci.zip` file to a location on your client workstation (for example, a folder named `trafci`) by
+using the unzip command (or the extract function of your compression software):
 +
 ```
-unzip trafci.zip
+cd $HOME/trafodion-download/clients
+unzip trafci.zip -d trafci
+cd trafci
 ```
 +
 The command extracts these files:
@@ -158,22 +67,20 @@ The command extracts these files:
 * `README`
 * `trafciInstaller.jar`
 
-8.  Proceed with <<trafci_run_installer, Run Executable JAR Installer>>.
-
-[[trafci_run_installer]]
+[[trafci-run-installer]]
 === Run Executable JAR Installer
 
-When using the executable JAR file, trafciInstaller.jar, to install TrafCI, you have a choice of running the installer from the Installer
+When using the executable JAR file, `trafciInstaller.jar`, to install trafci, you have a choice of running the installer from the Installer
 Wizard Graphical User Interface (GUI) or from the command line:
 
-* <<trafci_wizard_install, Installer Wizard Steps>>
-* <<trafci_cmd_install, Command-Line Installation Steps>>
+* <<trafci-wizard-install, Installer Wizard Steps>>
+* <<trafci-cmd-install, Command-Line Installation Steps>>
 
-[[trafci_wizard_install]]
+[[trafci-wizard-install]]
 ==== Installer Wizard Steps
 
 NOTE: On Linux, to run the Installer Wizard, you must have the X Window system installed on the client workstation. If the client workstation
-does not have the X Window system, see <<trafci_cmd_install, Command-Line Installation Steps>>.
+does not have the X Window system, see <<trafci-cmd-install, Command-Line Installation Steps>>.
 
 <<<
 ===== Launching the Installer Wizard
@@ -181,7 +88,7 @@ does not have the X Window system, see <<trafci_cmd_install, Command-Line Instal
 1.  Locate the `trafciInstaller.jar` file in the folder where you extracted the contents of the distribution (`.zip`) file.
 2.  Verify that the `trafciInstaller.jar` file appears as an executable JAR File. If not, skip the next two steps and go to Step 5.
 3.  Double-click the `trafciInstaller.jar` file to launch the Installer Wizard.
-4.  Proceed to <<trafci_using_wizard, Using the Installer Wizard>>.
+4.  Proceed to <<trafci-using-wizard, Using the Installer Wizard>>.
 5.  At a command prompt, change to the directory where you extracted the installer files:
 +
 ```
@@ -196,25 +103,25 @@ cd installer-directory
 java -jar trafciInstaller.jar
 ```
 
-7.  Proceed to <<trafci_using_wizard, Using the Installer Wizard>>.
+7.  Proceed to <<trafci-using-wizard, Using the Installer Wizard>>.
 
-[[trafci_using_wizard]]
+[[trafci-using-wizard]]
 ===== Using the Installer Wizard
 
 When you execute `trafciInstaller.jar`, the Installer Wizard appears:
 
-image:{images}/InstallerWizardWelcome.jpg[image]
+image:{images}/InstallerWizardWelcome.jpg[trafci Installer Wizard welcome screen]
 
 1.  Click one of these buttons for the type of installation that you would like to perform:
-* *Standard Installation* to start the Installer Wizard, which guides you through installing both the core TrafCI components and the optional open
+* *Standard Installation* to start the Installer Wizard, which guides you through installing both the core trafci components and the optional open
 source extensions
-* *Core Components* for a quick installation of the core TrafCI files
-* *Optional Components* if you have already installed the core TrafCI files but want to install only the optional open source extensions
+* *Core Components* for a quick installation of the core trafci files
+* *Optional Components* if you have already installed the core trafci files but want to install only the optional open source extensions
 
 2.  After you have selected the components you wish to install, browse and select the JDBC JAR file and then specify an installation directory
-where you will install TrafCI.
+where you will install trafci.
 +
-image:{images}/InstallerWizardPaths.jpg[image]
+image:{images}/InstallerWizardPaths.jpg[trafci select path dialog]
 
 3.  To locate the JDBC driver JAR file, click *Browse* next to the *JDBC Type 4 Driver JAR File*.
 4.  In the *Select JDBC Type 4 Driver JAR File* dialog box, navigate to and select the lib folder of the Trafodion JDBC driver, and then click *Open*.
@@ -222,63 +129,74 @@ image:{images}/InstallerWizardPaths.jpg[image]
 +
 The Installer Wizard now displays the path of the JDBC driver JAR file.
 +
-image:{images}/JDBC_JAR_Path.jpg[image]
+image:{images}/JDBC_JAR_Path.jpg[trafci path to JDBC driver JAR file]
 6.  To install in the default location, proceed to Step 9. To install in your own preferred location, proceed to Step 7.
-7.  To find an installation location for TrafCI, click *Browse* next to the *Trafodion Command Interface* installation directory.
-8.  In the *Select Trafodion Command Interface Installation Directory* dialog box, select the folder where you want to install TrafCI so that
+
+7.  To find an installation location for trafci, click *Browse* next to the *Trafodion Command Interface* installation directory.
+8.  In the *Select Trafodion Command Interface Installation Directory* dialog box, select the folder where you want to install trafci so that
 the directory path appears in the *File Name* box, and then click *Select*.
 +
-The Installer Wizard displays the directory where TrafCI is installed.
+The Installer Wizard displays the directory where trafci is installed.
+
 9.  Click *Next* to review the open-source legal disclaimer.
 10.  If you agree to the terms and conditions, select the check box, and click *Next*.
 +
 The Installer Wizard dialog box shows which components are available for you to download and install.
 +
-image:{images}/OptionalComponents.jpg[image]
+image:{images}/OptionalComponents.jpg[trafci component selection]
 
 11.  Select the optional components to be downloaded and installed. Each optional component is installed if the component box is checked.
 +
 If you want to change the download URL for the extensions, click *Edit URL*, and this dialog box appears:
 +
-image:{images}/PerlJavaServerURL.jpg[image]
+image:{images}/PerlJavaServerURL.jpg[trafci edit download URL]
 +
 Type a new path, and click *OK*.
 +
 NOTE: Perl and Python must be installed for the respective extensions to work.
+
 12.  If you do not require a proxy server, proceed to Step 15.
 13.  If you require a proxy server, select *Use the following proxy settings* and enter the proxy server and port for downloading the open
 source extensions.
 +
-image:{images}/ProxySettings.jpg[image]
-14.  Click *Detect Proxy Server(s)* to try to auto-detect your proxy settings. If TrafCI detects one or more proxy servers, it displays
+image:{images}/ProxySettings.jpg[trafci proxy settings]
+14.  Click *Detect Proxy Server(s)* to try to auto-detect your proxy settings. If trafci detects one or more proxy servers, it displays
 them in a drop-down menu next to the *Detect Proxy Server(s)* button.
 15.  Click *Install* to start the installation.
 
-16.  After the core TrafCI files are installed, the *Installation Status* dialog box appears indicating how many files were extracted to the
+16.  After the core trafci files are installed, the *Installation Status* dialog box appears indicating how many files were extracted to the
 installation directory:
 +
-image:{images}/Extracted_Files.jpg[image]
+image:{images}/Extracted_Files.jpg[trafci extracted files]
 +
 Click *OK* to continue the installation.
 17.  If you chose to install the optional components, the installer attempts to download and install them. The progress bar indicates the
 download progress of each file. In addition, an installation log provides details about the status of the download and installation of
 the components.
 +
-image:{images}/InstallComplete.jpg[image]
-18.  After all TrafCI files are installed, the Installer Wizard completes.
+image:{images}/InstallComplete.jpg[trafci installation complete]
+18.  After all trafci files are installed, the Installer Wizard completes.
 19.  Click *Exit*.
 
 <<<
-[[trafci_cmd_install]]
+[[trafci-cmd-install]]
 ==== Command-Line Installation Steps
 
 1.  At a command prompt, change to the directory where you extracted the contents of the distribution (.zip) file:
 +
-====
-*cd _installer-directory_*
-====
+```
+cd installer-directory
+```
 +
 `_installer-directory_` is the directory where you extracted the installer files.
++
+*Example*
++
+```
+$ cd $HOME/trafodion-download/clients/trafci
+$ ls
+README  trafciInstaller.jar
+```
 
 2.  Before launching the command-line installer, see the command options below:
 +
@@ -331,7 +249,7 @@ JDBC Type 4 Driver JAR File
 --------------------------------
 Enter the location and file name:
 ```
-5.  Enter an existing directory where you would like to install TrafCI:
+5.  Enter an existing directory where you would like to install trafci:
 +
 ```
 Trafodion Command Interface
@@ -351,7 +269,10 @@ Do you want to install the optional components? [Y]:
 
 6.  If you do not wish to download and install the optional components, type *N* at the prompt and press Enter, and your installation
 is complete. Otherwise, type *Y*, press *Enter*, and proceed through the remainder of the installation.
-7.  Type *Y* and press *Enter* if you agree to the terms. If you are doing an optional install only, you are prompted to enter a valid TrafCI
++
+<<<
+
+7.  Type *Y* and press *Enter* if you agree to the terms. If you are doing an optional install only, you are prompted to enter a valid trafci
 installation directory:
 +
 ```
@@ -367,8 +288,8 @@ and proceed to Step 9.
 Use a proxy server? [N]:
 ```
 
-9.  When prompted to auto-detect proxy servers, type *Y* and press *Enter* to direct TrafCI to detect your proxy settings.
-If TrafCI finds proxy servers, it displays them. If you type *N* and press *Enter*, TrafCI prompts you to enter the proxy server and port:
+9.  When prompted to auto-detect proxy servers, type *Y* and press *Enter* to direct trafci to detect your proxy settings.
+If trafci finds proxy servers, it displays them. If you type *N* and press *Enter*, trafci prompts you to enter the proxy server and port:
 +
 ```
 Use a proxy server? [Y]: Y
@@ -414,17 +335,13 @@ Trafodion Command Interface Installation Complete.
 /home/myname/trafcitemp>
 ```
 
-[[trafci_uninstall]]
-=== Uninstall TrafCI
-
-If you used the executable JAR file, `trafciInstaller.jar`, to install TrafCI, delete the entire
-`Trafodion Command Interface` folder to uninstall TrafCI.
-
+<<<
+[[trafci-post-installation-instructions]]
 == Post-Installation Instructions
 
 === Verify Installed Software Files
 
-After downloading and running the installer file, verify that the TrafCI software files are installed in the correct locations:
+After downloading and running the installer file, verify that the trafci software files are installed in the correct locations:
 
 [cols="15%l,20%l,65%",options="header"]
 |===
@@ -452,22 +369,104 @@ http://trafodion.incubator.apache.com/docs/command_interface/index.html[_Trafodi
 |===
 
 <<<
-=== Test Launching TrafCI
+== Test Launching trafci
 
-Before launching TrafCI, make sure that you have set the Java path to the correct location. For more information, see:
+Before launching trafci, make sure that you have set the Java path to the correct location. For more information, see:
 
-* <<jdbct4_path_windows, Setting the PATH to a Supported >>
-* <<jdbct4_path_linux, Setting the PATH to a Supported Java Version on Linux>>
+* <<jdbct4-path-windows, Setting the PATH to a Supported Java Version on Windows>>
+* <<jdbct4-path-linux, Setting the PATH to a Supported Java Version on Linux>>
 
-If you did not set the Java path on your client workstation and you try to launch TrafCI, you might see the following error message appear
-momentarily in the TrafCI window before the TrafCI window disappears:
+If you did not set the Java path on your client workstation and you try to launch trafci, you might see the following error message appear
+momentarily in the trafci window before the trafci window disappears:
 
 ```
 'java' is not recognized as an internal or external command, operable program or batch file.
 ```
 
+For information about setting up and using trafci, such as choosing the look and feel of the interface or presetting launch parameters, see the
+http://trafodion.incubator.apache.com/docs/command_interface/index.html[Trafodion Command Interface Guide].
+
+<<<
+=== Windows Example
+
+On Windows, do the following:
+
+1. Go to the directory where you installed trafci. For example, `c:\Trafodion\Trafodion Command Interface`
+2. Go to the `bin` directory
+3. Invoke the `trafci.cmd` file.
+4. Answer prompts.
+
+```
+cd "c:\Trafodion\Trafodion Command Interface"
+cd bin
+trafci.cmd
+<screen is cleared>
+
+Welcome to Apache Trafodion Command Interface
+Copyright (c) 2015 Apache Software Foundation
+
+Host Name/IP Address: trafodion.host.com:23400
+User Name: usr
+Password:
+
+
+Connected to Trafodion
+
+SQL> show schemas ;
+
+Welcome to Apache Trafodion Command Interface
+Copyright (c) 2015 Apache Software Foundation
+
+Host Name/IP Address: 10.1.30.28:23400
+User Name: usr
+Password:
+
+
+Connected to Trafodion
+
+SQL>show schemas;
+
+SCHEMA NAMES
+--------------------------------------------------------------------------------
+SEABASE   _MD_      _REPOS_   _LIBMGR_
+
+SQL>
+```
+
+<<<
+=== Linux Example
+
+On Linux, do the following:
+
+1. Go to the directory where you installed trafci. For example, `$HOME/trafci`
+2. Go to the `bin` directory
+3. Invoke the `trafci.sh` file.
+4. Answer prompts.
+
+```
+$ cd $HOME/trafci/bin
+$ . ./trafci.sh -h trafodion.home.com:23400 -u usr -p pwd
+
+Welcome to Apache Trafodion Command Interface
+Copyright (c) 2015 Apache Software Foundation
+
+Connected to Trafodion
+
+SQL>show schemas;
+
+SCHEMA NAMES
+--------------------------------------------------------------------------------
+SEABASE   _MD_      _REPOS_   _LIBMGR_
+
+SQL>
+```
+
+<<<
+[[trafci-uninstall]]
+== Uninstall trafci
+
+If you used the executable JAR file, `trafciInstaller.jar`, to install trafci, delete the entire
+folder/directory when you installed trafci.
 
-For information about setting up the client, such as choosing the look and feel of the interface or presetting launch parameters, see the
-http://trafodion.incubator.apache.com/docs/command_interface/index.html[_Trafodion Command Interface Guide_].
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/index.adoc b/docs/client_install/src/asciidoc/index.adoc
index f59af1d..9dc187f 100644
--- a/docs/client_install/src/asciidoc/index.adoc
+++ b/docs/client_install/src/asciidoc/index.adoc
@@ -56,23 +56,26 @@ specific language governing permissions and limitations under the License.
 
 **Acknowledgements**
 
-Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation. Java® is a registered trademark of Oracle and/or its affiliates. DbVisualizer™ is a trademark of DbVis Software AB.
+Microsoft(R) and Windows® are U.S. registered trademarks of Microsoft Corporation. Java® is a registered trademark of Oracle and/or its affiliates. DbVisualizer™ is a trademark of DbVis Software AB.
+
+*Revision History*
 
 [cols="2",options="header"]
 |===
 | Version    | Date
+| 2.0.0      | To be announced.
 | 1.3.0      | January, 2016  
 |===
 
 include::asciidoc/_chapters/about.adoc[]
 include::asciidoc/_chapters/introduction.adoc[]
-include::asciidoc/_chapters/odbc_windows.adoc[]
-include::asciidoc/_chapters/odbc_linux.adoc[]
 include::asciidoc/_chapters/jdbct4.adoc[]
 include::asciidoc/_chapters/trafci.adoc[]
-include::asciidoc/_chapters/odb.adoc[]
 include::asciidoc/_chapters/dbviz.adoc[]
 include::asciidoc/_chapters/SQuirrel.adoc[]
+include::asciidoc/_chapters/odbc_linux.adoc[]
+include::asciidoc/_chapters/odb.adoc[]
+include::asciidoc/_chapters/odbc_windows.adoc[]
 
 = Appendix
 include::asciidoc/_chapters/sample_prog.adoc[]

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/images/win10_edit_path.jpg
----------------------------------------------------------------------
diff --git a/docs/client_install/src/images/win10_edit_path.jpg b/docs/client_install/src/images/win10_edit_path.jpg
new file mode 100644
index 0000000..ec9c8c6
Binary files /dev/null and b/docs/client_install/src/images/win10_edit_path.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/client_install/src/images/win10_select_java.jpg
----------------------------------------------------------------------
diff --git a/docs/client_install/src/images/win10_select_java.jpg b/docs/client_install/src/images/win10_select_java.jpg
new file mode 100644
index 0000000..a8e498a
Binary files /dev/null and b/docs/client_install/src/images/win10_select_java.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/about.adoc b/docs/command_interface/src/asciidoc/_chapters/about.adoc
index 6b4f1c6..dccb28f 100644
--- a/docs/command_interface/src/asciidoc/_chapters/about.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/about.adoc
@@ -24,8 +24,8 @@
 ////
 
 = About This Document
-This guide describes how to use the Trafodion Command Interface (TrafCI) on a client workstation to connect to and query a Trafodion database.
-The TrafCI enables you to run SQL statements interactively or from script files.
+This guide describes how to use the Trafodion Command Interface (trafci) on a client workstation to connect to and query a Trafodion database.
+The trafci enables you to run SQL statements interactively or from script files.
 
 == Intended Audience
 This guide is intended for database administrators and support personnel who are maintaining and monitoring a Trafodion database.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/commands.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/commands.adoc b/docs/command_interface/src/asciidoc/_chapters/commands.adoc
index cf568bd..5dbfa7f 100644
--- a/docs/command_interface/src/asciidoc/_chapters/commands.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/commands.adoc
@@ -537,7 +537,7 @@ LOG OPTIONS      APPEND,CMDTEXT ON
 MARKUP           RAW
 PROMPT           SQL>
 SCHEMA           SEABASE
-SERVER           sqws135.houston.host.com:37800 
+SERVER           sqws135.houston.host.com:23400 
 SQLTERMINATOR    ;
 STATISTICS       OFF
 TIME             OFF
@@ -561,7 +561,7 @@ LOG              OFF
 MARKUP           RAW
 PROMPT           SQL>
 SCHEMA           SEABASE
-SERVER           sqws135.houston.host.com:37800 
+SERVER           sqws135.houston.host.com:23400 
 SQLTERMINATOR    ;
 STATISTICS       OFF
 TIME             OFF
@@ -3872,7 +3872,7 @@ LOG OPTIONS        APPEND,CMDTEXT ON
 MARKUP             RAW
 PROMPT             SQL> 
 SCHEMA             SEABASE
-SERVER             sqws135.houston.host.com:37800 
+SERVER             sqws135.houston.host.com:23400 
 SQLTERMINATOR      ;
 STATISTICS         OFF
 TIME               OFF
@@ -3893,7 +3893,7 @@ LOG                OFF
 MARKUP             RAW
 PROMPT             SQL> 
 SCHEMA             SEABASE
-SERVER             sqws135.houston.host.com:37800 
+SERVER             sqws135.houston.host.com:23400 
 SQLTERMINATOR      ;
 STATISTICS         OFF
 TIME               OFF

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/install.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/install.adoc b/docs/command_interface/src/asciidoc/_chapters/install.adoc
index f755c90..6251908 100644
--- a/docs/command_interface/src/asciidoc/_chapters/install.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/install.adoc
@@ -26,74 +26,24 @@
 [[install]]
 = Install and Configure
 
-== Install TrafCI
-To install TrafCI on a client workstation, follow the procedures in the 
-http://trafodion.incubator.apache.org/docs/client_install/index.html[_Trafodion Client Installation Guide_].
+== Install trafci
+To install trafci on a client workstation, follow the procedures in the 
+http://trafodion.incubator.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide].
+Ensure that you set up the Java Path per the instructions in that guide.
 
-[[install_verify]]
-== Verify and Set the Java Path
-=== Set PATH on Windows
-
-1.  Right-click the *Computer* icon on your desktop, and then select *Properties*. 
-The *Control Panel>System and Security>System* window appears.
-2.  In the left navigation bar, click the *Advanced* system settings link.
-3.  In the *System Properties* dialog box, click the *Environment Variables* button.
-4.  Under _System variables_, select the variable named *Path*, and then click *Edit*:
-+
-image:{images}/path2.jpg[image]
-
-5.  Place the cursor at the beginning of the _Variable_ value field and enter the path of the Java
-`bin` directory, ending with a semicolon (`;`):
-+
-image:{images}/varval2.jpg[image]
-+
-```
-"C:\Program Files (x86)\Java\jre7\bin";
-```
-+
-NOTE: Check that no space exists after the semicolon (;) in the path. If there are spaces in the directory name, delimit the entire directory
-path in double quotes (") before the semicolon.
-
-6.  Click *OK*.
-7.  Verify that the updated Path appears under _System variables_, and click OK.
-8.  In the *System Properties* dialog box, click *OK* to accept the changes.
-
-=== Set PATH on Linux
-1.  Open the user profile (`.profile` or `.bash_profile` for the Bash shell) in the `$HOME` directory.
-+
-```
-vi .profile
-```
-
-2.  In the user profile, set the `PATH` environment variable to include path of the Java bin
-directory. 
-+
-```
-export PATH=/opt/java1.7/jre/bin:$PATH
-```
-+
-NOTE: Place the path of the Java bin directory before `$PATH`, and check that no space exists after the colon (`:`) in the path. 
-In the C shell, use the `setenv` command instead of export.
-
-3.  To activate the changes, either log out and log in again or execute the user profile.
-+
-```
-. .profile
-```
-
-== Test TrafCI Launch
-1.  Launch TrafCI and verify that you can connect to the database. For
-instructions, see <<launch_trafci, Launch TrafCI>>.
+== Test trafci Launch
+1.  Launch trafci and verify that you can connect to the database. For
+instructions, see <<launch_trafci, Launch trafci>>.
 +
 This window should appear:
 +
 image:{images}/launch02.jpg[image]
 
-2.  If you cannot launch TrafCI or connect to the database, verify that:
+2.  If you cannot launch trafci or connect to the database, verify that:
 +
 * The database platform is available and running, and the port number is correct for the database platform.
 * The Java path is set to the correct location. See <<install_verify, Verify and Set the Java Path>>.
-* You installed the TrafCI and JDBC software files correctly. 
+* You installed the trafci and JDBC software files correctly. 
 
-See the http://trafodion.incubator.apache.org/docs/latest/client_install/index.html[_Trafodion Client Installation Guide_].
+See the http://trafodion.incubator.apache.org/docs/latest/client_install/index.html[Trafodion Client Installation Guide].
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/interactive.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/interactive.adoc b/docs/command_interface/src/asciidoc/_chapters/interactive.adoc
index ac5abcc..9e73208 100644
--- a/docs/command_interface/src/asciidoc/_chapters/interactive.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/interactive.adoc
@@ -24,13 +24,13 @@
 ////
 
 = Run Commands Interactively
-After launching TrafCI, you can run SQL statements and interface commands in the command-line interface.
+After launching trafci, you can run SQL statements and interface commands in the command-line interface.
 
 == User Interface
 
 === Product Banner
 
-After you launch TrafCI and connect to the database platform, the product banner appears in the
+After you launch trafci and connect to the database platform, the product banner appears in the
 command-line interface:
 
 image:{images}/launch02.jpg[Product banner]
@@ -68,7 +68,7 @@ for parts that you enclose in single-quotes (`'`) or double-quotes (`"`).
 <<<
 == Interface Commands
 
-The interface commands allow you to customize TrafCI (for example, by using `SET` commands) or 
+The interface commands allow you to customize trafci (for example, by using `SET` commands) or 
 return information about the interface settings or database objects (for example, 
 by using `SHOW commands`).
 
@@ -79,7 +79,7 @@ command across more than one line, enter the SQL terminator and then reenter the
 
 === Show Session Attributes
 
-To display the attributes and settings of the current TrafCI session, use the `ENV`, `SHOW SESSION`, 
+To display the attributes and settings of the current trafci session, use the `ENV`, `SHOW SESSION`, 
 or `SESSION` command. 
 
 *Example*
@@ -98,7 +98,7 @@ LOG OPTIONS      APPEND,CMDTEXT ON
 MARKUP           RAW
 PROMPT           SQL>
 SCHEMA           SEABASE
-SERVER           sqws135.houston.host.com:37800 
+SERVER           sqws135.houston.host.com:23400 
 SQLTERMINATOR    ;
 STATISTICS       OFF
 TIME             OFF
@@ -233,7 +233,7 @@ the <<cmd_show_sqlterminator, SHOW SQLTERMINATOR Command>>.
 [[interactive_display_elapsed_time]]
 === Display the Elapsed Time
 
-By default, TrafCI does not display the elapsed time of an SQL statement after the statement 
+By default, trafci does not display the elapsed time of an SQL statement after the statement 
 executes. To display the elapsed time after each SQL statement executes, enter the `SET TIMING ON` 
 command:
 
@@ -274,7 +274,7 @@ For more information, see the <<cmd_set_timing, SET TIMING Command>>.
 === Set and Show the Current Schema
 
 By default, the schema of the session is `USR`. The SQL statement, `SET SCHEMA`, 
-allows you to set the schema for the TrafCI session. 
+allows you to set the schema for the trafci session. 
 
 *Example*
 
@@ -352,7 +352,7 @@ For more information, see the <<cmd_set_list_count, SET LIST_COUNT Command>> and
 [[interactive_history]]
 === Display Executed Commands
 
-To display commands that were recently executed in the TrafCI session, enter the 
+To display commands that were recently executed in the trafci session, enter the 
 `HISTORY` command. The `HISTORY` command associates each command with a number that 
 you can use to re-execute or edit the command with the `FC` command. See 
 <<edit_reexecute_command, Edit and Reexecute a Command>>.
@@ -376,7 +376,7 @@ To save the session history in a user-specified file, enter the `SAVEHIST` comma
 *Example*
 
 This `SAVEHIST` command saves the session history in a file named `history.txt` in the 
-local directory where you are running TrafCI:
+local directory where you are running trafci:
 
 ```
 SQL> SAVEHIST history.txt
@@ -389,7 +389,7 @@ the <<cmd_savehist, SAVEHIST Command>>.
 [[edit_reexecute_command]]
 === Edit and Reexecute a Command
 
-To edit and reexecute a command in the history buffer of an TrafCI session, enter the `FC` command. 
+To edit and reexecute a command in the history buffer of an trafci session, enter the `FC` command. 
 To display the commands in the history buffer, use the `HISTORY` command. See 
 <<interactive_history, Display Executed Commands>>.
 
@@ -412,7 +412,7 @@ Pressing Enter executes the corrected `SELECT` statement. For more information,
 <<<
 === Clear the Interface Window
 
-After entering commands in TrafCI, you can clear the interface window by using the `CLEAR` command. 
+After entering commands in trafci, you can clear the interface window by using the `CLEAR` command. 
 
 *Example*
 
@@ -427,7 +427,7 @@ For more information, see the <<cmd_clear, CLEAR Command>>.
 
 === Obtain Help
 
-To display help text for an interface command that is supported in TrafCI, enter the `HELP` command. 
+To display help text for an interface command that is supported in trafci, enter the `HELP` command. 
 
 *Example*
 
@@ -442,19 +442,19 @@ For more information, see the <<cmd_help, HELP Command>>.
 <<<
 == Run SQL Statements
 
-In TrafCI, you can run SQL statements interactively. TrafCI supports all the SQL statements, 
+In trafci, you can run SQL statements interactively. trafci supports all the SQL statements, 
 SQL utilities, and other SQL-related commands that the Trafodion database engine supports. 
 For more information about those SQL statements, see the 
 http://trafodion.incubator.apache.org/docs/sql_reference/index.html[_Trafodion SQL Reference Manual_].
 
-To run SQL statements from script files in TrafCI, see <<run_scripts, Run Scripts>>.
+To run SQL statements from script files in trafci, see <<run_scripts, Run Scripts>>.
 
 === Execute an SQL Statement
 
 *Example*
 
 You can query the `EMPLOYEE` table and return an employee’s salary by executing this `SELECT` statement 
-in TrafCI:
+in trafci:
 
 ```
 SQL> SELECT salary
@@ -480,9 +480,9 @@ SALARY
 SQL>
 ```
 
-If the SQL statement executes successfully, TrafCI returns a message indicating that the SQL 
+If the SQL statement executes successfully, trafci returns a message indicating that the SQL 
 operation was successful, followed by the standard prompt. If a problem occurs during the 
-execution of the SQL statement, TrafCI returns an error message.
+execution of the SQL statement, trafci returns an error message.
 
 <<<
 === Repeat an SQL Statement
@@ -587,7 +587,7 @@ http://trafodion.incubator.apache.org/docs/sql_reference/index.html[_Trafodion S
 
 [[interactive_set_parameters]]
 ==== Setting Parameters
-In an TrafCI session, you can set a parameter of an SQL statement (either prepared or not) 
+In an trafci session, you can set a parameter of an SQL statement (either prepared or not) 
 by using the SET PARAM command.
 
 NOTE: The parameter name is case-sensitive. If you specify it in lowercase in the 
@@ -793,7 +793,7 @@ http://trafodion.incubator.apache.org/docs/sql_reference/index.html[_Trafodion S
 [[interactive_log_output]]
 == Log Output
 
-To log an TrafCI session, use the `SPOOL` or `LOG` command. The `SPOOL` and `LOG` commands 
+To log an trafci session, use the `SPOOL` or `LOG` command. The `SPOOL` and `LOG` commands 
 record into a log file the commands that you enter in the command-line interface and the 
 output of those commands.
 
@@ -811,7 +811,7 @@ the <<cmd_spool, SPOOL Command>>.
 ==== `SPOOL ON` or `LOG ON` Command
 
 The `SPOOL ON` or `LOG ON` command logs information about a session in the `sqlspool.lst`
-file, which TrafCI stores in the bin directory:
+file, which trafci stores in the bin directory:
 
 * On Windows:
 +
@@ -820,7 +820,7 @@ file, which TrafCI stores in the bin directory:
 ```
 +
 `_trafci-installation-directory_` is the directory where you installed the
-TrafCI software files.
+trafci software files.
 
 * On Linux:
 +
@@ -829,7 +829,7 @@ TrafCI software files.
 ```
 +
 `_trafci-installation-directory_` is the directory where you installed
-the TrafCI software files.
+the trafci software files.
 
 *Example*
 
@@ -844,7 +844,7 @@ SQL> SPOOL ON
 The `SPOOL _log-file_` and `LOG _log-file_` commands record information about a session 
 in a log file that you specify. If you specify a directory for the log file, the 
 directory must exist as specified. Otherwise, an error occurs when you try to run the 
-`SPOOL` or `LOG` command. If you do not specify a directory for the log file, TrafCI uses the 
+`SPOOL` or `LOG` command. If you do not specify a directory for the log file, trafci uses the 
 `bin` directory.
 
 *Example*
@@ -860,7 +860,7 @@ SQL> SPOOL C:\log\persnl_updates.log
 ==== Using the `CLEAR` Option
 
 The CLEAR option clears the contents of an existing log file before logging new information to 
-the file. If you omit CLEAR, TrafCI appends new information to existing information in the log file.
+the file. If you omit CLEAR, trafci appends new information to existing information in the log file.
 
 *Example*
 
@@ -871,9 +871,9 @@ starts logging the session in the log file:
 SQL> SPOOL C:\log\persnl_updates.log clear
 ```
 
-==== Log Concurrent the TrafCI Sessions
+==== Log Concurrent the trafci Sessions
 
-If you plan to run two or more TrafCI sessions concurrently on the same workstation, use the 
+If you plan to run two or more trafci sessions concurrently on the same workstation, use the 
 `SPOOL _log-file_` or `LOG _log-file_` command and specify a unique name for each log file. 
 Otherwise, each session writes information to the same log file, making it difficult to determine 
 which information belongs to each session.
@@ -887,7 +887,7 @@ To stop logging, enter one of these commands:
 
 *Example*
 
-This SPOOL OFF command stops logging in an TrafCI session:
+This SPOOL OFF command stops logging in an trafci session:
 
 ```
 SQL> SPOOL OFF
@@ -896,7 +896,7 @@ SQL> SPOOL OFF
 <<<
 === View the Contents of a Log File
 
-The log file is an ASCII text file that contains all the lines in TrafCI from the time you start 
+The log file is an ASCII text file that contains all the lines in trafci from the time you start 
 logging to the time you stop logging. The logged lines include prompts, entered commands, 
 output from commands, and diagnostic messages.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/introduction.adoc b/docs/command_interface/src/asciidoc/_chapters/introduction.adoc
index ef489cd..a54532b 100644
--- a/docs/command_interface/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/introduction.adoc
@@ -21,14 +21,14 @@
 ////
 
 = Introduction
-The Trafodion Command Interface (TrafCI) is a command-line interface that you download and install on a client workstation that has the
+The Trafodion Command Interface (trafci) is a command-line interface that you download and install on a client workstation that has the
 Trafodion JDBC Type 4 Driver installed. Operating systems that support the JDBC driver include Windows and Linux. The JDBC driver connects
-TrafCI on a client workstation to a Trafodion database.
+trafci on a client workstation to a Trafodion database.
 
-image:{images}/VST101.jpg["TrafCI Connected to a Trafodion Database"]
+image:{images}/VST101.jpg["trafci Connected to a Trafodion Database"]
 
-TrafCI enables you to perform daily administrative and database management tasks by running SQL statements or other commands
-interactively or from script files. You can also run TrafCI from a Perl or Python command line or from Perl or Python programs.
+trafci enables you to perform daily administrative and database management tasks by running SQL statements or other commands
+interactively or from script files. You can also run trafci from a Perl or Python command line or from Perl or Python programs.
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/launch.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/launch.adoc b/docs/command_interface/src/asciidoc/_chapters/launch.adoc
index b59916c..1aa42ee 100644
--- a/docs/command_interface/src/asciidoc/_chapters/launch.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/launch.adoc
@@ -23,15 +23,15 @@
   */
 ////
 
-= Launch TrafCI
+= Launch trafci
 
-This chapter describes how to launch TrafCI from the Window or Linux environment of a client workstation. 
-For information about launching TrafCI from Perl or Python, see <<perl_python, Run TrafCI from Perl or Python>>.
+This chapter describes how to launch trafci from the Window or Linux environment of a client workstation. 
+For information about launching trafci from Perl or Python, see <<perl_python, Run trafci from Perl or Python>>.
 
-IMPORTANT: Before launching TrafCI, make sure that you have set the Java path to the correct location.
+IMPORTANT: Before launching trafci, make sure that you have set the Java path to the correct location.
 See <<install_verify, Verify and Set Java Path>>.
 
-== Launch TrafCI on Windows Workstation
+== Launch trafci on Windows Workstation
 
 1.  Find the Windows launch file, `trafci.cmd`, in the `bin` folder:
 +
@@ -39,13 +39,13 @@ image:{images}/winbin.jpg[width=400,height=400,alt="Navigate to bin folder"]
 
 2.  Double-click the `trafci.cmd` file.
 +
-TrafCI appears, prompting you to enter the host name or IP address of the database platform, your user name, and password.
+trafci appears, prompting you to enter the host name or IP address of the database platform, your user name, and password.
 See <<trafci_login, Log In to Database Platform>>.
 
 <<<
 [[trafci_shortcut]]
 === Create `trafci.cmd` Shortcut
-To enable a user to launch TrafCI from a shortcut icon on the desktop:
+To enable a user to launch trafci from a shortcut icon on the desktop:
 
 1.  Right-click the desktop and select *New>Shortcut*:
 +
@@ -57,7 +57,7 @@ image:{images}/shortct1.jpg[width=400,height=400,alt="Select trafci.cmd file"]
 +
 image:{images}/shortct2.jpg[width=400,height=400,alt="Select shortcut from menu"]
 +
-For the locations of the installed TrafCI software files,
+For the locations of the installed trafci software files,
 see the http://trafodion.incubator.apache.org/docs/client_install/latest/index.html[_Trafodion Client Installation Guide_].
 
 3.  Type a name for the shortcut and click *Finish*:
@@ -80,14 +80,14 @@ image:{images}/shortct5.jpg[width=400,height=400,alt="Add optional launch parame
 For more information, see <<trafci_optional_params, Optional Launch Parameters>>.
   d.  Click *OK*.
 
-5.  To launch TrafCI, double-click the shortcut icon.
+5.  To launch trafci, double-click the shortcut icon.
 +
-TrafCI appears. If you did not set the optional launch parameters, TrafCI prompts you to enter the
+trafci appears. If you did not set the optional launch parameters, trafci prompts you to enter the
 host name or IP address of the database platform, your user name, and password.
 See <<trafci_login, Log In to Database Platform>>.
 
 <<<
-== Launch TrafCI on Linux Workstation
+== Launch trafci on Linux Workstation
 
 In the terminal window, enter:
 
@@ -95,13 +95,13 @@ In the terminal window, enter:
 ./<trafci-installation-directory>/trafci/bin/trafci.sh
 ```
 
-_<trafci-installation-directory>_ is the directory where you installed the TrafCI software files.
+_<trafci-installation-directory>_ is the directory where you installed the trafci software files.
 For more information,
 see the http://trafodion.incubator.apache.org/docs/latest/client_install/index.html[_Trafodion Client Installation Guide_].
 
 === Set `trafci.sh` PATH
 
-To enable a user to launch TrafCI anywhere on the client workstation:
+To enable a user to launch trafci anywhere on the client workstation:
 
 1.  Open the user profile (`.profile` or `.bash_profile` for the Bash shell) in the
 `$HOME` directory.
@@ -117,7 +117,7 @@ vi .profile
 export PATH=/<trafci-installation-directory>/trafci/bin/: ...
 ```
 +
-_trafci-installation-directory_ is the directory where you installed the TrafCI software files.
+_trafci-installation-directory_ is the directory where you installed the trafci software files.
 For more information, 
 see the http://trafodion.incubator.apache.org/docs/latest/client_install/index.html[_Trafodion Client Installation Guide_].
 Check that no space is after the colon (`:`) in the path.
@@ -132,16 +132,16 @@ NOTE: In the C shell, use the `setenv` command instead of `export`.
 +
 <<<
 
-4.  On the command line, execute the `trafci.sh` file to launch TrafCI:
+4.  On the command line, execute the `trafci.sh` file to launch trafci:
 +
 ```
 trafci.sh
 ```
 +
-TrafCI appears, prompting you to enter the host name or IP address of the database platform, your user name, and password.
+trafci appears, prompting you to enter the host name or IP address of the database platform, your user name, and password.
 See <<trafci_login, Log In to Database Platform>>.
 +
-NOTE: To enable all users to launch TrafCI anywhere on the system, create a symbolic link to the
+NOTE: To enable all users to launch trafci anywhere on the system, create a symbolic link to the
 `trafci.sh` file in the `/usr/bin` or `/usr/local/bin` directory:
 +
 ```
@@ -154,7 +154,7 @@ ln -s ./<trafci-installation-directory>/trafci/bin/trafci.sh /usr/bin/trafci.sh
 To preset the optional launch parameters for each session, use an `alias` in the shell command.
 
 ```
-alias trafci='trafci.sh -h 16.123.456.78:37800 -u user1 -p xxxxxx'
+alias trafci='trafci.sh -h 16.123.456.78:23400 -u user1 -p xxxxxx'
 ```
 
 You can add the alias, trafci, to the user profile, or you can enter it at a command prompt.
@@ -167,9 +167,9 @@ see <<trafci_optional_params, Use Optional Launch Parameters>>.
 
 === Log In Without Login Parameters
 
-If you launch TrafCI and do not specify login parameters on the command line, follow these steps:
+If you launch trafci and do not specify login parameters on the command line, follow these steps:
 
-1.  After you launch TrafCI, TrafCI shows the welcome banner and prompts you to enter the host name
+1.  After you launch trafci, trafci shows the welcome banner and prompts you to enter the host name
 or IP address of the database platform:
 +
 ```
@@ -182,8 +182,8 @@ Enter a host name:
 host-name[.domain-name][:port-number]
 ```
 +
-* If you do not specify the domain name, TrafCI uses the domain of the client workstation.
-* If you do not specify a port number, TrafCI uses the default port umber, which is `37800`.
+* If you do not specify the domain name, trafci uses the domain of the client workstation.
+* If you do not specify a port number, trafci uses the default port umber, which is `23400`.
 +
 Or enter an IP address:
 +
@@ -202,15 +202,15 @@ SQL>
 ```
 
 At the prompt, you can enter an SQL statement or an interface command.
-For more information, see <<run_interactive, Run Interactive Commands in TrafCI>>.
+For more information, see <<run_interactive, Run Interactive Commands in trafci>>.
 
-NOTE: TrafCI allows you to reenter the login values, with a maximum of three retries,
+NOTE: trafci allows you to reenter the login values, with a maximum of three retries,
 before it closes the session. For more information, see <<trafci_retry, Retry Login>>.
 
 [[trafci_login_params]]
 === Use Login Parameters
 
-To avoid entering a host name, user name, or password each time you launch TrafCI, use these login parameters:
+To avoid entering a host name, user name, or password each time you launch trafci, use these login parameters:
 
 * `-h` or `-host`
 * `-u` or `-user`
@@ -221,17 +221,17 @@ To avoid entering a host name, user name, or password each time you launch TrafC
 ```
 cd <trafci-installation-directory>\Trafodion Command Interface\bin
 
-trafci.cmd -h 16.123.456.78:37800 -u user1 -p xxxxxx
+trafci.cmd -h 16.123.456.78:23400 -u user1 -p xxxxxx
 ```
 
 *Example: Linux Login*
 ```
 cd <trafci-installation-directory>/trafci/bin
 
-./trafci.sh -h 16.123.456.78:37800 -u user1 -p xxxxxx
+./trafci.sh -h 16.123.456.78:23400 -u user1 -p xxxxxx
 ```
 
-TrafCI launches and prompts you to enter an SQL statement or an interface command:
+trafci launches and prompts you to enter an SQL statement or an interface command:
 
 ```
 Welcome to Trafodion Command Interface
@@ -252,11 +252,11 @@ TIP: You can include these parameters in a shortcut to the `trafci.cmd` file or
 [[trafci_retry]]
 == Retry Login
 
-TrafCI allows you to reenter the login values, with a maximum of three retries, before it closes the session.
+trafci allows you to reenter the login values, with a maximum of three retries, before it closes the session.
 
-TrafCI applies the retry logic as follows:
+trafci applies the retry logic as follows:
 
-* If you specify an invalid host name, TrafCI prompts you to reenter the host name.
+* If you specify an invalid host name, trafci prompts you to reenter the host name.
 +
 *Example*
 +
@@ -278,10 +278,10 @@ Connected to Trafodion SQL>
 ```
 
 <<<
-* If you specify an invalid user name or password, TrafCI prompts you to reenter the user name
+* If you specify an invalid user name or password, trafci prompts you to reenter the user name
 and password.
 +
-If you specify an invalid password, TrafCI prompts only for your user name and password.
+If you specify an invalid password, trafci prompts only for your user name and password.
 After three unsuccessful retries, the session is terminated:
 +
 *Example*
@@ -308,14 +308,14 @@ Press any key to close this session
 ```
 
 <<<
-* If all the login parameters that you specify are invalid, TrafCI prompts you to enter the host
-name. When you enter a valid host name or IP address, TrafCI prompts you to enter a user name and password.
+* If all the login parameters that you specify are invalid, trafci prompts you to enter the host
+name. When you enter a valid host name or IP address, trafci prompts you to enter a user name and password.
 
 * The retry logic applies to the CONNECT and RECONNECT commands. For the RECONNECT command, the retry logic
 applies only when no prior connection has been established (`-noconnect`).
 +
 For example, if you specify the CONNECT command with a valid user name and host name, then
-TrafCI prompts for the user name and password only.
+trafci prompts for the user name and password only.
 +
 ```
 SQL> connect user1/xxx@172.16.1.1
@@ -329,19 +329,19 @@ Connected to Trafodion SQL>
 ```
 
 
-* TrafCI does not prompt you to reenter the login values in these cases:
+* trafci does not prompt you to reenter the login values in these cases:
 * When you include the `-q` or `-version` parameter on the command line.
 (The `-s` parameter permits login retries.)
 ** For a session started using redirected or piped input.
 
-In these cases, TrafCI returns an error message and closes the session. You must re-launch the TrafCI session
+In these cases, trafci returns an error message and closes the session. You must re-launch the trafci session
 to connect to the Trafodion database.
 
 <<<
 [[trafci_option_params]]
 == Optional Launch Parameters
 
-To customize how you launch and log in to TrafCI, use the optional parameters described in the table below on the command line:
+To customize how you launch and log in to trafci, use the optional parameters described in the table below on the command line:
 
 ```
 trafci{.sh | .cmd} [optional-parameter]...
@@ -358,8 +358,8 @@ is one of the launch or login parameters. For details, see the following table.
 `{-h \| -host} IP-address[:port-number]`          | Specifies the host name or IP address of the database 
 platform to which you want the client to connect. 
 The _host-name_ should include the domain name of the database platform if it is different from the domain
-of the client workstation. If you do not specify a port number, TrafCI uses the default port number, which 
-is `37800`. +
+of the client workstation. If you do not specify a port number, trafci uses the default port number, which 
+is `23400`. +
  +
 See <<trafici_login_parameters, Use Login Parameters>>.
 
@@ -376,39 +376,39 @@ platform. _password_ is case-sensitive. +
 For an example, see <<trafici_login_parameters, Use Login Parameters>>.
 
 | `{-q \| -sql} "_command_"`                       | Specifies that an SQL statement or an interface command be run when
-launching TrafCI. You cannot specify this parameter at the same time as
+launching trafci. You cannot specify this parameter at the same time as
 the -s or -script parameter. +
  +
-For more information, see <<trafci_run_command, Run Command When Launching TrafCI>>.
+For more information, see <<trafci_run_command, Run Command When Launching trafci>>.
 
-| `{-s \| -script} _script-file-name_`             | Specifies that a script file be run when launching TrafCI in interactive
+| `{-s \| -script} _script-file-name_`             | Specifies that a script file be run when launching trafci in interactive
 mode. You cannot specify this parameter at the same time as the -q or
 -sql parameter. +
  +
-For more information, see <<trafci_run_script, Run Script When Launching TrafCI>>.
+For more information, see <<trafci_run_script, Run Script When Launching trafci>>.
 
-| `-noconnect`                                     | Launches an TrafCI session without connecting to the database. +
+| `-noconnect`                                     | Launches an trafci session without connecting to the database. +
  +
-For more information, see <<trafci_noconnect, Launch TrafCI Without Connecting to the Database>>.
+For more information, see <<trafci_noconnect, Launch trafci Without Connecting to the Database>>.
 
-| `-version`                                       | Displays the build version of TrafCI and the Trafodion JDBC Type 4
+| `-version`                                       | Displays the build version of trafci and the Trafodion JDBC Type 4
 Driver. Upon completion of the display, the client exits. +
  +
 If any other parameters are included with the `-version` parameter, they are ignored. +
  +
-For more information, see <<trafci_with_version, Run TrafCI With `-version`>>.
+For more information, see <<trafci_with_version, Run trafci With `-version`>>.
 | `-help`                                          | Displays a list of accepted arguments with descriptions and then exits. +
  +
-For more information, see <<trafci_with_version, Run TrafCI With `-version`>>.
+For more information, see <<trafci_with_version, Run trafci With `-version`>>.
 |===	 
 
 <<<
 [[trafci_run_command]]
-== Run Command When Launching TrafCI
+== Run Command When Launching trafci
 
-To execute an SQL statement or an interface command when launching TrafCI, use the `-q` or `-sql` 
+To execute an SQL statement or an interface command when launching trafci, use the `-q` or `-sql` 
 command-line parameter. This parameter enables you to run a single command on the command line 
-without having to enter commands in TrafCI.
+without having to enter commands in trafci.
 
 NOTE: You cannot specify this parameter at the same time as the `-s` or `-script` parameter.
 
@@ -420,7 +420,7 @@ Although you can run any of the interface commands with `-q` or `-sql`, the
 
 *Example*
 
-Use `-q` or `-sql` with the `CREATE SCHEMA` statement to create a schema when launching TrafCI:
+Use `-q` or `-sql` with the `CREATE SCHEMA` statement to create a schema when launching trafci:
 
 * On Windows, in the *Command Prompt* window, enter:
 +
@@ -436,12 +436,12 @@ cd _trafci-installation-directory_/trafci/bin
 ./trafci.sh -q "create schema persnl"
 ```
 
-After you enter the SQL statement, TrafCI launches and prompts you to log in by default
+After you enter the SQL statement, trafci launches and prompts you to log in by default
 (if you did not specify `-h`, `-u`, and `-p` on the command line), runs the SQL statement,
 and then returns to the command prompt:
 
 ```
-Host Name/IP Address: 16.123.456.78:37800 User Name: user1
+Host Name/IP Address: 16.123.456.78:23400 User Name: user1
 
 Password:
 
@@ -469,28 +469,28 @@ cd <trafci-installation-directory>/trafci/bin
 ./trafci.sh -q "prun"
 ```
 
-After you enter the interface command, TrafCI launches and prompts you to log in by default (if you did not specify
+After you enter the interface command, trafci launches and prompts you to log in by default (if you did not specify
 `-h`, `-u`, and `-p` on the command line), and runs the command.\ The parallel run (`PRUN`) operation prompts you to
-enter settings and then executes the script files. At the end of the `PRUN` operation, TrafCI returns to the command prompt.
+enter settings and then executes the script files. At the end of the `PRUN` operation, trafci returns to the command prompt.
 
 For more information about the `PRUN` operation, see <<trafci_prun, `PRUN` Command>>.
 
 <<<
 [[trafci_run_script]]
-== Run Script When Launching TrafCI
+== Run Script When Launching trafci
 
-To run a script file when launching TrafCI, use the `-s` or `-script` command-line parameter.
+To run a script file when launching trafci, use the `-s` or `-script` command-line parameter.
 
 NOTE: You cannot specify this parameter at the same time as the `-q` or `-sql` parameter.
 
-After you launch TrafCI with `-s` or `-script`, TrafCI executes the script file in interactive mode.
-TrafCI remains open until you enter the `EXIT`, `QUIT`, or `DISCONNECT` command. To quit the interface
+After you launch trafci with `-s` or `-script`, trafci executes the script file in interactive mode.
+trafci remains open until you enter the `EXIT`, `QUIT`, or `DISCONNECT` command. To quit the interface
 immediately after executing a script file, include the `EXIT`, `QUIT`, or `DISCONNECT` command
 at the end of the script file.
 
 *Example*
 
-You can create a script file that contains `SET` commands that customize a session when you launch TrafCI:
+You can create a script file that contains `SET` commands that customize a session when you launch trafci:
 
 image:{images}/launchs1.jpg[image]
 
@@ -517,14 +517,14 @@ cd <trafci-installation-directory>/trafci/bin +
 Specify the full path of the script file if it is outside the directory of `trafci.sh`.
 
 <<<
-TrafCI launches and prompts you to log in by default (if you did not specify `-h`, `-u`, and `-p`
+trafci launches and prompts you to log in by default (if you did not specify `-h`, `-u`, and `-p`
 on the command line), and runs the commands in the script file:
 
 ```
 Welcome to Trafodion Command Interface
 Copyright(C) 2013–2105 Apache Software Foundation
 
-Host Name/IP Address: 16.123.456.78:37800 User Name: user1
+Host Name/IP Address: 16.123.456.78:23400 User Name: user1
 Password:
 Connected to Trafodion
 
@@ -541,9 +541,9 @@ SQL>SET SQLPROMPT *
 
 <<<
 [[trafci_noconnect]]
-== Launch TrafCI Without Connecting to the Database
+== Launch trafci Without Connecting to the Database
 
-To start TrafCI without connecting to a Trafodion database, use the `-noconnect option`.
+To start trafci without connecting to a Trafodion database, use the `-noconnect option`.
 See <<cmd_disconnect, `DISCONNECT` command>> for a list of interface commands that can
 be run without a connection.
 
@@ -565,8 +565,8 @@ cd <trafci-installation-directory>/trafci/bin
 
 <<<
 [[trafci_with_version]]
-== Run TrafCI With `-version`
-To display the build version of TrafCI and the Trafodion JDBC Type 4 Driver, use the `-version`
+== Run trafci With `-version`
+To display the build version of trafci and the Trafodion JDBC Type 4 Driver, use the `-version`
 option. If other parameters are included with the `-version` parameter, they are ignored.
 
 *Example*
@@ -590,12 +590,12 @@ Welcome to Trafodion Command Interface
 Copyright(C) 2013–2105 Apache Software Foundation
 
 Trafodion JDBC Type 4 Driver : Traf_JDBC_Type4_Build_40646 Trafodion
-Command Interface : TrafCI_Build_40646
+Command Interface : trafci_Build_40646
 ```
 
 <<<
 [[trafci_help]]
-== Run TrafCI With -help
+== Run trafci With -help
 
 To display a list of acceptable list of parameters, including proper usage information, use the
 `-help` option. After displaying this information the application exits.
@@ -617,9 +617,9 @@ cd <trafci-installation-directory>/trafci/bin
 ```
 
 [[trafci_quit]]
-== Exit TrafCI
+== Exit trafci
 
-To exit TrafCI, enter one of these commands at a prompt:
+To exit trafci, enter one of these commands at a prompt:
 
 * `EXIT`
 * `QUIT`
@@ -631,7 +631,7 @@ SQL> QUIT
 ```
 
 These commands are not case-sensitive and do not require a terminator before you press *Enter*.
-After you enter one of these commands, TrafCI immediately quits running and disappears from the screen.
+After you enter one of these commands, trafci immediately quits running and disappears from the screen.
 
 
 



[21/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/udr/EXPECTED102
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/EXPECTED102 b/core/sql/regress/udr/EXPECTED102
new file mode 100644
index 0000000..04063b0
--- /dev/null
+++ b/core/sql/regress/udr/EXPECTED102
@@ -0,0 +1,421 @@
+>>cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
+
+--- SQL operation complete.
+>>set schema "_LIBMGR_";
+
+--- SQL operation complete.
+>>
+>>prepare get_schemas from
++>select distinct substring (schema_name,1,16) as schema_name
++>from trafodion."_MD_".objects
++>where schema_name in ('SEABASE', '_LIBMGR_', '_MD_', '_PRIVMGR_MD_', '_REPOS_')
++>order by 1;
+
+--- SQL command prepared.
+>>
+>>
+>>-- ****************************************************************************
+>>--  Verify enabling library management followed by authorization is correct
+>>-- ****************************************************************************
+>>
+>>-- authorization and library management should be disabled
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_MD_                                                            
+_REPOS_                                                         
+
+--- 3 row(s) selected.
+>>
+>>-- create library management 
+>>initialize trafodion, create library management;
+
+--- SQL operation complete.
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_LIBMGR_                                                        
+_MD_                                                            
+_REPOS_                                                         
+
+--- 4 row(s) selected.
+>>get libraries;
+
+Libraries in Schema TRAFODION._LIBMGR_
+======================================
+
+DB__LIBMGRNAME
+
+--- SQL operation complete.
+>>get procedures;
+
+Procedures in Schema TRAFODION._LIBMGR_
+=======================================
+
+ADDLIB
+ALTERLIB
+DROPLIB
+GETFILE
+HELP
+LS
+LSALL
+PUT
+RM
+RMREX
+
+--- SQL operation complete.
+>>showddl procedure rm;
+
+CREATE PROCEDURE TRAFODION."_LIBMGR_".RM
+  (
+    IN FILENAME VARCHAR(256 CHARS) CHARACTER SET UTF8
+  )
+  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.rm (java.lang.String)'
+  LIBRARY TRAFODION."_LIBMGR_".DB__LIBMGRNAME
+  EXTERNAL SECURITY DEFINER
+  LANGUAGE JAVA
+  PARAMETER STYLE JAVA
+  READS SQL DATA
+  DYNAMIC RESULT SETS 0
+  NO TRANSACTION REQUIRED
+  ISOLATE
+  ;
+
+--- SQL operation complete.
+>>set param ?h 'PUT';
+>>call help (?h);
+
+COMMANDNAME
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+PUT - Upload a JAR. SHOWDDL PROCEDURE [SCHEMA NAME.]PUT for more info.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+
+--- SQL operation complete.
+>>
+>>-- enable authorization
+>>initialize authorization;
+
+--- SQL operation complete.
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_LIBMGR_                                                        
+_MD_                                                            
+_PRIVMGR_MD_                                                    
+_REPOS_                                                         
+
+--- 5 row(s) selected.
+>>get roles;
+
+Roles
+=====
+
+DB__HBASEROLE
+DB__HIVEROLE
+DB__LIBMGRROLE
+DB__ROOTROLE
+PUBLIC
+
+--- SQL operation complete.
+>>showddl procedure rm;
+
+CREATE PROCEDURE TRAFODION."_LIBMGR_".RM
+  (
+    IN FILENAME VARCHAR(256 CHARS) CHARACTER SET UTF8
+  )
+  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.rm (java.lang.String)'
+  LIBRARY TRAFODION."_LIBMGR_".DB__LIBMGRNAME
+  EXTERNAL SECURITY DEFINER
+  LANGUAGE JAVA
+  PARAMETER STYLE JAVA
+  READS SQL DATA
+  DYNAMIC RESULT SETS 0
+  NO TRANSACTION REQUIRED
+  ISOLATE
+  ;
+
+-- GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".RM TO DB__ROOT WITH GRANT OPTION;
+  GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".RM TO DB__LIBMGRROLE WITH
+  GRANT OPTION;
+
+--- SQL operation complete.
+>>
+>>-- reset
+>>initialize authorization, drop;
+
+--- SQL operation complete.
+>>initialize trafodion, drop library management;
+
+--- SQL operation complete.
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_MD_                                                            
+_REPOS_                                                         
+
+--- 3 row(s) selected.
+>>get procedures;
+
+--- SQL operation complete.
+>>get roles;
+
+Roles
+=====
+
+PUBLIC
+
+--- SQL operation complete.
+>>
+>>-- ****************************************************************************
+>>--  Verify enabling authorization followed by library management is correct
+>>-- ****************************************************************************
+>>
+>>-- enable authorization
+>>initialize authorization;
+
+--- SQL operation complete.
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_MD_                                                            
+_PRIVMGR_MD_                                                    
+_REPOS_                                                         
+
+--- 4 row(s) selected.
+>>get roles;
+
+Roles
+=====
+
+DB__HBASEROLE
+DB__HIVEROLE
+DB__LIBMGRROLE
+DB__ROOTROLE
+PUBLIC
+
+--- SQL operation complete.
+>>
+>>-- enable library management
+>>initialize trafodion, create library management;
+
+--- SQL operation complete.
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_LIBMGR_                                                        
+_MD_                                                            
+_PRIVMGR_MD_                                                    
+_REPOS_                                                         
+
+--- 5 row(s) selected.
+>>get libraries;
+
+Libraries in Schema TRAFODION._LIBMGR_
+======================================
+
+DB__LIBMGRNAME
+
+--- SQL operation complete.
+>>get procedures;
+
+Procedures in Schema TRAFODION._LIBMGR_
+=======================================
+
+ADDLIB
+ALTERLIB
+DROPLIB
+GETFILE
+HELP
+LS
+LSALL
+PUT
+RM
+RMREX
+
+--- SQL operation complete.
+>>showddl procedure rm;
+
+CREATE PROCEDURE TRAFODION."_LIBMGR_".RM
+  (
+    IN FILENAME VARCHAR(256 CHARS) CHARACTER SET UTF8
+  )
+  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.rm (java.lang.String)'
+  LIBRARY TRAFODION."_LIBMGR_".DB__LIBMGRNAME
+  EXTERNAL SECURITY DEFINER
+  LANGUAGE JAVA
+  PARAMETER STYLE JAVA
+  READS SQL DATA
+  DYNAMIC RESULT SETS 0
+  NO TRANSACTION REQUIRED
+  ISOLATE
+  ;
+
+-- GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".RM TO DB__ROOT WITH GRANT OPTION;
+  GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".RM TO DB__LIBMGRROLE WITH
+  GRANT OPTION;
+
+--- SQL operation complete.
+>>set param ?h 'PUT';
+>>call help (?h);
+
+COMMANDNAME
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+PUT - Upload a JAR. SHOWDDL PROCEDURE [SCHEMA NAME.]PUT for more info.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+
+--- SQL operation complete.
+>>
+>>-- ****************************************************************************
+>>--  Test upgrade
+>>-- ****************************************************************************
+>>
+>>-- upgrade, remove a couple of procedures and run upgrade
+>>set parserflags 131072;
+
+--- SQL operation complete.
+>>drop procedure PUT;
+
+--- SQL operation complete.
+>>drop procedure ls;
+
+--- SQL operation complete.
+>>reset parserflags 131072;
+
+--- SQL operation complete.
+>>get procedures;
+
+Procedures in Schema TRAFODION._LIBMGR_
+=======================================
+
+ADDLIB
+ALTERLIB
+DROPLIB
+GETFILE
+HELP
+LSALL
+RM
+RMREX
+
+--- SQL operation complete.
+>>call ls(?);
+
+*** ERROR[1389] Object LS does not exist in Trafodion.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>initialize trafodion, upgrade library management;
+
+--- SQL operation complete.
+>>get procedures;
+
+Procedures in Schema TRAFODION._LIBMGR_
+=======================================
+
+ADDLIB
+ALTERLIB
+DROPLIB
+GETFILE
+HELP
+LS
+LSALL
+PUT
+RM
+RMREX
+
+--- SQL operation complete.
+>>showddl procedure put;
+
+CREATE PROCEDURE TRAFODION."_LIBMGR_".PUT
+  (
+    IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591
+  , IN FILENAME VARCHAR(256 CHARS) CHARACTER SET UTF8
+  , IN CREATEFLAG INTEGER
+  , IN FILEOVERWRITE INTEGER
+  )
+  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.put (java.lang.String,java.lang.String,int,int)'
+  LIBRARY TRAFODION."_LIBMGR_".DB__LIBMGRNAME
+  EXTERNAL SECURITY DEFINER
+  LANGUAGE JAVA
+  PARAMETER STYLE JAVA
+  READS SQL DATA
+  DYNAMIC RESULT SETS 0
+  NO TRANSACTION REQUIRED
+  ISOLATE
+  ;
+
+-- GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".PUT TO DB__ROOT WITH GRANT OPTION;
+  GRANT EXECUTE ON FUNCTION TRAFODION."_LIBMGR_".PUT TO DB__LIBMGRROLE WITH
+  GRANT OPTION;
+
+--- SQL operation complete.
+>>call ls ('lib_mgmt.jar',?);
+
+FILENAMES
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+<ls></ls>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                               
+
+--- SQL operation complete.
+>>
+>>-- should fail - library management already enabled
+>>initialize trafodion, create library management;
+
+*** ERROR[1390] Object TRAFODION."_LIBMGR_".DB__LIBMGRNAME already exists in Trafodion.
+
+--- SQL operation failed with errors.
+>>
+>>-- make sure everything is enabled
+>>execute get_schemas;
+
+SCHEMA_NAME                                                     
+----------------------------------------------------------------
+
+SEABASE                                                         
+_LIBMGR_                                                        
+_MD_                                                            
+_PRIVMGR_MD_                                                    
+_REPOS_                                                         
+
+--- 5 row(s) selected.
+>>get procedures;
+
+Procedures in Schema TRAFODION._LIBMGR_
+=======================================
+
+ADDLIB
+ALTERLIB
+DROPLIB
+GETFILE
+HELP
+LS
+LSALL
+PUT
+RM
+RMREX
+
+--- SQL operation complete.
+>>
+>>-- we are done
+>>exit;
+
+End of MXCI Session
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/udr/TEST102
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/TEST102 b/core/sql/regress/udr/TEST102
new file mode 100644
index 0000000..ad99838
--- /dev/null
+++ b/core/sql/regress/udr/TEST102
@@ -0,0 +1,119 @@
+-- @@@ 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 @@@
+--
+-- This tests the following commands:
+--
+--   INITIALIZE TRAFODION, CREATE LIBRARY MANAGEMENT
+--   INITIALIZE TRAFODION, DROP LIBRARY MANAGEMENT
+--   INITIALIZE TRAFODION, UPGRADE LIBRARY MANAGEMENT
+
+-- start with both authorization and library management disabled
+initialize trafodion, drop library management;
+initialize authorization, drop;
+
+log LOG102 clear;
+cqd SHOWDDL_DISPLAY_PRIVILEGE_GRANTS 'ON';
+set schema "_LIBMGR_";
+
+prepare get_schemas from
+select distinct substring (schema_name,1,16) as schema_name
+from trafodion."_MD_".objects
+where schema_name in ('SEABASE', '_LIBMGR_', '_MD_', '_PRIVMGR_MD_', '_REPOS_')
+order by 1;
+
+
+-- ****************************************************************************
+--  Verify enabling library management followed by authorization is correct
+-- ****************************************************************************
+
+-- authorization and library management should be disabled
+execute get_schemas;
+
+-- create library management 
+initialize trafodion, create library management;
+execute get_schemas;
+get libraries;
+get procedures;
+showddl procedure rm;
+set param ?h 'PUT';
+call help (?h);
+
+-- enable authorization
+initialize authorization;
+execute get_schemas;
+get roles;
+showddl procedure rm;
+
+-- reset
+initialize authorization, drop;
+initialize trafodion, drop library management;
+execute get_schemas;
+get procedures;
+get roles;
+
+-- ****************************************************************************
+--  Verify enabling authorization followed by library management is correct
+-- ****************************************************************************
+
+-- enable authorization
+initialize authorization;
+execute get_schemas;
+get roles;
+
+-- enable library management
+initialize trafodion, create library management;
+execute get_schemas;
+get libraries;
+get procedures;
+showddl procedure rm;
+set param ?h 'PUT';
+call help (?h);
+
+-- ****************************************************************************
+--  Test upgrade
+-- ****************************************************************************
+
+-- upgrade, remove a couple of procedures and run upgrade
+set parserflags 131072;
+drop procedure PUT;
+drop procedure ls;
+reset parserflags 131072;
+get procedures;
+call ls(?);
+
+initialize trafodion, upgrade library management;
+get procedures;
+showddl procedure put;
+call ls ('lib_mgmt.jar',?);
+
+-- should fail - library management already enabled
+initialize trafodion, create library management;
+
+-- make sure everything is enabled
+execute get_schemas;
+get procedures;
+
+-- we are done
+exit;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcat/desc.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcat/desc.h b/core/sql/sqlcat/desc.h
index c4f61dc..1391843 100644
--- a/core/sql/sqlcat/desc.h
+++ b/core/sql/sqlcat/desc.h
@@ -171,6 +171,7 @@ struct indexes_desc_struct {
   char *indexname;  // physical name of index. Different from ext_indexname
                     // for ARK tables.
   ULng32 redeftime[2];
+  Int64 indexUID;
   Int32 issystemtablecode;	// ...but too much bother in ReadTableDef.C
   // Indicates whether it is a vertical partition or an index
   ComPartitioningScheme partitioningScheme;     // round robin, range, etc.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index 1b0b290..2ba9652 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -446,29 +446,6 @@ static size_t indexLastNewline(const NAString & text,
   return newlinePos;
 }
 
-NAString &replaceAll(NAString &source, NAString &searchFor,
-                     NAString &replaceWith)
-{
-  size_t indexOfReplace = NA_NPOS;
-  indexOfReplace = source.index(searchFor);
-  if (indexOfReplace != NA_NPOS)
-    {
-      // Replace all occurences of searchFor with replaceWith. When no
-      // more occurences are found or end of string is reached, index()
-      // will return NA_NPOS.
-      while (indexOfReplace != NA_NPOS)
-        {
-          source.replace(indexOfReplace, searchFor.length(), 
-                         replaceWith);
-          // Find index of next occurence to replace.
-          indexOfReplace = 
-            source.index(searchFor, indexOfReplace + replaceWith.length()); 
-        }
-    }
-
-  return source;
-}
-
 static Int32 displayDefaultValue(const char * defVal, const char * colName,
                                  NAString &displayableDefVal)
 {
@@ -2691,7 +2668,7 @@ short CmpDescribeSeabaseTable (
  
   // display syscols for invoke if not running regrs
   //
-  NABoolean displaySystemCols = ((!sqlmxRegr) && (type == 1));
+  NABoolean displaySystemCols = (type == 1);
 
   NABoolean isView = (naTable->getViewText() ? TRUE : FALSE);
 
@@ -2893,8 +2870,7 @@ short CmpDescribeSeabaseTable (
     {
       if ((naTable->getClusteringIndex()) &&
           (nonSystemKeyCols > 0) &&
-          (NOT isStoreBy) &&
-          (((type == 1) && (! sqlmxRegr)) || (type != 1)))
+          (NOT isStoreBy))
         {
           numBTpkeys = naf->getIndexKeyColumns().entries();
           
@@ -3029,7 +3005,7 @@ short CmpDescribeSeabaseTable (
         }
 
       NABoolean attributesSet = FALSE;
-      if (((NOT sqlmxRegr) && ((NOT isAudited) || (isAligned))) ||
+      if ((((NOT isAudited) || (isAligned))) ||
           ((sqlmxRegr) && (type == 3) && ((NOT isAudited) || (isAligned))) ||
           ((NOT naTable->defaultColFam().isNull()) && 
            (naTable->defaultColFam() != SEABASE_DEFAULT_COL_FAMILY)))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpDescribe.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.h b/core/sql/sqlcomp/CmpDescribe.h
index c5759b3..7a9004f 100644
--- a/core/sql/sqlcomp/CmpDescribe.h
+++ b/core/sql/sqlcomp/CmpDescribe.h
@@ -58,6 +58,4 @@ void sendParserFlag (ULng32 flag);
 
 short setParentQidAtSession(NAHeap *heap, const char *parentQid);
 
-NAString &replaceAll(NAString &source, NAString &searchFor, NAString &replaceWith);
-
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index e1eee25..6edcb51 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -162,7 +162,7 @@ class CmpSeabaseDDL
   static NABoolean isHbase(const NAString &catName);
 
   static bool isHistogramTable(const NAString &tabName);
-
+  static NABoolean isLOBDependentNameMatch(const NAString &name);
   static NABoolean isSeabaseMD(const NAString &catName,
 			       const NAString &schName,
 			       const NAString &objName);
@@ -622,6 +622,12 @@ class CmpSeabaseDDL
                       Int64 objectUID,
                       Queue * &usingViewsQueue);
   
+  short getAllUsingViews(ExeCliInterface *cliInterface,
+                         NAString &catName,
+                         NAString &schName,
+                         NAString &objName,
+                         Queue * &usingViewsQueue);
+
   void handleDDLCreateAuthorizationError(
      int32_t SQLErrorCode,
      const NAString & catalogName, 
@@ -726,7 +732,8 @@ class CmpSeabaseDDL
                         Int64 objUID, 
                         ComTextType textType, 
                         Lng32 subID, 
-                        NAString &text);
+                        NAString &text,
+                        NABoolean withDelete = FALSE); // del before ins
 
   short deleteFromTextTable(ExeCliInterface *cliInterface,
                             Int64 objUID, 
@@ -1006,29 +1013,62 @@ class CmpSeabaseDDL
                            const NATable * naTable,
                            Lng32 dropColNum);
 
-  short alignedFormatTableDropColumn
-  (
+  short alignedFormatTableDropColumn(
        const NAString &catalogNamePart,
        const NAString &schemaNamePart,
        const NAString &objectNamePart,
        const NATable * naTable,
        const NAString &altColName,
        ElemDDLColDef *pColDef,
-       NABoolean ddlXns);
+       NABoolean ddlXns,
+       NAList<NAString> &viewNameList,
+       NAList<NAString> &viewDefnList);
+  
+ short hbaseFormatTableDropColumn(
+      ExpHbaseInterface *ehi,
+      const NAString &catalogNamePart,
+      const NAString &schemaNamePart,
+      const NAString &objectNamePart,
+      const NATable * naTable,
+      const NAString &altColName,
+      const NAColumn * nacol,
+      NABoolean ddlXns,
+      NAList<NAString> &viewNameList,
+      NAList<NAString> &viewDefnList);
   
   void alterSeabaseTableDropColumn(
        StmtDDLAlterTableDropColumn * alterDropColNode,
        NAString &currCatName, NAString &currSchName);
   
-  short recreateViews(ExeCliInterface &cliInterface,
-                      NAList<NAString> &viewNameList,
-                      NAList<NAString> &viewDefnList);
+  short saveAndDropUsingViews(Int64 objUID,
+                              ExeCliInterface *cliInterface,
+                              NAList<NAString> &viewNameList,
+                              NAList<NAString> &viewDefnList);
+  
+  short recreateUsingViews(ExeCliInterface *cliInterface,
+                           NAList<NAString> &viewNameList,
+                           NAList<NAString> &viewDefnList,
+                           NABoolean ddlXns);
 
   void alterSeabaseTableAlterIdentityColumn(
        StmtDDLAlterTableAlterColumnSetSGOption * alterIdentityColNode,
        NAString &currCatName, NAString &currSchName);
   
-  short alignedFormatTableAlterColumn
+  short mdOnlyAlterColumnAttr(
+       const NAString &catalogNamePart, const NAString &schemaNamePart,
+       const NAString &objectNamePart,
+       const NATable * naTable, const NAColumn * naCol, NAType * newType,
+       StmtDDLAlterTableAlterColumnDatatype * alterColNode,
+       NAList<NAString> &viewNameList,
+       NAList<NAString> &viewDefnList);
+  
+  short hbaseFormatTableAlterColumnAttr(
+       const NAString &catalogNamePart, const NAString &schemaNamePart,
+       const NAString &objectNamePart,
+       const NATable * naTable, const NAColumn * naCol, NAType * newType,
+       StmtDDLAlterTableAlterColumnDatatype * alterColNode);
+  
+  short alignedFormatTableAlterColumnAttr
   (
        const NAString &catalogNamePart,
        const NAString &schemaNamePart,
@@ -1036,18 +1076,18 @@ class CmpSeabaseDDL
        const NATable * naTable,
        const NAString &altColName,
        ElemDDLColDef *pColDef,
-       NABoolean ddlXns);
-  
-  short alterColumnAttr(
-       const NAString &catalogNamePart, const NAString &schemaNamePart,
-       const NAString &objectNamePart,
-       const NATable * naTable, const NAColumn * naCol, NAType * newType,
-       StmtDDLAlterTableAlterColumnDatatype * alterColNode);
+       NABoolean ddlXns,
+       NAList<NAString> &viewNameList,
+       NAList<NAString> &viewDefnList);
   
   void alterSeabaseTableAlterColumnDatatype(
        StmtDDLAlterTableAlterColumnDatatype * alterColumnDatatype,
        NAString &currCatName, NAString &currSchName);
   
+  void alterSeabaseTableAlterColumnRename(
+       StmtDDLAlterTableAlterColumnRename * alterColumnDatatype,
+       NAString &currCatName, NAString &currSchName);
+  
   void alterSeabaseTableAddPKeyConstraint(
        StmtDDLAddConstraint * alterAddConstraint,
        NAString &currCatName, NAString &currSchName);
@@ -1130,6 +1170,13 @@ class CmpSeabaseDDL
   void dropSeabaseRoutine(StmtDDLDropRoutine  * dropRoutineNode,
                           NAString &currCatName, NAString &currSchName);
 
+  short createSeabaseLibmgr(ExeCliInterface * cliInterface);
+  short upgradeSeabaseLibmgr(ExeCliInterface * inCliInterface);
+  short dropSeabaseLibmgr(ExeCliInterface *inCliInterface);
+  short createLibmgrProcs(ExeCliInterface * cliInterface);
+  short grantLibmgrPrivs(ExeCliInterface *cliInterface);
+
+
   void createSeabaseSequence(StmtDDLCreateSequence  * createSequenceNode,
 			     NAString &currCatName, NAString &currSchName);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
index 7d7ac01..a551266 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
@@ -929,7 +929,7 @@ void CmpSeabaseDDLuser::unregisterUser(StmtDDLRegisterUser * pNode)
                       std::string(privMgrMDLoc.data()),
                       CmpCommon::diags());
     
-    if (role.isAuthorizationEnabled() &&
+    if (CmpCommon::context()->isAuthorizationEnabled() &&
         role.isUserGrantedAnyRole(getAuthID()))
     {
        *CmpCommon::diags() << DgSqlCode(-CAT_NO_UNREG_USER_GRANTED_ROLES);
@@ -1232,26 +1232,27 @@ void CmpSeabaseDDLuser::verifyAuthority(bool isRemapUser)
 
 {
 
-int32_t currentUser = ComUser::getCurrentUser();
+   // If authorization is not enabled, just return with no error
+   if (!CmpCommon::context()->isAuthorizationEnabled())
+     return;
 
-// Root user has authority to manage users.
+   int32_t currentUser = ComUser::getCurrentUser();
+
+   // Root user has authority to manage users.
    if (currentUser == ComUser::getRootUserID())
       return;
       
-// Verify authorization is enabled.  If not, no restrictions.
-NAString systemCatalog = CmpSeabaseDDL::getSystemCatalogStatic();
-std::string privMDLoc(systemCatalog.data());
+   // Verify authorization is enabled.  If not, no restrictions.
+   NAString systemCatalog = CmpSeabaseDDL::getSystemCatalogStatic();
+   std::string privMDLoc(systemCatalog.data());
   
    privMDLoc += std::string(".\"") +
                 std::string(SEABASE_PRIVMGR_SCHEMA) +
                 std::string("\"");
                 
-PrivMgrComponentPrivileges componentPrivileges(privMDLoc,CmpCommon::diags());
-
-    if (!componentPrivileges.isAuthorizationEnabled())
-       return;
+   PrivMgrComponentPrivileges componentPrivileges(privMDLoc,CmpCommon::diags());
 
-// Authorization enabled.  See if non-root user has authority to manage users.       
+   // See if non-root user has authority to manage users.       
    if (componentPrivileges.hasSQLPriv(currentUser,SQLOperation::MANAGE_USERS,true))
    {
       if (!isRemapUser)
@@ -1260,7 +1261,7 @@ PrivMgrComponentPrivileges componentPrivileges(privMDLoc,CmpCommon::diags());
          return;
    }   
            
-// No authority.  We're outta here.
+   // No authority.  We're outta here.
    *CmpCommon::diags() << DgSqlCode(-CAT_NOT_AUTHORIZED);
    UserException excp (NULL, 0);
    throw excp;
@@ -1307,6 +1308,13 @@ void CmpSeabaseDDLrole::createRole(StmtDDLCreateRole * pNode)
    
 {
 
+   // Don't allow roles to be created unless authorization is enabled
+   if (!CmpCommon::context()->isAuthorizationEnabled())
+   {
+     *CmpCommon::diags() << DgSqlCode(-CAT_AUTHORIZATION_NOT_ENABLED);
+     return;
+   }
+
 // Set up a global try/catch loop to catch unexpected errors
    try
    {
@@ -1396,18 +1404,15 @@ void CmpSeabaseDDLrole::createRole(StmtDDLCreateRole * pNode)
       PrivMgrRoles roles(std::string(MDSchema_.data()),std::string(privMgrMDLoc),
                          CmpCommon::diags());
       
-      if (roles.isAuthorizationEnabled())
-      { 
-         PrivStatus privStatus = roles.grantRoleToCreator(roleID,
-                                                          getAuthDbName().data(),
-                                                          getAuthCreator(),
-                                                          creatorUsername);
-         if (privStatus != PrivStatus::STATUS_GOOD)
-         {
-            SEABASEDDL_INTERNAL_ERROR("Unable to grant role to role administrator");
-            return;
-         }
-      }      
+      PrivStatus privStatus = roles.grantRoleToCreator(roleID,
+                                                       getAuthDbName().data(),
+                                                       getAuthCreator(),
+                                                        creatorUsername);
+      if (privStatus != PrivStatus::STATUS_GOOD)
+      {
+         SEABASEDDL_INTERNAL_ERROR("Unable to grant role to role administrator");
+         return;
+      }
    }
    catch (...)
    {
@@ -1427,23 +1432,26 @@ void CmpSeabaseDDLrole::createRole(StmtDDLCreateRole * pNode)
 // Input:  
 //    role name
 //    role ID
+//
+// returns:  true - added role,
+//           false - did not add role
 // ----------------------------------------------------------------------------
-void CmpSeabaseDDLrole::createStandardRole(
+bool CmpSeabaseDDLrole::createStandardRole(
    const std::string roleName,
    const int32_t roleID)
 
 {
 
-// Verify name is a standard name
+   // Verify name is a standard name
 
-size_t prefixLength = strlen(RESERVED_AUTH_NAME_PREFIX);
+   size_t prefixLength = strlen(RESERVED_AUTH_NAME_PREFIX);
 
    if (roleName.size() <= prefixLength ||
        roleName.compare(0,prefixLength,RESERVED_AUTH_NAME_PREFIX) != 0)
    {
        *CmpCommon::diags() << DgSqlCode(-CAT_ROLE_NOT_EXIST)
                            << DgString0(roleName.data());
-       return;
+       return false;
    }
 
    setAuthDbName(roleName.c_str());
@@ -1457,13 +1465,16 @@ size_t prefixLength = strlen(RESERVED_AUTH_NAME_PREFIX);
 
    // Make sure role has not already been registered
    if (authExists(getAuthDbName(),false))
-      return;
-   
-   setAuthID(roleID);
+      return false;
+
+   Int32 newRoleID = (roleID == NA_UserIdDefault) ? getUniqueID() : roleID;
+   setAuthID(newRoleID);
    setAuthCreator(ComUser::getRootUserID());
 
 // Add the role to AUTHS table
    insertRow();
+  
+   return true;
 
 }
 
@@ -1537,8 +1548,11 @@ bool CmpSeabaseDDLrole::describe(
     
       roleText += ";\n";
       
-      // See if authorization is enable.  If so, need to list any grants of this
+      // See if authorization is enabled.  If so, need to list any grants of this
       // role.  Otherwise, we are outta here.
+      if (!CmpCommon::context()->isAuthorizationEnabled())
+         return true;
+
       NAString privMgrMDLoc;
 
       CONCAT_CATSCH(privMgrMDLoc,systemCatalog_.data(),SEABASE_PRIVMGR_SCHEMA);
@@ -1546,8 +1560,6 @@ bool CmpSeabaseDDLrole::describe(
       PrivMgrRoles roles(std::string(MDSchema_.data()),std::string(privMgrMDLoc),
                          CmpCommon::diags());
     
-      if (!roles.isAuthorizationEnabled())
-         return true;
          
       std::vector<std::string> granteeNames;
       std::vector<int32_t> grantDepths;
@@ -1678,7 +1690,9 @@ void CmpSeabaseDDLrole::dropRole(StmtDDLCreateRole * pNode)
       PrivMgrRoles role(std::string(MDSchema_.data()),std::string(privMgrMDLoc),
                         CmpCommon::diags());
       
-      if (role.isAuthorizationEnabled())
+      // If authorization is not enabled and a role has been defined, skip
+      // looking for dependencies and just remove the role from auths.
+      if (CmpCommon::context()->isAuthorizationEnabled())
       {
          //TODO: Could support a CASCADE option that would clean up
          // grants and dependent objects.
@@ -1838,7 +1852,7 @@ Int32 CmpSeabaseDDLrole::getUniqueID()
   sprintf(roleIDString,"%d",MIN_ROLEID);
   whereClause += roleIDString;
   whereClause += " and auth_id < ";
-  sprintf(roleIDString, "%d", MAX_ROLEID);
+  sprintf(roleIDString, "%d", MAX_ROLEID_RANGE1);
   whereClause += roleIDString;
 
   newRoleID = selectMaxAuthID(whereClause);
@@ -1850,7 +1864,7 @@ Int32 CmpSeabaseDDLrole::getUniqueID()
   // We have 490000 available ID's.  Don't expect to run out of ID's for awhile
   // but if/when we do, the algorithm needs to change.  Can reuse ID's for roles 
   // that were dropped.
-  if (newRoleID >= MAX_ROLEID)
+  if (newRoleID >= MAX_ROLEID_RANGE1)
     SEABASEDDL_INTERNAL_ERROR("CmpSeabaseDDLrole::getUniqueID failed, ran out of available IDs");
 
   return newRoleID;
@@ -1869,30 +1883,30 @@ void CmpSeabaseDDLrole::verifyAuthority()
 
 {
 
-int32_t currentUser = ComUser::getCurrentUser();
+  // If authorization is not enabled then role has privilege, just return
+  if (!CmpCommon::context()->isAuthorizationEnabled())
+    return;
 
-// Root user has authority to manage roles.
+   int32_t currentUser = ComUser::getCurrentUser();
+
+   // Root user has authority to manage roles.
    if (currentUser == ComUser::getRootUserID())
       return;
       
-// Verify authorization is enabled.  If not, no restrictions.
-NAString systemCatalog = CmpSeabaseDDL::getSystemCatalogStatic();
-std::string privMDLoc(systemCatalog.data());
+   NAString systemCatalog = CmpSeabaseDDL::getSystemCatalogStatic();
+   std::string privMDLoc(systemCatalog.data());
   
    privMDLoc += std::string(".\"") +
                 std::string(SEABASE_PRIVMGR_SCHEMA) +
                 std::string("\"");
                 
-PrivMgrComponentPrivileges componentPrivileges(privMDLoc,CmpCommon::diags());
-
-    if (!componentPrivileges.isAuthorizationEnabled())
-       return;
+   PrivMgrComponentPrivileges componentPrivileges(privMDLoc,CmpCommon::diags());
 
-// Authorization enabled.  See if non-root user has authority to manage roles.       
+   // Authorization enabled.  See if non-root user has authority to manage roles.       
    if (componentPrivileges.hasSQLPriv(currentUser,SQLOperation::MANAGE_ROLES,true))
       return;   
        
-// No authority.  We're outta here.
+   // No authority.  We're outta here.
    *CmpCommon::diags() << DgSqlCode(-CAT_NOT_AUTHORIZED);
    UserException excp (NULL, 0);
    throw excp;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLauth.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLauth.h b/core/sql/sqlcomp/CmpSeabaseDDLauth.h
index 382c64d..17d49ad 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLauth.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLauth.h
@@ -193,7 +193,7 @@ class CmpSeabaseDDLrole : public CmpSeabaseDDLauth
 
      void createRole(StmtDDLCreateRole * pNode);
         
-     void createStandardRole(
+     bool createStandardRole(
         const std::string roleName,
         const int32_t roleID);
         

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
index 3648cc3..6ca1586 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
@@ -815,7 +815,8 @@ short CmpSeabaseMDcleanup::dropLOBs(ExeCliInterface *cliInterface)
     return 0;
 
   NAString newSchName = "\"" + catName_ + "\"" + "." + "\"" + schName_ + "\"";
-
+  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   cliRC = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
                                    newSchName.length(),
                                    objUID_,
@@ -823,7 +824,9 @@ short CmpSeabaseMDcleanup::dropLOBs(ExeCliInterface *cliInterface)
                                    LOB_CLI_CLEANUP,
                                    lobNumList_,
                                    lobTypList_,
-                                   lobLocList_,0);
+                                   lobLocList_,
+                                   (char *)lobHdfsServer,
+                                   lobHdfsPort,0);
 
   return 0;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 938d8f2..e89f3e3 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -67,6 +67,7 @@
 #include "ComUser.h"
 #include "ComMisc.h"
 #include "CmpSeabaseDDLmd.h"
+#include "CmpSeabaseDDLroutine.h"
 #include "hdfs.h"
 void cleanupLOBDataDescFiles(const char*, int, const char *);
 
@@ -926,6 +927,17 @@ bool CmpSeabaseDDL::isHistogramTable(const NAString &name)
 
 }
 
+NABoolean CmpSeabaseDDL::isLOBDependentNameMatch(const NAString &name)
+{
+  if ((name(0,min((sizeof(LOB_MD_PREFIX)-1), name.length())) == LOB_MD_PREFIX) ||
+      (name(0,min((sizeof(LOB_DESC_CHUNK_PREFIX)-1), name.length()))==LOB_DESC_CHUNK_PREFIX)||
+      (name(0,min((sizeof(LOB_DESC_HANDLE_PREFIX)-1), name.length()))==LOB_DESC_HANDLE_PREFIX)
+      )
+    return true;
+  else
+    return false;
+}
+
 NABoolean CmpSeabaseDDL::isSeabase(const NAString &catName)
 {
   if ((CmpCommon::getDefault(MODE_SEABASE) == DF_ON) &&
@@ -3918,6 +3930,39 @@ short CmpSeabaseDDL::getUsingViews(ExeCliInterface *cliInterface,
   
   return 0;
 }
+
+// finds all views that directly or indirectly(thru another view) contains
+// the given object.
+// Returns them in ascending order of their create time.
+short CmpSeabaseDDL::getAllUsingViews(ExeCliInterface *cliInterface,
+                                      NAString &catName,
+                                      NAString &schName,
+                                      NAString &objName,
+                                      Queue * &usingViewsQueue)
+{
+  Lng32 retcode = 0;
+  Lng32 cliRC = 0;
+
+  char buf[4000];
+              
+  str_sprintf(buf, "select '\"' || trim(o.catalog_name) || '\"' || '.' || '\"' || trim(o.schema_name) || '\"' || '.' || '\"' || trim(o.object_name) || '\"' "
+    ", o.create_time from %s.\"%s\".%s O, "
+    " (get all views on table \"%s\".\"%s\".\"%s\") x(a) "
+    " where trim(O.schema_name) || '.' || trim(O.object_name) = x.a "
+    " order by 2",
+              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
+              catName.data(), schName.data(), objName.data());
+  
+  cliRC = cliInterface->fetchAllRows(usingViewsQueue, buf, 0, FALSE, FALSE, TRUE);
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return cliRC;
+    }
+  
+  return 0;
+}
+
 /* 
 Get the salt column text for a given table or index.
 Returns 0 for object does not have salt column
@@ -5821,9 +5866,24 @@ short CmpSeabaseDDL::updateTextTable(ExeCliInterface *cliInterface,
                                      Int64 objUID, 
                                      ComTextType textType, 
                                      Lng32 subID, 
-                                     NAString &text)
+                                     NAString &text,
+                                     NABoolean withDelete)
 {
   Lng32 cliRC = 0;
+  if (withDelete)
+    {
+      // Note: It might be tempting to try an upsert instead of a
+      // delete followed by an insert, but this won't work. It is
+      // possible that the metadata text could shrink and take fewer
+      // rows in its new form than the old. So we do the simple thing
+      // to avoid such complications.
+       cliRC = deleteFromTextTable(cliInterface, objUID, textType, subID);
+      if (cliRC < 0)
+        {
+          return -1;
+        }
+    }
+
   Lng32 textLen = text.length();
   Lng32 bufLen = (textLen>TEXTLEN ? TEXTLEN : textLen) + 1000;
   char * buf = new(STMTHEAP) char[bufLen];
@@ -6829,6 +6889,11 @@ void CmpSeabaseDDL::initSeabaseMD(NABoolean ddlXns)
      goto label_error;
    }
 
+ if (createSeabaseLibmgr (&cliInterface))
+   {
+     goto label_error;
+   }
+
   cliRC = cliInterface.restoreCQD("traf_bootstrap_md_mode");
 
   return;
@@ -7648,10 +7713,28 @@ short CmpSeabaseDDL::initSeabaseAuthorization(
 
   if (retcode != STATUS_ERROR)
   {
-    // change authorization status in compiler context and kill arkcmps
-    GetCliGlobals()->currContext()->setAuthStateInCmpContexts(TRUE, TRUE);
-    for (short i = 0; i < GetCliGlobals()->currContext()->getNumArkcmps(); i++)
-      GetCliGlobals()->currContext()->getArkcmp(i)->endConnection();
+     // Commit the transaction so privmgr schema exists in other processes
+     endXnIfStartedHere(cliInterface, xnWasStartedHere, 0);
+     if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
+     {
+       SEABASEDDL_INTERNAL_ERROR("initialize authorization");
+       return -1;
+     }
+
+     // change authorization status in compiler context and kill arkcmps
+     GetCliGlobals()->currContext()->setAuthStateInCmpContexts(TRUE, TRUE);
+     for (short i = 0; i < GetCliGlobals()->currContext()->getNumArkcmps(); i++)
+       GetCliGlobals()->currContext()->getArkcmp(i)->endConnection();
+
+     // If someone initializes trafodion with library management but does not 
+     // initialize authorization, then the role DB__LIBMGRROLE has not been 
+     // granted to LIBMGR procedures.  Do this now
+     cliRC = existsInSeabaseMDTable(cliInterface,
+                                    getSystemCatalog(), SEABASE_LIBMGR_SCHEMA, 
+                                    SEABASE_LIBMGR_LIBRARY,
+                                    COM_LIBRARY_OBJECT, TRUE, FALSE);
+     if (cliRC == 1) // library exists
+       cliRC = grantLibmgrPrivs(cliInterface);
   }
   else
   {
@@ -8292,6 +8375,7 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
        (ddlExpr->dropRepos()) ||
        (ddlExpr->upgradeRepos()) ||
        (ddlExpr->addSchemaObjects()) ||
+       (ddlExpr->createLibmgr()) ||
        (ddlExpr->updateVersion())))
     ignoreUninitTrafErr = TRUE;
 
@@ -8331,7 +8415,6 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
     }
 
   NABoolean startXn = TRUE;
-
   // no DDL transactions.
   if ((NOT ddlExpr->ddlXns()) &&
       ((ddlExpr->dropHbase()) ||
@@ -8364,6 +8447,7 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
        (ddlNode->getOperatorType() == DDL_CREATE_TABLE) ||
        (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
        (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE) ||
+       //       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_RENAME) ||
        (ddlNode->getOperatorType() == DDL_DROP_TABLE)))
     {
       // transaction will be started and commited in called methods.
@@ -8399,7 +8483,7 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
        ddlNode->castToStmtDDLNode()->ddlXns()) &&
       ((ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
        (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
-       (ddlNode->getOperatorType() ==  DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE)))
+       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE)))
     {
       // transaction will be started and commited in called methods.
       startXn = FALSE;
@@ -8476,6 +8560,18 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
     {
       createSeabaseSchemaObjects();
     }
+  else if (ddlExpr->createLibmgr())
+    {
+      createSeabaseLibmgr(&cliInterface);
+    }
+  else if (ddlExpr->dropLibmgr())
+    {
+      dropSeabaseLibmgr(&cliInterface);
+    }
+  else if (ddlExpr->upgradeLibmgr())
+    {
+      upgradeSeabaseLibmgr(&cliInterface);
+    }
   else if (ddlExpr->updateVersion())
     {
       updateVersion();
@@ -8898,6 +8994,14 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
            alterSeabaseTableAlterColumnDatatype(alterColNode, 
                                                 currCatName, currSchName);
         }
+       else if (ddlNode->getOperatorType() ==  DDL_ALTER_TABLE_ALTER_COLUMN_RENAME)
+         {
+           StmtDDLAlterTableAlterColumnRename * alterColNode =
+             ddlNode->castToStmtDDLNode()->castToStmtDDLAlterTableAlterColumnRename();
+           
+           alterSeabaseTableAlterColumnRename(alterColNode, 
+                                              currCatName, currSchName);
+        }
        else if (ddlNode->getOperatorType() ==  DDL_CLEANUP_OBJECTS)
          {
            StmtDDLCleanupObjects * co = 
@@ -8924,13 +9028,13 @@ label_return:
       cliRC = -1;
 
       // some ddl stmts are executed as multiple sub statements.
-      // with ddl xns, some of those sub stmts may abort the enclosing
-      // xn in case of an error amd add an error condition that the xn
+      // some of those sub stmts may abort the enclosing xn started here
+      // in case of an error, and add an error condition that the xn
       // was aborted.
       // remove that error condition from the diags area. But dont do it
-      // if it is main error.
-      if (ddlXns && xnWasStartedHere && 
-          (CmpCommon::diags()->mainSQLCODE() != -CLI_VALIDATE_TRANSACTION_ERROR))
+      // if it is the main error.
+      //      if (xnWasStartedHere && 
+      if (CmpCommon::diags()->mainSQLCODE() != -CLI_VALIDATE_TRANSACTION_ERROR)
         {
           CollIndex i = 
             CmpCommon::diags()->returnIndex(-CLI_VALIDATE_TRANSACTION_ERROR);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
index 89c00bc..a70f8ef 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
@@ -152,7 +152,7 @@ CmpSeabaseDDL::createIndexColAndKeyInfoArrays(
      const NAType * naType = tableCol->getType();
      if ((naType->getFSDatatype() == REC_BLOB) || (naType->getFSDatatype() == REC_CLOB))
      {
-      *CmpCommon::diags() << DgSqlCode(CAT_LOB_COL_CANNOT_BE_INDEX_OR_KEY)
+      *CmpCommon::diags() << DgSqlCode(-CAT_LOB_COL_CANNOT_BE_INDEX_OR_KEY)
                               << DgColumnName(col_name);
       processReturn();
       return -1;
@@ -1969,7 +1969,7 @@ void CmpSeabaseDDL::alterSeabaseTableDisableOrEnableAllIndexes(
     char * catName = NULL;
     char * schName = NULL;
     indexes->position();
-    for (int idx = 0; idx < indexes->numEntries(); idx++)
+    for (int ii = 0; ii < indexes->numEntries(); ii++)
     {
       OutputInfo * idx = (OutputInfo*) indexes->getNext();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index 85a3f26..e2e3105 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -40,6 +40,7 @@
 
 #include "ComObjectName.h"
 #include "ComUser.h"
+#include "CmpSeabaseDDLroutine.h"
 
 #include "StmtDDLCreateRoutine.h"
 #include "StmtDDLDropRoutine.h"
@@ -1425,3 +1426,173 @@ short CmpSeabaseDDL::validateRoutine(ExeCliInterface *cliInterface,
   return -1;
 
 } // CmpSeabaseDDL::validateRoutine
+
+short CmpSeabaseDDL::createSeabaseLibmgr(ExeCliInterface * cliInterface)
+{
+  Lng32 cliRC = 0;
+  
+  if ((CmpCommon::context()->isUninitializedSeabase()) &&
+      (CmpCommon::context()->uninitializedSeabaseErrNum() == -1393))
+    {
+      *CmpCommon::diags() << DgSqlCode(-1393);
+      return -1;
+    }
+
+  NAString jarLocation(getenv("MY_SQROOT"));
+  jarLocation += "/export/lib/lib_mgmt.jar";
+  char queryBuf[strlen(getSystemCatalog()) + strlen(SEABASE_LIBMGR_SCHEMA) +
+                strlen(SEABASE_LIBMGR_LIBRARY) + strlen(DB__LIBMGRROLE) + 
+                jarLocation.length() + 100];
+
+  // Create the SEABASE_LIBMGR_SCHEMA schema
+  str_sprintf(queryBuf, "create schema if not exists %s.\"%s\" authorization %s ",
+              getSystemCatalog(),SEABASE_LIBMGR_SCHEMA, DB__ROOT);
+
+  cliRC = cliInterface->executeImmediate(queryBuf);
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return -1;
+    }
+
+  // Create the SEABASE_LIBMGR_LIBRARY library
+  str_sprintf(queryBuf, "create library %s.\"%s\".%s file '%s'",
+                         getSystemCatalog(), SEABASE_LIBMGR_SCHEMA, SEABASE_LIBMGR_LIBRARY,
+                         jarLocation.data());
+
+  cliRC = cliInterface->executeImmediate(queryBuf);
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return -1;
+    }
+
+  return (createLibmgrProcs(cliInterface));
+}
+
+short CmpSeabaseDDL::createLibmgrProcs(ExeCliInterface * cliInterface)
+{
+  Lng32 cliRC = 0;
+
+ // Create the procedures if they don't already exist
+  for (Int32 i = 0; i < sizeof(allLibmgrRoutineInfo)/sizeof(LibmgrRoutineInfo); i++)
+    {
+      // Get the next procedure routine details
+      const LibmgrRoutineInfo &prd = allLibmgrRoutineInfo[i];
+
+      const QString * qs = NULL;
+      Int32 sizeOfqs = 0;
+
+      qs = prd.newDDL;
+      sizeOfqs = prd.sizeOfnewDDL;
+
+      Int32 qryArraySize = sizeOfqs / sizeof(QString);
+      char * gluedQuery;
+      Lng32 gluedQuerySize;
+      glueQueryFragments(qryArraySize,  qs,
+                         gluedQuery, gluedQuerySize);
+
+      param_[0] = getSystemCatalog();
+      param_[1] = SEABASE_LIBMGR_SCHEMA;
+      param_[2] = getSystemCatalog();
+      param_[3] = SEABASE_LIBMGR_SCHEMA;
+      param_[4] = SEABASE_LIBMGR_LIBRARY;
+
+      // Review comment - make sure size of queryBuf is big enough to hold
+      // generated text.
+      char queryBuf[strlen(getSystemCatalog())*2 + strlen(SEABASE_LIBMGR_SCHEMA)*2 +
+                    strlen(SEABASE_LIBMGR_LIBRARY) + gluedQuerySize + 200]; 
+
+      str_sprintf(queryBuf, gluedQuery, param_[0], param_[1], param_[2], param_[3], param_[4]);
+      NADELETEBASIC(gluedQuery, STMTHEAP);
+
+      cliRC = cliInterface->executeImmediate(queryBuf);
+      if (cliRC < 0)
+        {
+          cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+        return -1;
+        }
+    } // for
+
+  return (grantLibmgrPrivs(cliInterface));
+}
+
+// If authorization is enabled, grant privileges to DB__LIBMGRROLE
+short CmpSeabaseDDL::grantLibmgrPrivs(ExeCliInterface *cliInterface)
+{
+  if (!isAuthorizationEnabled())
+    return 0;
+
+  Lng32 cliRC = 0;
+  char queryBuf[strlen(getSystemCatalog()) + strlen(SEABASE_LIBMGR_SCHEMA) +
+                strlen(SEABASE_LIBMGR_LIBRARY) + strlen(DB__LIBMGRROLE) + 200];
+  for (Int32 i = 0; i < sizeof(allLibmgrRoutineInfo)/sizeof(LibmgrRoutineInfo); i++)
+    {
+      // Get the next procedure routine details
+      const LibmgrRoutineInfo &prd = allLibmgrRoutineInfo[i];
+
+      str_sprintf (queryBuf, "grant execute on procedure %s.\"%s\".%s to %s with grant option",
+                              getSystemCatalog(),SEABASE_LIBMGR_SCHEMA,prd.newName,
+                              DB__LIBMGRROLE);
+      cliRC = cliInterface->executeImmediate(queryBuf);
+      if (cliRC < 0)
+        {
+          cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+          return -1;
+        }
+    }
+  return 0;
+}
+
+short CmpSeabaseDDL::upgradeSeabaseLibmgr(ExeCliInterface * cliInterface)
+{
+  Lng32 cliRC = 0;
+
+  cliRC = existsInSeabaseMDTable(cliInterface,
+                                 getSystemCatalog(), SEABASE_LIBMGR_SCHEMA,
+                                 SEABASE_LIBMGR_LIBRARY,
+                                 COM_LIBRARY_OBJECT, TRUE, FALSE);
+  if (cliRC < 0)
+    return -1;
+
+  if (cliRC == 0) // does not exist
+    {
+      NAString libraryName(getSystemCatalog());
+      libraryName + ".\"" + SEABASE_LIBMGR_SCHEMA + "\"" + SEABASE_LIBMGR_LIBRARY;
+      *CmpCommon::diags() << DgSqlCode(-1389)
+                          << DgString0(libraryName.data());
+      return -1;
+    }
+
+  return (createLibmgrProcs(cliInterface));
+}
+
+short CmpSeabaseDDL::dropSeabaseLibmgr(ExeCliInterface *cliInterface)
+{
+  Lng32 cliRC = 0;
+
+  char queryBuf[strlen(getSystemCatalog()) + strlen(SEABASE_LIBMGR_SCHEMA) + 100];
+
+  // save the current parserflags setting
+  ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF);
+  Set_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL);
+
+  str_sprintf(queryBuf, "drop schema if exists %s.\"%s\" cascade ",
+              getSystemCatalog(),SEABASE_LIBMGR_SCHEMA, DB__ROOT);
+
+  // Drop the SEABASE_LIBMGR_SCHEMA schema
+  cliRC = cliInterface->executeImmediate(queryBuf);
+
+  // Restore parser flags settings to what they originally were
+  Assign_SqlParser_Flags(savedParserFlags);
+
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return -1;
+    }
+  return 0;
+}
+
+
+  


[20/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLroutine.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.h b/core/sql/sqlcomp/CmpSeabaseDDLroutine.h
new file mode 100644
index 0000000..18b6d7a
--- /dev/null
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.h
@@ -0,0 +1,280 @@
+// @@@ 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 @@@
+
+#ifndef _CMP_SEABASE_PROCEDURES_H_
+#define _CMP_SEABASE_PROCEDURES_H_
+
+#include "CmpSeabaseDDL.h"
+
+// To add a new procedure:
+//   update export/lib/lib_mgmt.jar to include code for the new procedure 
+//   add a define representing the procedures below
+//   add a static const QString representing the create procedure text
+//   add a new entry in allLibmgrRoutineInfo 
+//   perform initialize trafodion, upgrade library management
+// recommend that new procedures are added in alphabetic order
+
+// At this time there is no support to drop or change the signature of an
+// existing procedure.  Since customers may be using the procedures, it is
+// recommended that they not be dropped or changed - instead add new ones
+// to handle the required change.
+  
+// List of supported system procedures - in alphabetic order
+#define SYSTEM_PROC_ADDLIB       "ADDLIB"
+#define SYSTEM_PROC_ALTERLIB     "ALTERLIB"
+#define SYSTEM_PROC_DROPLIB      "DROPLIB"
+#define SYSTEM_PROC_GETFILE      "GETFILE"
+#define SYSTEM_PROC_HELP         "HELP"
+#define SYSTEM_PROC_LS           "LS"
+#define SYSTEM_PROC_LSALL        "LSALL"
+#define SYSTEM_PROC_PUT          "PUT"
+#define SYSTEM_PROC_RM           "RM"
+#define SYSTEM_PROC_RMREX        "RMREX"
+
+// Create procedure text for system procedures
+static const QString seabaseProcAddlibDDL[] =
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\"."SYSTEM_PROC_ADDLIB" "},
+  {" ( "},
+  {"  IN LIBNAME VARCHAR(1024) CHARACTER SET UTF8, "},
+  {"  IN FILENAME VARCHAR(1024) CHARACTER SET UTF8, "},
+  {"  IN HOSTNAME VARCHAR(1024) CHARACTER SET UTF8, "},
+  {"  IN LOCALFILE VARCHAR(1024) CHARACTER SET UTF8) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.addLib (java.lang.String,java.lang.String,java.lang.String,java.lang.String)' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  CONTAINS SQL "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcAlterlibDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".ALTERLIB "},
+  {" ( "},
+  {"  IN LIBNAME VARCHAR(1024) CHARACTER SET UTF8,"},
+  {"  IN FILENAME VARCHAR(1024) CHARACTER SET UTF8,"},
+  {"  IN HOSTNAME VARCHAR(1024) CHARACTER SET UTF8,"},
+  {"  IN LOCALFILE VARCHAR(1024) CHARACTER SET UTF8) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.alterLib (java.lang.String,java.lang.String,java.lang.String,java.lang.String)' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  CONTAINS SQL "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcDroplibDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".DROPLIB "},
+  {" ( "},
+  {"  IN LIBNAME VARCHAR(1024) CHARACTER SET UTF8, "},
+  {"  IN MODETYPE VARCHAR(1024) CHARACTER SET ISO88591) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.dropLib (java.lang.String,java.lang.String)' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  CONTAINS SQL "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcGetfileDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".GETFILE  "},
+  {" ( "},
+  {"  IN FILENAME VARCHAR(256) CHARACTER SET UTF8,"},
+  {"  IN OFFSET INTEGER,"},
+  {"  OUT FILEDATA VARCHAR(12800) CHARACTER SET UTF8,"},
+  {"  OUT DATALENGTH LARGEINT)"},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.get (java.lang.String,int,java.lang.String[],long[])' "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcHelpDDL[] =
+{
+  {" CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".HELP "},
+  {" ( "},
+  {" INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.help (java.lang.String[])' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {" ; "}
+};
+
+static const QString seabaseProcLsDDL[] = 
+{
+  {" CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".LS  "},
+  {" ( "},
+  {"  IN FILENAME VARCHAR(256) CHARACTER SET UTF8, "},
+  {"  OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.ls(java.lang.String,java.lang.String[])' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcLsallDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".LSALL "},
+  {" ( "},
+  {"  OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.lsAll(java.lang.String[])' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "}, 
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcPutDDL[] =
+{
+  {" CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".PUT "},
+  {" ( "},
+  {"  IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, "},
+  {"  IN FILENAME VARCHAR(256) CHARACTER SET UTF8, "},
+  {"  IN CREATEFLAG INTEGER, "},
+  {"  IN FILEOVERWRITE INTEGER) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.put(java.lang.String,java.lang.String,int,int)' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcRmDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".RM "},
+  {" ( "},
+  {"  IN FILENAME VARCHAR(256) CHARACTER SET UTF8) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.rm(java.lang.String)' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+static const QString seabaseProcRmrexDDL[] = 
+{
+  {"  CREATE PROCEDURE IF NOT EXISTS %s.\"%s\".RMREX  "},
+  {" ( "},
+  {"  IN FILENAME VARCHAR(256) CHARACTER SET UTF8, "},
+  {"  OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) "},
+  {"  EXTERNAL NAME 'org.trafodion.libmgmt.FileMgmt.rmRex(java.lang.String, java.lang.String[])' "},
+  {"  EXTERNAL SECURITY DEFINER "},
+  {"  LIBRARY %s.\"%s\".%s "},
+  {"  LANGUAGE JAVA "},
+  {"  PARAMETER STYLE JAVA "},
+  {"  READS SQL DATA "},
+  {"  NO TRANSACTION REQUIRED "},
+  {" ; "}
+};
+
+struct LibmgrRoutineInfo
+{
+  // name of the procedure
+  const char * newName;
+
+  // ddl stmt corresponding to the current ddl.
+  const QString *newDDL;
+  Lng32 sizeOfnewDDL;
+};
+
+static const LibmgrRoutineInfo allLibmgrRoutineInfo[] = {
+  {SYSTEM_PROC_ADDLIB, 
+   seabaseProcAddlibDDL, 
+   sizeof(seabaseProcAddlibDDL)
+  },
+
+  {SYSTEM_PROC_ALTERLIB, 
+   seabaseProcAlterlibDDL, 
+   sizeof(seabaseProcAlterlibDDL)
+  },
+
+  {SYSTEM_PROC_DROPLIB, 
+   seabaseProcDroplibDDL, 
+   sizeof(seabaseProcDroplibDDL)
+  },
+
+  {SYSTEM_PROC_GETFILE, 
+   seabaseProcGetfileDDL, 
+   sizeof(seabaseProcGetfileDDL)
+  },
+
+  {SYSTEM_PROC_HELP, 
+   seabaseProcHelpDDL, 
+   sizeof(seabaseProcHelpDDL)
+  },
+
+  {SYSTEM_PROC_LS, 
+   seabaseProcLsDDL, 
+   sizeof(seabaseProcLsDDL)
+  },
+
+  {SYSTEM_PROC_LSALL, 
+   seabaseProcLsallDDL, 
+   sizeof(seabaseProcLsallDDL)
+  },
+
+  {SYSTEM_PROC_PUT, 
+   seabaseProcPutDDL, 
+   sizeof(seabaseProcPutDDL)
+  },
+
+  {SYSTEM_PROC_RM, 
+   seabaseProcRmDDL, 
+   sizeof(seabaseProcRmDDL)
+  },
+
+  {SYSTEM_PROC_RMREX, 
+   seabaseProcRmrexDDL, 
+   sizeof(seabaseProcRmrexDDL)
+  }
+
+};
+
+#endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 34a8cf0..921369f 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -61,6 +61,7 @@ static bool dropOneTable(
    const char * schemaName, 
    const char * objectName,
    bool isVolatile,
+   bool ifExists,
    bool ddlXns);
    
 static bool transferObjectPrivs(
@@ -499,6 +500,8 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
 
    // select objects in the schema to drop, don't return PRIMARY_KEY_CONSTRAINTS,
    // they always get removed when the parent table is dropped.
+   // Filter out the LOB depenedent tables too - they will get dropped when 
+   //the main LOB table is dropped. 
    str_sprintf(query,"SELECT TRIM(object_name), TRIM(object_type) "
                      "FROM %s.\"%s\".%s "
                      "WHERE catalog_name = '%s' AND schema_name = '%s' AND "
@@ -548,12 +551,12 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
        dirtiedMetadata = TRUE;
        if (dropOneTable(cliInterface,(char*)catName.data(),
                         (char*)schName.data(),(char*)objName.data(),
-                        isVolatile, dropSchemaNode->ddlXns()))
+                        isVolatile, FALSE,dropSchemaNode->ddlXns()))
           someObjectsCouldNotBeDropped = true;
      }
    }
 
-   // Drop libraries, procedures (SPJs), UDFs (functions), and views 
+   // Drop procedures (SPJs), UDFs (functions), and views 
     objectsQueue->position();
     for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
     {
@@ -576,14 +579,9 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
           case COM_REFERENTIAL_CONSTRAINT_OBJECT:
           case COM_SEQUENCE_GENERATOR_OBJECT:
           case COM_UNIQUE_CONSTRAINT_OBJECT:
-          {
-             continue;
-          }
           case COM_LIBRARY_OBJECT:
           {
-             objectTypeString = "LIBRARY";
-             cascade = "CASCADE";
-             break;
+             continue;
           }
 
           // If the library where procedures and functions reside is dropped
@@ -634,30 +632,85 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
           someObjectsCouldNotBeDropped = true;
    } 
 
-   // Drop all tables in the schema.  This will also drop any associated constraints. 
-
+   // Drop libraries in the schema
    objectsQueue->position();
    for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
    {
-      OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
+      OutputInfo * vi = (OutputInfo*)objectsQueue->getNext();
 
-      NAString objName = vi->get(0);
+      char * objName = vi->get(0);
       NAString objType = vi->get(1);
 
-      // drop user objects first
-      if (objType == COM_BASE_TABLE_OBJECT_LIT)
+      if (objType == COM_LIBRARY_OBJECT_LIT)
       {
-         // histogram tables have already been dropped
-         if (!isHistogramTable(objName))
-         {
-            dirtiedMetadata = TRUE;
-            if (dropOneTable(cliInterface,(char*)catName.data(), 
-                             (char*)schName.data(),(char*)objName.data(),
-                             isVolatile, dropSchemaNode->ddlXns()))
-               someObjectsCouldNotBeDropped = true;
-         }
-      } 
-   } 
+         char buf [1000];
+
+         dirtiedMetadata = TRUE;
+         str_sprintf(buf, "DROP LIBRARY \"%s\".\"%s\".\"%s\" CASCADE",
+                     (char*)catName.data(), (char*)schName.data(), objName);
+         cliRC = cliInterface.executeImmediate(buf);
+
+         if (cliRC < 0 && cliRC != -CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION)
+            someObjectsCouldNotBeDropped = true;
+      }
+   }
+
+   // Drop all tables in the schema.  This will also drop any associated constraints. 
+
+   objectsQueue->position();
+   for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
+     {
+       OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
+
+       NAString objName = vi->get(0);
+       NAString objType = vi->get(1);
+
+       // drop user objects first
+       if (objType == COM_BASE_TABLE_OBJECT_LIT) 
+	 {
+	   // histogram tables have already been dropped
+	   // Avoid any tables that match LOB dependent tablenames.
+	   // (there is no special type for these tables) 
+	   if (!isHistogramTable(objName) && !isLOBDependentNameMatch(objName))
+	     {
+	       dirtiedMetadata = TRUE;
+	       if (dropOneTable(cliInterface,(char*)catName.data(), 
+				(char*)schName.data(),(char*)objName.data(),
+				isVolatile, FALSE,dropSchemaNode->ddlXns()))
+		 someObjectsCouldNotBeDropped = true;
+	     }
+	 } 
+     } 
+
+   // If there are any user tables having the LOB dependent name pattern, they
+   // will still be around. Drop those. The real LOB dependent tables, would
+   //have been dropped in the previous step 
+  
+
+    objectsQueue->position();
+   for (int idx = 0; idx < objectsQueue->numEntries(); idx++)
+     {
+       OutputInfo * vi = (OutputInfo*)objectsQueue->getNext(); 
+
+       NAString objName = vi->get(0);
+       NAString objType = vi->get(1);
+
+       if (objType == COM_BASE_TABLE_OBJECT_LIT)
+	 {
+	   if (!isHistogramTable(objName) && isLOBDependentNameMatch(objName))
+	     {
+	       dirtiedMetadata = TRUE;
+	       // Pass in TRUE for "ifExists" since the lobDependent tables 
+	       // would have already been dropped and we don't want those to 
+	       // raise errors. We just want to catch any user tables that 
+	       // happen to have the same name patterns.
+	       if (dropOneTable(cliInterface,(char*)catName.data(), 
+				(char*)schName.data(),(char*)objName.data(),
+				isVolatile,TRUE, dropSchemaNode->ddlXns()))
+		 someObjectsCouldNotBeDropped = true;
+	     }
+	 } 
+     } 
  
    // Drop any remaining indexes.
 
@@ -1151,6 +1204,7 @@ static bool dropOneTable(
    const char * schemaName, 
    const char * objectName,
    bool isVolatile,
+   bool ifExists,
    bool ddlXns)
    
 {
@@ -1160,17 +1214,23 @@ char buf [1000];
 bool someObjectsCouldNotBeDropped = false;
 
 char volatileString[20] = {0};
+ char ifExistsString[20] = {0};
 Lng32 cliRC = 0;
 
+
+
    if (isVolatile)
       strcpy(volatileString,"VOLATILE");
 
+   if (ifExists)
+     strcpy(ifExistsString,"IF EXISTS");
+
    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);
+     str_sprintf(buf,"DROP %s %s TABLE  \"%s\".\"%s\".\"%s\" CASCADE",
+                 volatileString, ifExistsString, catalogName,schemaName,objectName);
  
 ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF);
 


[31/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/exp_datetime.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_datetime.cpp b/core/sql/exp/exp_datetime.cpp
index 781f2dd..456f539 100644
--- a/core/sql/exp/exp_datetime.cpp
+++ b/core/sql/exp/exp_datetime.cpp
@@ -89,8 +89,53 @@ copyDatetimeFields(rec_datetime_field startField,
                    short dstFractPrec,
                    char *srcData,
                    char *dstData,
+                   Lng32 dstLen,
                    NABoolean *roundedDownFlag);
 
+//////////////////////////////////////////////
+// Defined in exp_datetime.h
+//
+//  struct DatetimeFormatInfo
+//  {
+//    Lng32 format;
+//    const char * str;
+//    Lng32 minLen;
+//    Lng32 maxLen
+//  };
+////////////////////////////////////////////// 
+const ExpDatetime::DatetimeFormatInfo ExpDatetime::datetimeFormat[] =
+  {
+    {ExpDatetime::DATETIME_FORMAT_DEFAULT,   "YYYY-MM-DD",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_USA,       "MM/DD/YYYY",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_EUROPEAN,  "DD.MM.YYYY",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_DEFAULT2,  "YYYY-MM",                7,  7},
+    {ExpDatetime::DATETIME_FORMAT_USA2,      "MM/DD/YYYY",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_USA3,      "YYYY/MM/DD",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_USA4,      "YYYYMMDD",               8,  8},
+    {ExpDatetime::DATETIME_FORMAT_USA5,      "YY/MM/DD",               8,  8},
+    {ExpDatetime::DATETIME_FORMAT_USA6,      "MM/DD/YY",               8,  8},
+    {ExpDatetime::DATETIME_FORMAT_USA7,      "MM-DD-YYYY",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_USA8,      "YYYYMM",                 6,  6},
+    {ExpDatetime::DATETIME_FORMAT_EUROPEAN2, "DD-MM-YYYY",            10, 10},
+    {ExpDatetime::DATETIME_FORMAT_EUROPEAN3, "DD-MON-YYYY",           11, 11},
+    {ExpDatetime::DATETIME_FORMAT_EUROPEAN4, "DDMONYYYY",              9,  9},
+
+    {ExpDatetime::DATETIME_FORMAT_TS4,       "HH24:MI:SS",             8,  8},
+
+    {ExpDatetime::DATETIME_FORMAT_TS1,       "YYYYMMDDHH24MISS",      14, 14},
+    {ExpDatetime::DATETIME_FORMAT_TS2,       "DD.MM.YYYY:HH24:MI:SS", 19, 19},
+    {ExpDatetime::DATETIME_FORMAT_TS3,       "YYYY-MM-DD HH24:MI:SS", 19, 19},
+    {ExpDatetime::DATETIME_FORMAT_TS5,       "YYYYMMDD:HH24:MI:SS",   17, 17},
+    {ExpDatetime::DATETIME_FORMAT_TS6,       "MMDDYYYY HH24:MI:SS",   17, 17},
+    {ExpDatetime::DATETIME_FORMAT_TS7,       "MM/DD/YYYY HH24:MI:SS", 19, 19},
+    {ExpDatetime::DATETIME_FORMAT_TS8,       "DD-MON-YYYY HH:MI:SS",  20, 20},
+    {ExpDatetime::DATETIME_FORMAT_TS9,       "MONTH DD, YYYY, HH:MI", 19, 25},
+
+    {ExpDatetime::DATETIME_FORMAT_NUM1,      "99:99:99:99",           11, 11},
+    {ExpDatetime::DATETIME_FORMAT_NUM2,      "-99:99:99:99",          12, 12}
+
+  };
+
 ExpDatetime::ExpDatetime()
 {
   setClassID(SimpleTypeID);
@@ -911,6 +956,7 @@ ExpDatetime::arithDatetimeInterval(arithOps operation,
                          datetimeOpType->getScale(),
                          datetimeOpData,
                          dateTimeValue,
+                         MAX_DATETIME_SIZE,
                          NULL) != 0) {
     ExRaiseSqlError(heap, diagsArea, EXE_INTERNAL_ERROR);
     return -1;
@@ -1326,6 +1372,7 @@ copyDatetimeFields(rec_datetime_field startField,
                    short dstFractPrec,
                    char *srcData,
                    char *dstData,
+                   Lng32 dstLen,
                    NABoolean *roundedDownFlag)
 {
 
@@ -1360,7 +1407,9 @@ copyDatetimeFields(rec_datetime_field startField,
                                dstFractPrec,
                                roundedDownFlag);
     }
-    str_cpy_all(dstData, (char *) &fraction, sizeof(fraction));
+    // if destination has space for fraction, copy it.
+    if ((dstLen > 0) && (dstLen >= (size + sizeof(fraction))))
+      str_cpy_all(dstData, (char *) &fraction, sizeof(fraction));
   }
   return 0;
 }
@@ -1439,6 +1488,7 @@ ExpDatetime::convDatetimeDatetime(char *srcData,
                                   rec_datetime_field dstEndField,
                                   short dstFractPrec,
                                   char *dstData,
+                                  Lng32 dstLen,
                                   short validateFlag,
                                   NABoolean *roundedDownFlag)
 {
@@ -1487,6 +1537,7 @@ ExpDatetime::convDatetimeDatetime(char *srcData,
                          dstFractPrec,
                          srcData,
                          dstData,
+                         dstLen,
                          roundedDownFlag) != 0) {
     return -1;
   }
@@ -1552,13 +1603,13 @@ ExpDatetime::extractDatetime(rec_datetime_field srcStartField,
                                   (rec_datetime_field)(dstStartField - 1),
                                   srcFractPrec);
   
-
   if (copyDatetimeFields(dstStartField,
                          dstEndField,
                          srcFractPrec,
                          getScale(),
                          srcData,
                          dstData,
+                         getLength(),
                          NULL) != 0) {
     return -1;
   }
@@ -1590,7 +1641,7 @@ ExpDatetime::extractDatetime(rec_datetime_field srcStartField,
 //
 NA_EIDPROC
 static
-ExpDatetime::asciiFormats
+ExpDatetime::DatetimeFormats
 determineFormat(char *src,
                 rec_datetime_field startField,
                 rec_datetime_field endField)
@@ -2302,9 +2353,9 @@ ExpDatetime::convAsciiToDatetime(char *srcData,
                              heap, diagsArea, flags);
 }
 
-NA_EIDPROC
-static NABoolean 
-convertStrToMonth(char * value, char *result)
+static NABoolean convertStrToMonth(char* &srcData, char *result,
+                                   const char * nextByte,
+                                   CollHeap * heap, ComDiagsArea** diagsArea)
 {
   const char * months[] = 
   {
@@ -2325,10 +2376,59 @@ convertStrToMonth(char * value, char *result)
   for (Int32 i = 0; i < 12; i++)
     {
       char upVal[3];
-      str_cpy_convert(upVal, value, 3, 1);
+      str_cpy_convert(upVal, srcData, 3, 1);
       if (memcmp(upVal, months[i], 3) == 0)
 	{
 	  *result = (char)(i + 1);
+
+          srcData += 3;
+
+          if (nextByte)
+            {
+              if (*srcData != *nextByte)
+                {
+                  // string contains non-digit
+                  ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+                  return FALSE; // error
+                }    
+              srcData++;
+            }
+
+	  return TRUE;
+	}
+    } // for
+  
+  // error
+  return FALSE;
+}
+
+static NABoolean 
+convertStrToMonthLongFormat(char* &value, char *result)
+{
+  const char * months[] = 
+  {
+    "JANUARY", 
+    "FEBRUARY", 
+    "MARCH", 
+    "APRIL", 
+    "MAY", 
+    "JUNE", 
+    "JULY", 
+    "AUGUST", 
+    "SEPTEMBER", 
+    "OCTOBER",
+    "NOVEMBER", 
+    "DECEMBER"
+  };
+
+  for (Int32 i = 0; i < 12; i++)
+    {
+      char upVal[10];
+      str_cpy_convert(upVal, value, strlen(months[i]), 1);
+      if (memcmp(upVal, months[i], strlen(months[i])) == 0)
+	{
+	  *result = (char)(i + 1);
+          value += strlen(months[i]);
 	  return TRUE;
 	}
     }
@@ -2337,6 +2437,50 @@ convertStrToMonth(char * value, char *result)
   return FALSE;
 }
 
+static short convSrcDataToDst(Lng32 numSrcBytes, char* &srcData, 
+                               Lng32 numTgtBytes, char *dstData,
+                               const char * nextByte,
+                               CollHeap * heap, ComDiagsArea** diagsArea)
+{
+  Lng32 src = 0;
+  Lng32 val = 0;
+  for (val = 0, src = 0; src < numSrcBytes && isDigit8859_1(*srcData); 
+       src++, srcData++)
+    val = val * 10 + (*srcData - '0');
+  
+  if (src < numSrcBytes) 
+    {
+      // string contains non-digit
+      //
+      ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      return -1;
+    }
+
+  if (numTgtBytes == sizeof(Lng32))
+    *(Lng32*)dstData = val;
+  else if (numTgtBytes == sizeof(short))
+    *(short*)dstData = val;
+  else if (numTgtBytes == sizeof(char))
+    *(char*)dstData = val;
+  else 
+    return -1;
+
+  if (nextByte && (strlen(nextByte) > 0))
+    {
+      if (*srcData != *nextByte)
+        {
+          // string contains non-digit
+          ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+          return -1;
+        }    
+
+      srcData++;
+    }
+
+  return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////
 // ExpDatetime::convAsciiToDate() ================================
 // This method is used to convert the given ASCII string
 // to a datetime date value.
@@ -2345,24 +2489,26 @@ convertStrToMonth(char * value, char *result)
 // 'dstData'. This buffer must be allocated by the caller and it
 // must be large enough to hold the result.
 //
-// The ASCII string can be in one of three formats:
-//
-//  Default : yyyy-mm-dd
-//  USA     : mm/dd/yyyy
-//  European: dd.mm.yyyy
-//
 // This method is called assuming the correct source format. The source
 // string must contain date and, possibly, leading and trailing blanks
 // only. The size of destination buffer should be just enough to hold
 // internal representation of the date value, i.e. 4 bytes.
 //
-// This method was added as part of the IMPORT performance improvement
-// project.
+// target dstData has the format:
+//  Timestamp:
+//    dstData[0..1]               2-bytes for year.
+//    dstData[2] .. dstData[6]    1-byte for month through second.
+//    dstData[7..10]              4-bytes for fraction.
+// Date:
+//    dstData[0..1]               2-bytes for year.
+//    dstData[2] .. dstData[3]    1-byte for month through day.
+//  Time:
+//    dstData[0] .. dstData[2]    1-byte for hour through second.
 // =====================================================================
 //
 short
 ExpDatetime::convAsciiToDate(char *srcData,
-                             Lng32 srcLen,
+                             Lng32 inSrcLen,
                              char *dstData,
                              Lng32 dstLen,
 			     Int32 format,
@@ -2376,6 +2522,7 @@ ExpDatetime::convAsciiToDate(char *srcData,
   Lng32  srcFormat, i;
   NABoolean LastDayPrevMonth = FALSE;
 
+  Lng32 srcLen = inSrcLen;
   if (*srcData == ' ') {
     // skip leading blanks and adjust srcData and srcLen accordingly
     //
@@ -2410,773 +2557,363 @@ ExpDatetime::convAsciiToDate(char *srcData,
   };
 
   switch (srcFormat) {
-  case DATETIME_FORMAT_DEFAULT:
-  case DATETIME_FORMAT_DEFAULT2:
-  case DATETIME_FORMAT_TS3:
+  case DATETIME_FORMAT_DEFAULT: // YYYY-MM-DD
     {
-      // this is default format: yyyy-mm-dd. first, the year
-      for (year = 0, i = 0; i < 4 && isDigit8859_1(*srcData); i++, srcData++)
-#pragma nowarn(1506)   // warning elimination 
-        year = year * 10 + *srcData - '0';
-#pragma warn(1506)  // warning elimination 
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, "-", heap, diagsArea))
+        return -1;
 
-      if (i < 4 || *srcData != '-') {
-        // string contains non-digit or invalid delimiter
-        //
-        if (i < 4)
-          ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], "-", heap, diagsArea))
+        return -1;
+
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], NULL, heap, diagsArea))
+        return -1;
+    }; 
+    break;
+
+  case DATETIME_FORMAT_DEFAULT2: // YYYY-MM
+    {
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, "-", heap, diagsArea))
         return -1;
-      }
-      str_cpy_all(dstData, (char *)&year, sizeof(year));
-      srcData++;  // move on to the next field
 
       // the month
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], NULL, heap, diagsArea))
         return -1;
-      }
 
-      srcData += 2;
+      // the day
+      // day is not specified, fill in as '1' (first day of month).
+      dstData[3] = 1;
+    }; 
+    break;
+
+  case DATETIME_FORMAT_TS3: // YYYY-MM-DD HH24:MI:SS
+    {
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, "-", heap, diagsArea))
+        return -1;
+
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], "-", heap, diagsArea))
+        return -1;
 
       // the day
-      if (srcFormat == DATETIME_FORMAT_DEFAULT2)
-	{
-	  // day is not specified, fill in as '1' (first day of month).
-	  dstData[3] = 1;
-	}
-      else
-	{
-	  if (*srcData != '-') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[3] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData += 2;
-	}
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], " ", heap, diagsArea))
+        return -1;
+      
+      // the hour
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], ":", heap, diagsArea))
+        return -1;
 
-      if (srcFormat == DATETIME_FORMAT_TS3)
-	{
-	  if (*srcData != ' ') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
+      // the minute
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], ":", heap, diagsArea))
+        return -1;
 
-	  // the hour
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[4] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
+      // the second
+      if (convSrcDataToDst(2, srcData, 1, &dstData[6], NULL, heap, diagsArea))
+        return -1;
 
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the minute
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[5] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the second
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[6] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  
-	  dstData[7]  = 0;
-	  dstData[8]  = 0;
-	  dstData[9]  = 0;
-	  dstData[10] = 0;
-	}
-    };  // case DEFAULT format
+      dstData[7]  = 0;
+      dstData[8]  = 0;
+      dstData[9]  = 0;
+      dstData[10] = 0;
+    };  
     break;
 
-  case DATETIME_FORMAT_USA:
+  case DATETIME_FORMAT_USA:   // MM/DD/YYYY AM|PM
   case DATETIME_FORMAT_USA2:  // MM/DD/YYYY
   case DATETIME_FORMAT_USA6:  // MM/DD/YY
   case DATETIME_FORMAT_USA7:  // MM-DD-YYYY
-  case DATETIME_FORMAT_TS6:   // MMDDYYYY HH24:MI:SS
-  case DATETIME_FORMAT_TS7:   // MM/DD/YYYY HH24:MI:SS
     {
-      // this is USA format: mm/dd/yyyy. first, the month
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-        return -1;
-      }
+      char sep = (srcFormat == DATETIME_FORMAT_USA7 ? '-' : '/');
 
-      char delim = (srcFormat == DATETIME_FORMAT_USA7 ? '-' 
-		    : (srcFormat == DATETIME_FORMAT_TS6 ? 0 : '/'));
-      srcData += 2;  // move on to the delimiter field
-      if (delim != 0)
-	{
-	  if (*srcData != delim) {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	}
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], &sep, heap,diagsArea))
+        return -1;
 
       // the day
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[3] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], &sep, heap, diagsArea))
         return -1;
-      }
 
-      srcData += 2;  // move on to the delimiter field
+      // the year
+      Int32 numOfYdigits = (srcFormat == DATETIME_FORMAT_USA6 ? 2 : 4);
+      if (convSrcDataToDst(numOfYdigits, srcData, 2, dstData, NULL, heap, diagsArea))
+        return -1;
+    }; 
+    break;
 
-      if (delim != 0)
-	{
-	  if (*srcData != delim) {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	}
+  case DATETIME_FORMAT_TS6:   // MMDDYYYY HH24:MI:SS
+  case DATETIME_FORMAT_TS7:   // MM/DD/YYYY HH24:MI:SS
+    {
+      char sep = '/';
+      char * septr = (srcFormat == DATETIME_FORMAT_TS7 ? &sep : NULL);
+
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], septr, heap, diagsArea))
+        return -1;
 
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], septr, heap, diagsArea))
+        return -1;
+      
       // the year
-      Int32 numOfYdigits = (srcFormat == DATETIME_FORMAT_USA6 ? 2 : 4);
-      for (year = 0, i = 0; i < numOfYdigits && isDigit8859_1(*srcData); i++, srcData++)
-#pragma nowarn(1506)   // warning elimination 
-        year = year * 10 + *srcData - '0';
-#pragma warn(1506)  // warning elimination 
+      if (convSrcDataToDst(4, srcData, 2, dstData, " ", heap, diagsArea))
+        return -1;
 
-      if (i < numOfYdigits) {
-        // string contains non-digit
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the hour
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], ":", heap, diagsArea))
         return -1;
-      }
 
-      str_cpy_all(dstData, (char *)&year, sizeof(year));
-      if ((srcFormat == DATETIME_FORMAT_TS6) ||
-	  (srcFormat == DATETIME_FORMAT_TS7))
-	{
-	  if (*srcData != ' ') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
+      // the minute
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], ":", heap, diagsArea))
+        return -1;
 
-	  // the hour
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[4] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
+      // the second
+      if (convSrcDataToDst(2, srcData, 1, &dstData[6], NULL, heap, diagsArea))
+        return -1;
 
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the minute
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[5] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the second
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[6] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  
-	  dstData[7]  = 0;
-	  dstData[8]  = 0;
-	  dstData[9]  = 0;
-	  dstData[10] = 0;
-	}
-    };  // case USA format
+      dstData[7]  = 0;
+      dstData[8]  = 0;
+      dstData[9]  = 0;
+      dstData[10] = 0;
+     };
     break;
 
-  case DATETIME_FORMAT_USA3:
-  case DATETIME_FORMAT_USA4:
-  case DATETIME_FORMAT_USA5:
-  case DATETIME_FORMAT_USA8:
+  case DATETIME_FORMAT_USA3: // YYYY/MM/DD
+  case DATETIME_FORMAT_USA4: // YYYYMMDD
+  case DATETIME_FORMAT_USA5: // YY/MM/DD
     {
-      // this is USA format: See exp_datetime.h for details.
+      // the year
+      Lng32 numYearDigits = (srcFormat == DATETIME_FORMAT_USA5 ? 2 : 4);
+      char sep = '/';
+      char * septr = (srcFormat == DATETIME_FORMAT_USA4 ? NULL : &sep);
 
       // the year
-      Lng32 numYearDigits = 4;
-      if (srcFormat == DATETIME_FORMAT_USA5)
-	numYearDigits = 2;
-      for (year = 0, i = 0; 
-	   i < numYearDigits && isDigit8859_1(*srcData); i++, srcData++)
-#pragma nowarn(1506)   // warning elimination 
-        year = year * 10 + *srcData - '0';
-#pragma warn(1506)  // warning elimination 
+      if (convSrcDataToDst(numYearDigits, srcData, 2, dstData, septr, heap, diagsArea))
+        return -1;
 
-      if (i < numYearDigits) {
-        // string contains non-digit
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], septr, heap, diagsArea))
         return -1;
-      }
 
-      str_cpy_all(dstData, (char *)&year, sizeof(year));
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], NULL, heap, diagsArea))
+        return -1;
 
-      if ((srcFormat != DATETIME_FORMAT_USA4) &&
-	  (srcFormat != DATETIME_FORMAT_USA8)) {
-	if (*srcData != '/') {
-	  // string contains invalid delimiter
-	  //
-	  ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	  return -1;
-	}
-	srcData++;  // move on to the next field
-      }
+     };
+    break;
 
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+  case DATETIME_FORMAT_USA8: // YYYYMM
+    {
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, NULL, heap, diagsArea))
         return -1;
-      }
 
-      srcData += 2;  // move on to the delimiter field
-      if ((srcFormat != DATETIME_FORMAT_USA4) &&
-	  (srcFormat != DATETIME_FORMAT_USA8)) {
-	if (*srcData != '/') {
-	  // string contains invalid delimiter
-	  //
-	  ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	  return -1;
-	}
-	srcData++;  // move on to the next field
-      }
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], NULL, heap, diagsArea))
+        return -1;
 
       // the day
-      if (srcFormat == DATETIME_FORMAT_USA8)
-	{
-	  // day is not specified, fill in as '1' (first day of month).
-	  dstData[3] = 1;
-	}
-      else
-	{
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[3] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	}
-     };  // case USA format
+      // day is not specified, fill in as '1' (first day of month).
+      dstData[3] = 1;
+    };
     break;
 
-  case DATETIME_FORMAT_TS1:
-  case DATETIME_FORMAT_TS5:
+  case DATETIME_FORMAT_TS1: // YYYYMMDDHH24MISS
+  case DATETIME_FORMAT_TS5: // YYYYMMDD:HH24:MI:SS
     {
-      // this is TS1 format: YYYYMMDDHH24MISS
-      //         TS5 format: YYYYMMDD:HH24:MI:SS
-      // See exp_datetime.h for details.
-
+      char sep = ':';
+      char * septr = (srcFormat == DATETIME_FORMAT_TS1 ? NULL : &sep);
+      
       // the year
-      Lng32 numYearDigits = 4;
-      for (year = 0, i = 0; 
-	   i < numYearDigits && isDigit8859_1(*srcData); i++, srcData++)
-#pragma nowarn(1506)   // warning elimination 
-        year = year * 10 + *srcData - '0';
-#pragma warn(1506)  // warning elimination 
-
-      if (i < numYearDigits) {
-        // string contains non-digit
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(4, srcData, 2, dstData, NULL, heap, diagsArea))
         return -1;
-      }
-
-      str_cpy_all(dstData, (char *)&year, sizeof(year));
 
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], NULL, heap, diagsArea))
         return -1;
-      }
-
-      srcData += 2;  // move on to the delimiter field
 
       // the day
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[3] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], septr, heap, diagsArea))
         return -1;
-      }
-
-      srcData += 2;
-
-      if (srcFormat == DATETIME_FORMAT_TS5)
-	{
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	}
-
+      
       // the hour
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[4] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], septr, heap, diagsArea))
         return -1;
-      }
-
-      srcData += 2;
-      
-      if (srcFormat == DATETIME_FORMAT_TS5)
-	{
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	}
 
       // the minute
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[5] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], septr, heap, diagsArea))
         return -1;
-      }
 
-      srcData += 2;
+      // the second
+      if (convSrcDataToDst(2, srcData, 1, &dstData[6], NULL, heap, diagsArea))
+        return -1;
 
-      if (srcFormat == DATETIME_FORMAT_TS5)
-	{
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	}
+      dstData[7]  = 0;
+      dstData[8]  = 0;
+      dstData[9]  = 0;
+      dstData[10] = 0;
+     };  
+    break;
 
-      // the second
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[6] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
+  case DATETIME_FORMAT_TS9: // MONTH DD, YYYY, HH:MI AM|PM
+    {
+      // the month
+      char * prevSrcData = srcData;
+      if (! convertStrToMonthLongFormat(srcData, &dstData[2])) {
         ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
         return -1;
       }
+      minLength += (srcData - prevSrcData);
+      srcData += 1; // skip blank after "Month"
 
-      srcData += 2;
+      // the day
+     if (convSrcDataToDst(2, srcData, 1, &dstData[3], ",", heap, diagsArea))
+        return -1;
+      srcData++;  // skip over blank
 
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, ",", heap, diagsArea))
+        return -1;
+      srcData++;  // skip over blank
+      
+      // the hour
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], ":", heap, diagsArea))
+        return -1;
+      
+      // the minute
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], NULL, heap, diagsArea))
+        return -1;
+      
+      dstData[6]  = 0;
       dstData[7]  = 0;
       dstData[8]  = 0;
       dstData[9]  = 0;
       dstData[10] = 0;
 
-     };  // case TS1 format
+    }
     break;
 
-  case DATETIME_FORMAT_EUROPEAN:
-  case DATETIME_FORMAT_EUROPEAN2:
-  case DATETIME_FORMAT_EUROPEAN3:
-  case DATETIME_FORMAT_EUROPEAN4:
-  case DATETIME_FORMAT_TS2:
+  case DATETIME_FORMAT_EUROPEAN:  // DD.MM.YYYY
+  case DATETIME_FORMAT_EUROPEAN2: // DD-MM-YYYY
     {
-      // this is European format: dd.mm.yyyy. first, the day
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-        dstData[3] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-        // string contains non-digit charecter(s)
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-        return -1;
-      }
+      char sep = (srcFormat == DATETIME_FORMAT_EUROPEAN ? '.' : '-');
 
-      srcData += 2;  // move on to the delimiter field
-      if ((((srcFormat == DATETIME_FORMAT_EUROPEAN) ||
-	    (srcFormat == DATETIME_FORMAT_TS2)) &&
-	  (*srcData != '.')) ||
-	  (((srcFormat == DATETIME_FORMAT_EUROPEAN2) ||
-	    (srcFormat == DATETIME_FORMAT_EUROPEAN3)) &&
-	   (*srcData != '-'))) {
-        // string contains invalid delimiter
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], &sep, heap, diagsArea))
         return -1;
-      }
-
-      if (srcFormat != DATETIME_FORMAT_EUROPEAN4)
-	srcData++;  // move on to the next field
+      
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], &sep, heap, diagsArea))
+        return -1;
+      
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, NULL, heap, diagsArea))
+        return -1;
+    };  
+    break;
 
+  case DATETIME_FORMAT_EUROPEAN3: // DD-MON-YYYY
+  case DATETIME_FORMAT_EUROPEAN4: // DDMONYYYY
+    {
+      char sep = '-';
+      char * septr = (srcFormat == DATETIME_FORMAT_EUROPEAN3 ? &sep : NULL);
+      
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], septr, heap, diagsArea))
+        return -1;
+      
       // the month
-      if ((srcFormat == DATETIME_FORMAT_EUROPEAN3) ||
-	  (srcFormat == DATETIME_FORMAT_EUROPEAN4))
-	{
-	  if (! convertStrToMonth(srcData, &dstData[2])) {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData += 3;  // move on to the delimiter field
-	}
-      else
-	{
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData += 2;  // move on to the delimiter field
-	}
+      if (! convertStrToMonth(srcData, &dstData[2], septr, heap, diagsArea))
+        return -1;
 
-      if ((((srcFormat == DATETIME_FORMAT_EUROPEAN) ||
-	    (srcFormat == DATETIME_FORMAT_TS2)) &&
-	  (*srcData != '.')) ||
-	  (((srcFormat == DATETIME_FORMAT_EUROPEAN2) ||
-	    (srcFormat == DATETIME_FORMAT_EUROPEAN3)) &&
-	   (*srcData != '-'))) {
-        // string contains invalid delimiter
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, NULL, heap, diagsArea))
         return -1;
-      }
- 
-     if (srcFormat != DATETIME_FORMAT_EUROPEAN4)
-       srcData++;  // move on to the next field
+    };  
+    break;
 
+  case DATETIME_FORMAT_TS2: // DD.MM.YYYY:HH24:MI:SS
+    {
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], ".", heap, diagsArea))
+        return -1;
+      
+      // the month
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], ".", heap, diagsArea))
+        return -1;
+      
       // the year
-      for (year = 0, i = 0; i < 4 && isDigit8859_1(*srcData); i++, srcData++)
-#pragma nowarn(1506)   // warning elimination 
-        year = year * 10 + *srcData - '0';
-#pragma warn(1506)  // warning elimination 
+      if (convSrcDataToDst(4, srcData, 2, dstData, ":", heap, diagsArea))
+        return -1;
 
-      if (i < 4) {
-        // string contains non-digit
-        //
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+      // the hour
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], ":", heap, diagsArea))
         return -1;
-      }
 
-      str_cpy_all(dstData, (char *)&year, sizeof(year));
+      // the minute
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], ":", heap, diagsArea))
+        return -1;
 
-      if (srcFormat == DATETIME_FORMAT_TS2)
-	{
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
+      // the second
+      if (convSrcDataToDst(2, srcData, 1, &dstData[6], NULL, heap, diagsArea))
+        return -1;
 
-	  // the hour
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[4] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
+      dstData[7]  = 0;
+      dstData[8]  = 0;
+      dstData[9]  = 0;
+      dstData[10] = 0;
+    };  
+    break;
 
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the minute
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[5] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  if (*srcData != ':') {
-	    // string contains invalid delimiter
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  srcData++;  // move on to the next field
-	  
-	  // the second
-	  if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	    dstData[6] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-	  } else {
-	    // string contains non-digit charecter(s)
-	    //
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	    return -1;
-	  }
-	  
-	  srcData += 2;
-	  
-	  dstData[7]  = 0;
-	  dstData[8]  = 0;
-	  dstData[9]  = 0;
-	  dstData[10] = 0;
-	}
+  case DATETIME_FORMAT_TS8: // DD-MON-YYYY HH:MI:SS
+    {
+      // the day
+      if (convSrcDataToDst(2, srcData, 1, &dstData[3], "-", heap, diagsArea))
+        return -1;
+      
+      // the month
+      if (! convertStrToMonth(srcData, &dstData[2], "-", heap, diagsArea))
+        return -1;
       
-    };  // case EUROPEAN format
+      // the year
+      if (convSrcDataToDst(4, srcData, 2, dstData, " ", heap, diagsArea))
+        return -1;
+
+      // the hour
+      if (convSrcDataToDst(2, srcData, 1, &dstData[4], ":", heap, diagsArea))
+        return -1;
+
+      // the minute
+      if (convSrcDataToDst(2, srcData, 1, &dstData[5], ":", heap, diagsArea))
+        return -1;
+
+      // the second
+      if (convSrcDataToDst(2, srcData, 1, &dstData[6], NULL, heap, diagsArea))
+        return -1;
+
+      dstData[7]  = 0;
+      dstData[8]  = 0;
+      dstData[9]  = 0;
+      dstData[10] = 0;
+     };  
     break;
 
-  case DATETIME_FORMAT_TS4:
+  case DATETIME_FORMAT_TS4: // HH24:MI:SS
     {
       // the hour
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	dstData[0] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-	// string contains non-digit charecter(s)
-	//
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	return -1;
-      }
-      
-      srcData += 2;
-      
-      if (*srcData != ':') {
-	// string contains invalid delimiter
-	//
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	return -1;
-      }
-      srcData++;  // move on to the next field
-      
+      if (convSrcDataToDst(2, srcData, 1, &dstData[0], ":", heap, diagsArea))
+        return -1;
+
       // the minute
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	dstData[1] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-	// string contains non-digit charecter(s)
-	//
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	return -1;
-      }
-      
-      srcData += 2;
-      if (*srcData != ':') {
-	// string contains invalid delimiter
-	//
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	return -1;
-      }
-      srcData++;  // move on to the next field
-      
+      if (convSrcDataToDst(2, srcData, 1, &dstData[1], ":", heap, diagsArea))
+        return -1;
+
       // the second
-      if (isDigit8859_1(*srcData) && isDigit8859_1(*(srcData+1))) {
-#pragma nowarn(1506)   // warning elimination 
-	dstData[2] = char (*srcData - '0') * 10 + (*(srcData+1) - '0');
-#pragma warn(1506)  // warning elimination 
-      } else {
-	// string contains non-digit charecter(s)
-	//
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_STRING_ERROR);
-	ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
-	return -1;
-      }
-      
-      srcData += 2;
-      
-      dstData[3]  = 0;
-      dstData[4]  = 0;
-      dstData[5]  = 0;
-      dstData[6] = 0;
-      
+      if (convSrcDataToDst(2, srcData, 1, &dstData[2], NULL, heap, diagsArea))
+        return -1;
     };
   break;
 
@@ -3293,6 +3030,32 @@ convertMonthToStr(Lng32 value, char *&result, UInt32 width)
   result += width;
 }
 
+static void 
+convertMonthToStrLongFormat(Lng32 value, char *&result, UInt32 width)
+{
+  const char * months[] = 
+  {
+    "January", 
+    "February", 
+    "March", 
+    "April", 
+    "May", 
+    "June", 
+    "July", 
+    "August", 
+    "September", 
+    "October",
+    "November", 
+    "December"
+  };
+
+  strcpy(result, months[value-1]);
+
+  // Update result pointer to point to end of string.
+  //
+  result += strlen(months[value-1]);
+}
+
 Lng32 ExpDatetime::getDatetimeFormatLen(Lng32 format, NABoolean to_date,
 				       rec_datetime_field startField,
 				       rec_datetime_field endField)
@@ -3305,13 +3068,8 @@ Lng32 ExpDatetime::getDatetimeFormatLen(Lng32 format, NABoolean to_date,
       {
 	if (to_date)
 	  {
-	    if (format == DATETIME_FORMAT_DEFAULT)
-	      return DATETIME_FORMAT_DEFAULT_LEN;
-	    else if (format == DATETIME_FORMAT_USA)
-	      return DATETIME_FORMAT_USA_LEN;
-	    else //if (format == DATETIME_FORMAT_EUROPEAN)
-	      return DATETIME_FORMAT_EUROPEAN_LEN;
-	  }
+            return ExpDatetime::getDatetimeFormatLen(format);
+ 	  }
 	else
 	  {
 	    Lng32 minReqDstLen = 0;
@@ -3348,34 +3106,12 @@ Lng32 ExpDatetime::getDatetimeFormatLen(Lng32 format, NABoolean to_date,
 	  }
       }
     break;
-    case DATETIME_FORMAT_DEFAULT2:  return DATETIME_FORMAT_DEFAULT2_LEN;
-
-    case DATETIME_FORMAT_USA2:      return DATETIME_FORMAT_USA2_LEN;
-    case DATETIME_FORMAT_USA3:      return DATETIME_FORMAT_USA3_LEN;
-    case DATETIME_FORMAT_USA4:      return DATETIME_FORMAT_USA4_LEN;
-    case DATETIME_FORMAT_USA5:      return DATETIME_FORMAT_USA5_LEN;
-    case DATETIME_FORMAT_USA6:      return DATETIME_FORMAT_USA6_LEN;
-    case DATETIME_FORMAT_USA7:      return DATETIME_FORMAT_USA7_LEN;
-    case DATETIME_FORMAT_USA8:      return DATETIME_FORMAT_USA8_LEN;
-
-    case DATETIME_FORMAT_EUROPEAN2: return DATETIME_FORMAT_EUROPEAN2_LEN;
-    case DATETIME_FORMAT_EUROPEAN3: return DATETIME_FORMAT_EUROPEAN3_LEN;
-    case DATETIME_FORMAT_EUROPEAN4: return DATETIME_FORMAT_EUROPEAN4_LEN;
-
-    case DATETIME_FORMAT_TIME1:     return DATETIME_FORMAT_TIME1_LEN;
-    case DATETIME_FORMAT_TIME2:     return DATETIME_FORMAT_TIME2_LEN;
-
-    case DATETIME_FORMAT_TS1:       return DATETIME_FORMAT_TS1_LEN;
-    case DATETIME_FORMAT_TS2:       return DATETIME_FORMAT_TS2_LEN;
-    case DATETIME_FORMAT_TS3:       return DATETIME_FORMAT_TS3_LEN;
-    case DATETIME_FORMAT_TS4:       return DATETIME_FORMAT_TS4_LEN;
-    case DATETIME_FORMAT_TS5:       return DATETIME_FORMAT_TS5_LEN;
-    case DATETIME_FORMAT_TS6:       return DATETIME_FORMAT_TS6_LEN;
-    case DATETIME_FORMAT_TS7:       return DATETIME_FORMAT_TS7_LEN;
-    case DATETIME_FORMAT_TS8:       return DATETIME_FORMAT_TS8_LEN;
-
-    default:                        return -1;
+
+    default:
+      return ExpDatetime::getDatetimeFormatLen(format);
     }
+
+  return 0;
 }
 
 // convDatetimeToASCII() ============================================
@@ -3572,6 +3308,20 @@ ExpDatetime::convDatetimeToASCII(char *srcData,
     }
     break;
 
+  case DATETIME_FORMAT_TS9:
+    {
+      convertMonthToStrLongFormat(month, dstDataPtr, 3);
+      *dstDataPtr++ = ' ';
+      
+      convertToAscii(day, dstDataPtr, 2);
+      *dstDataPtr++ = ',';
+      *dstDataPtr++ = ' ';
+      
+      convertToAscii(year, dstDataPtr, 4);
+      *dstDataPtr++ = ',';
+    }
+    break;
+
   case DATETIME_FORMAT_TS4:
     {
       // do nothing for date part.
@@ -3707,6 +3457,29 @@ ExpDatetime::convDatetimeToASCII(char *srcData,
     dstDataPtr += 3;
   }
 
+  // if format includes time field but source is a DATE datatype, extend
+  // the returned string with zeroes
+  if (isTimestampFormat(format))
+    {
+      if (format == DATETIME_FORMAT_TS1)
+        {
+        }
+      else if ((format == DATETIME_FORMAT_TS2) ||
+          (format == DATETIME_FORMAT_TS5))
+        {
+          *dstDataPtr = ':';
+          dstDataPtr++;
+        }
+      else
+        {
+          *dstDataPtr = ' ';
+          dstDataPtr++;
+        }
+      
+      str_cpy_all(dstDataPtr, "00:00:00", 8);
+      dstDataPtr += 8;
+    }
+      
   // Return the actual number of bytes formatted.
   //
   return dstDataPtr - dstData;
@@ -3745,15 +3518,15 @@ ExpDatetime::convNumericTimeToASCII(char *srcData,
 				    CollHeap *heap,
 				    ComDiagsArea** diagsArea)
 {
-  if ((format != DATETIME_FORMAT_TIME1) &&
-      (format != DATETIME_FORMAT_TIME2))
+  if ((format != DATETIME_FORMAT_NUM1) &&
+      (format != DATETIME_FORMAT_NUM2))
     return -1;
 
-  if ((format == DATETIME_FORMAT_TIME1) &&
+  if ((format == DATETIME_FORMAT_NUM1) &&
       (dstLen < 11))
     return -1;
 
-  if ((format == DATETIME_FORMAT_TIME2) &&
+  if ((format == DATETIME_FORMAT_NUM2) &&
       (dstLen < 12))
     return -1;
 
@@ -3761,9 +3534,16 @@ ExpDatetime::convNumericTimeToASCII(char *srcData,
   NABoolean negative = FALSE;
   if (temp < 0)
     {
+      // cannot convert negative number with NUM1 format
+      if (format == DATETIME_FORMAT_NUM1)
+        {
+          ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+          return -1;
+        }
+
       temp = -temp;
 
-     if (format == DATETIME_FORMAT_TIME2)
+     if (format == DATETIME_FORMAT_NUM2)
        {
 	 negative = TRUE;
        }
@@ -3792,7 +3572,14 @@ ExpDatetime::convNumericTimeToASCII(char *srcData,
       part1 = (Lng32)(temp - (temp/100)*100);
       temp = temp/100;
   
-      if (format == DATETIME_FORMAT_TIME2)
+      // if more digits left in input, error out.
+      if (temp > 0)
+        {
+          ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
+          return -1;
+        }
+
+      if (format == DATETIME_FORMAT_NUM2)
 	{
 	  if (negative)
 	    str_sprintf(dstData, "-%02d:%02d:%02d:%02d", part1, part2, part3, part4);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/exp_datetime.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_datetime.h b/core/sql/exp/exp_datetime.h
index 28ec909..8f6fa1b 100644
--- a/core/sql/exp/exp_datetime.h
+++ b/core/sql/exp/exp_datetime.h
@@ -49,67 +49,65 @@
 class SQLEXP_LIB_FUNC  ExpDatetime : public SimpleType {
 
 public:
-  enum asciiFormats 
+  // these enums must be in the same order as the datetimeFormat[] array 
+  // (defined in exp_datetime.cpp).
+  enum DatetimeFormats 
   { 
-    DATETIME_FORMAT_DEFAULT  = 0,  // YYYY-MM-DD
-    DATETIME_FORMAT_USA      = 1,  // MM/DD/YYYY AM|PM
-    DATETIME_FORMAT_EUROPEAN = 2,  // DD.MM.YYYY
-    DATETIME_FORMAT_DEFAULT2,      // YYYY-MM
-    DATETIME_FORMAT_USA2,          // MM/DD/YYYY
-    DATETIME_FORMAT_USA3,          // YYYY/MM/DD
-    DATETIME_FORMAT_USA4,          // YYYYMMDD
-    DATETIME_FORMAT_USA5,          // YY/MM/DD
-    DATETIME_FORMAT_USA6,          // MM/DD/YY
-    DATETIME_FORMAT_USA7,          // MM-DD-YYYY
-    DATETIME_FORMAT_USA8,          // YYYYMM
-    DATETIME_FORMAT_EUROPEAN2,     // DD-MM-YYYY
-    DATETIME_FORMAT_EUROPEAN3,     // DD-MON-YYYY
-    DATETIME_FORMAT_EUROPEAN4,     // DDMONYYYY
-    DATETIME_FORMAT_TIME1,         // 99:99:99:99
-    DATETIME_FORMAT_TIME2,         // -99:99:99:99
-    DATETIME_FORMAT_TS1,           // YYYYMMDDHH24MISS
-    DATETIME_FORMAT_TS2,           // DD.MM.YYYY:HH24:MI:SS
-    DATETIME_FORMAT_TS3,           // YYYY-MM-DD HH24:MI:SS
-    DATETIME_FORMAT_TS4,           // HH24:MI:SS
-    DATETIME_FORMAT_TS5,           // YYYYMMDD:HH24:MI:SS
-    DATETIME_FORMAT_TS6,           // MMDDYYYY HH24:MI:SS
-    DATETIME_FORMAT_TS7,           // MM/DD/YYYY HH24:MI:SS
-    DATETIME_FORMAT_TS8,           // DD-MON-YYYY HH:MI:SS
-    DATETIME_FORMAT_DATE_STR,      // format in str
-    DATETIME_FORMAT_TIME_STR,      // format in str
+    DATETIME_FORMAT_MIN       =  0,
+    DATETIME_FORMAT_MIN_DATE  =  DATETIME_FORMAT_MIN,
+    DATETIME_FORMAT_DEFAULT   =  DATETIME_FORMAT_MIN_DATE, // YYYY-MM-DD
+    DATETIME_FORMAT_USA,        // MM/DD/YYYY AM|PM
+    DATETIME_FORMAT_EUROPEAN,   // DD.MM.YYYY
+    DATETIME_FORMAT_DEFAULT2,   // YYYY-MM
+    DATETIME_FORMAT_USA2,       // MM/DD/YYYY
+    DATETIME_FORMAT_USA3,       // YYYY/MM/DD
+    DATETIME_FORMAT_USA4,       // YYYYMMDD
+    DATETIME_FORMAT_USA5,       // YY/MM/DD
+    DATETIME_FORMAT_USA6,       // MM/DD/YY
+    DATETIME_FORMAT_USA7,       // MM-DD-YYYY
+    DATETIME_FORMAT_USA8,       // YYYYMM
+    DATETIME_FORMAT_EUROPEAN2,  // DD-MM-YYYY
+    DATETIME_FORMAT_EUROPEAN3,  // DD-MON-YYYY
+    DATETIME_FORMAT_EUROPEAN4,  // DDMONYYYY
+    DATETIME_FORMAT_MAX_DATE  = DATETIME_FORMAT_EUROPEAN4,
+
+    DATETIME_FORMAT_MIN_TIME,
+    DATETIME_FORMAT_TS4       = DATETIME_FORMAT_MIN_TIME, // HH24:MI:SS
+    DATETIME_FORMAT_MAX_TIME  = DATETIME_FORMAT_TS4,
+
+    DATETIME_FORMAT_MIN_TS,
+    DATETIME_FORMAT_TS1       = DATETIME_FORMAT_MIN_TS, // YYYYMMDDHH24MISS
+    DATETIME_FORMAT_TS2,     // DD.MM.YYYY:HH24:MI:SS
+    DATETIME_FORMAT_TS3,     // YYYY-MM-DD HH24:MI:SS
+    DATETIME_FORMAT_TS5,     // YYYYMMDD:HH24:MI:SS
+    DATETIME_FORMAT_TS6,     // MMDDYYYY HH24:MI:SS
+    DATETIME_FORMAT_TS7,     // MM/DD/YYYY HH24:MI:SS
+    DATETIME_FORMAT_TS8,     // DD-MON-YYYY HH:MI:SS
+    DATETIME_FORMAT_TS9,     // MONTH DD, YYYY, HH:MI AM|PM
+    DATETIME_FORMAT_MAX_TS    = DATETIME_FORMAT_TS9,
+
+    DATETIME_FORMAT_MAX       = DATETIME_FORMAT_MAX_TS,
+
+    DATETIME_FORMAT_MIN_NUM = DATETIME_FORMAT_MAX,
+    DATETIME_FORMAT_NUM1,     // 99:99:99:99
+    DATETIME_FORMAT_NUM2,     // -99:99:99:99
+    DATETIME_FORMAT_MAX_NUM = DATETIME_FORMAT_NUM2,
+
+    DATETIME_FORMAT_DATE_STR, // format in str
+    DATETIME_FORMAT_TIME_STR, // format in str
     DATETIME_FORMAT_NONE,
-    DATETIME_FORMAT_ERROR
+    DATETIME_FORMAT_ERROR     = -1
   };
-  enum asciiFormtLen {
-    DATETIME_FORMAT_DEFAULT_LEN   = 10,  // YYYY-MM-DD
-    DATETIME_FORMAT_USA_LEN       = 10,  // MM/DD/YYYY AM|PM
-    DATETIME_FORMAT_EUROPEAN_LEN  = 10,  // DD.MM.YYYY
-    DATETIME_FORMAT_DEFAULT2_LEN  =  7,  // YYYY-MM
-    DATETIME_FORMAT_USA2_LEN      = 10,  // MM/DD/YYYY
-    DATETIME_FORMAT_USA3_LEN      = 10,  // YYYY/MM/DD
-    DATETIME_FORMAT_USA4_LEN      =  8,  // YYYYMMDD
-    DATETIME_FORMAT_USA5_LEN      =  8,  // YY/MM/DD
-    DATETIME_FORMAT_USA6_LEN      =  8,  // MM/DD/YY
-    DATETIME_FORMAT_USA7_LEN      = 10,  // MM-DD-YYYY
-    DATETIME_FORMAT_USA8_LEN      =  6,  // YYYYMM
-    DATETIME_FORMAT_EUROPEAN2_LEN = 10,  // DD-MM-YYYY
-    DATETIME_FORMAT_EUROPEAN3_LEN = 11,  // DD-MON-YYYY
-    DATETIME_FORMAT_EUROPEAN4_LEN =  9,  // DDMONYYYY
-    DATETIME_FORMAT_TIME1_LEN     = 11,  // 99:99:99:99
-    DATETIME_FORMAT_TIME2_LEN     = 12,  // -99:99:99:99
-    DATETIME_FORMAT_TS1_LEN       = 14,  // YYYYMMDDHH24MISS
-    DATETIME_FORMAT_TS2_LEN       = 19,  // DD.MM.YYYY:HH24:MI:SS
-    DATETIME_FORMAT_TS3_LEN       = 19,  // YYYY-MM-DD HH24:MI:SS
-    DATETIME_FORMAT_TS4_LEN       =  8,  // HH24:MI:SS
-    DATETIME_FORMAT_TS5_LEN       = 17,  // YYYYMMDD:HH24:MI:SS
-    DATETIME_FORMAT_TS6_LEN       = 17,  // MMDDYYYY HH24:MI:SS
-    DATETIME_FORMAT_TS7_LEN       = 19,  // MM/DD/YYYY HH24:MI:SS
-    DATETIME_FORMAT_TS8_LEN       = 20,  // DD-MON-YYYY HH:MI:SS
-    DATETIME_FORMAT_DATE_STR_LEN  = -1,  // format in str
-    DATETIME_FORMAT_TIME_STR_LEN  = -1,  // format in str
-    DATETIME_FORMAT_NONE_LEN      = -1,
-    DATETIME_FORMAT_ERROR_LEN     = -1
+
+  struct DatetimeFormatInfo
+  {
+    Lng32 format;       // defined by enum DatetimeFormats
+    const char * str;   // string representation of datetime format
+    Lng32 minLen;       // minimum length to hold this format
+    Lng32 maxLen;
   };
+  
+  static const DatetimeFormatInfo datetimeFormat[];
 
   enum { DATETIME_MAX_NUM_FIELDS = 7 };
   enum { MAX_DATETIME_SIZE = 11 };
@@ -224,6 +222,7 @@ NA_EIDPROC
                              rec_datetime_field dstEndField,
                              short dstFractPrec,
                              char *dstData,
+                             Lng32 dstLen,
 			     short validateFlag,
                              NABoolean *roundedDownFlag = NULL);
 
@@ -302,9 +301,7 @@ static
 				 CollHeap *heap,
 				 ComDiagsArea** diagsArea);
   
-#ifndef __EID
   char *getDefaultStringValue(CollHeap *heap);
-#endif
 
   // ---------------------------------------------------------------------
   // Redefinition of methods inherited from NAVersionedObject.
@@ -323,11 +320,81 @@ static
   NA_EIDPROC virtual short getClassSize() { return (short)sizeof(*this); }
   // ---------------------------------------------------------------------
 
+  static const char * getDatetimeFormatStr(Lng32 frmt)
+  {
+    return datetimeFormat[frmt].str;
+  }
+
+  static const Lng32 getDatetimeFormat(const char * formatStr)
+  {
+    for (Lng32 i = DATETIME_FORMAT_MIN; i <= DATETIME_FORMAT_MAX; i++)
+      {
+        if (strcmp(formatStr, datetimeFormat[i].str) == 0)
+          {
+            if (datetimeFormat[i].format != i)
+              return -1;
+
+            return i;
+          }
+      }
+
+    for (Lng32 i = DATETIME_FORMAT_MIN_NUM; i <= DATETIME_FORMAT_MAX_NUM; i++)
+      {
+        if (strcmp(formatStr, datetimeFormat[i].str) == 0)
+          {
+            if (datetimeFormat[i].format != i)
+              return -1;
+
+            return i;
+          }
+      }
+
+    return -1;
+  }
+  
+  static NABoolean isDateTimeFormat(Lng32 frmt)
+  {
+    return ((frmt >= DATETIME_FORMAT_MIN) &&
+            (frmt <= DATETIME_FORMAT_MAX));
+  }
+
+  static NABoolean isDateFormat(Lng32 frmt)
+  {
+    return ((frmt >= DATETIME_FORMAT_MIN_DATE) &&
+            (frmt <= DATETIME_FORMAT_MAX_DATE));
+  }
+
+  static NABoolean isTimestampFormat(Lng32 frmt)
+  {
+    return ((frmt >= DATETIME_FORMAT_MIN_TS) &&
+            (frmt <= DATETIME_FORMAT_MAX_TS));
+  }
+
+  static NABoolean isTimeFormat(Lng32 frmt)
+  {
+    return ((frmt >= DATETIME_FORMAT_MIN_TIME) &&
+            (frmt <= DATETIME_FORMAT_MAX_TIME));
+  }
+
+  static NABoolean isNumericFormat(Lng32 frmt)
+  {
+    return ((frmt == DATETIME_FORMAT_NUM1) || (frmt == DATETIME_FORMAT_NUM2));
+  }
+
+  static Lng32 getDatetimeFormatLen(Lng32 frmt)
+  {
+    return datetimeFormat[frmt].minLen;
+  }
+
+  static Lng32 getDatetimeFormatMaxLen(Lng32 frmt)
+  {
+    return datetimeFormat[frmt].maxLen;
+  }
+
 private:
 
 };
 
-
 #pragma warning ( default : 4251 )
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/exp_function.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_function.cpp b/core/sql/exp/exp_function.cpp
index 97be8c5..4e3211d 100644
--- a/core/sql/exp/exp_function.cpp
+++ b/core/sql/exp/exp_function.cpp
@@ -2534,9 +2534,8 @@ ex_expr::exp_return_type ex_function_dateformat::eval(char *op_data[],
   char *formatStr = op_data[2];
   char *result = op_data[0];
   
-  if ((getDateFormat() == ExpDatetime::DATETIME_FORMAT_TIME1) ||
-      (getDateFormat() == ExpDatetime::DATETIME_FORMAT_TIME2) ||
-      (getDateFormat() == ExpDatetime::DATETIME_FORMAT_TIME_STR))
+  if ((getDateFormat() == ExpDatetime::DATETIME_FORMAT_NUM1) ||
+      (getDateFormat() == ExpDatetime::DATETIME_FORMAT_NUM2))
     {
       // numeric to TIME conversion.
       if(ExpDatetime::convNumericTimeToASCII(opData, 
@@ -2563,9 +2562,11 @@ ex_expr::exp_return_type ex_function_dateformat::eval(char *op_data[],
       if ((DFS2REC::isAnyCharacter(getOperand(1)->getDatatype())) &&
 	  (DFS2REC::isDateTime(getOperand(0)->getDatatype())))
 	{
+          Lng32 sourceLen = getOperand(1)->getLength(op_data[-MAX_OPERANDS+1]);
+
 	  ExpDatetime *datetimeOpType = (ExpDatetime *) getOperand(0);
 	  if(datetimeOpType->convAsciiToDate(opData, 
-                                             getOperand(1)->getLength(),
+                                             sourceLen,
                                              result,
                                              getOperand(0)->getLength(),
                                              getDateFormat(),
@@ -2573,10 +2574,13 @@ ex_expr::exp_return_type ex_function_dateformat::eval(char *op_data[],
                                              diagsArea,
                                              0) < 0) {
             
-	    ExRaiseFunctionSqlError(heap, diagsArea, EXE_INTERNAL_ERROR,
-				    derivedFunction(),
-				    origFunctionOperType());
-	    
+            if (diagsArea && (*diagsArea) && 
+                (*diagsArea)->getNumber(DgSqlCode::ERROR_) == 0)
+              {
+                ExRaiseFunctionSqlError(heap, diagsArea, EXE_INTERNAL_ERROR,
+                                        derivedFunction(),
+                                        origFunctionOperType());
+              }
 	    return ex_expr::EXPR_ERROR;
 	  }
 	}
@@ -2584,7 +2588,7 @@ ex_expr::exp_return_type ex_function_dateformat::eval(char *op_data[],
 	{
 	  ExpDatetime *datetimeOpType = (ExpDatetime *) getOperand(1);
 	  if(datetimeOpType->convDatetimeToASCII(opData, 
-					     result,
+                                                 result,
 						 getOperand(0)->getLength(),
 						 getDateFormat(),
 						 formatStr,
@@ -4434,12 +4438,14 @@ Lng32 ex_function_hivehash::hashForCharType(char* data, Lng32 length)
 {
   // To compute: SUM (i from 0 to n-1) (s(i) * 31^(n-1-i)
 
+  ULng32 resultCopy = 0;
   ULng32 result = (ULng32)data[0];
   for (Lng32 i=1; i<length; i++ ) {
 
      // perform result * 31, optimized as (result <<5 - result)
-     result << 5;
-     result -= result;
+     resultCopy = result;
+     result <<= 5;
+     result -= resultCopy;
 
      result += (ULng32)(data[i]);
   }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/generator/GenExpGenerator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExpGenerator.cpp b/core/sql/generator/GenExpGenerator.cpp
index 5629bda..c03e369 100644
--- a/core/sql/generator/GenExpGenerator.cpp
+++ b/core/sql/generator/GenExpGenerator.cpp
@@ -294,7 +294,7 @@ Attributes * ExpGenerator::convertNATypeToAttributes
 
       attr->setIsoMapping((CharInfo::CharSet)SqlParser_ISO_MAPPING);
 
-      if (naType->getTypeQualifier() == NA_CHARACTER_TYPE)
+      if (naType->getTypeQualifier() == NA_CHARACTER_TYPE) 
 	{
 	  const CharType *charType = (CharType *)naType;
 
@@ -378,6 +378,7 @@ Attributes * ExpGenerator::convertNATypeToAttributes
 	  Int16 scale = lobLen & 0xFFFF;
 	  attr->setPrecision(precision);
 	  attr->setScale(scale);
+          attr->setCharSet(lobType->getCharSet());
 	}
       
       else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/generator/GenItemFunc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenItemFunc.cpp b/core/sql/generator/GenItemFunc.cpp
index 8c8f7e6..d328900 100644
--- a/core/sql/generator/GenItemFunc.cpp
+++ b/core/sql/generator/GenItemFunc.cpp
@@ -1851,143 +1851,11 @@ short DateFormat::codeGen(Generator * generator)
                                                 -1) == 1)
     return 0;
 
-  Int32 expDateFormat = ExpDatetime::DATETIME_FORMAT_ERROR;
-  switch (getDateFormat())
-    {
-    case DEFAULT: 
-      expDateFormat = ExpDatetime::DATETIME_FORMAT_DEFAULT;
-      break;
-      
-    case USA: 
-      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA;
-      break;
-      
-    case EUROPEAN: 
-      expDateFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN;
-      break;
-      
-    case DATE_FORMAT_STR:
-      {
-	if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	  {
-	    ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	    if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYY-MM-DD")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_DEFAULT;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYY-MM")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_DEFAULT2;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "MM/DD/YYYY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA2;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYY/MM/DD")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA3;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYYMMDD")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA4;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YY/MM/DD")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA5;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "MM/DD/YY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA6;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "MM-DD-YYYY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA7;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYYMM")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_USA8;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "DD.MM.YYYY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "DD-MM-YYYY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN2;
-	    else if ((NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		      == "DD-MMM-YYYY") ||
-		     (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		      == "DD-MON-YYYY"))
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN3;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		      == "DDMONYYYY")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN4;
-	    else
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_DATE_STR;
-	  }
-	else
-	  {
-	    expDateFormat = ExpDatetime::DATETIME_FORMAT_DATE_STR;
-	  }
-      }
-    break;
-    
-    case TIME_FORMAT_STR:
-      {
-	if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	  {
-	    ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	    if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "99:99:99:99")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TIME1;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "-99:99:99:99")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TIME2;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS4;
-	    else
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TIME_STR;
-	  }
-	else
-	  {
-	    expDateFormat = ExpDatetime::DATETIME_FORMAT_TIME_STR;
-	  }
-      }
-    break;
-
-    case TIMESTAMP_FORMAT_STR:
-      {
-	if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	  {
-	    ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-
-	    if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYYMMDDHH24MISS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS1;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "DD.MM.YYYY:HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS2;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYY-MM-DD HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS3;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "YYYYMMDD:HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS5;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "MMDDYYYY HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS6;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		== "MM/DD/YYYY HH24:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS7;
-	    else if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-                     == "DD-MON-YYYY HH:MI:SS")
-	      expDateFormat = ExpDatetime::DATETIME_FORMAT_TS8;
-	    else
-	      {
-		expDateFormat = ExpDatetime::DATETIME_FORMAT_DATE_STR;
-	      }
-	  }
-      }
-    break;
-    
-    };
-
   ex_clause * function_clause = 
     new(generator->getSpace()) ex_function_dateformat(getOperatorType(),
                                                       attr, 
                                                       generator->getSpace(),
-                                                      expDateFormat);
+                                                      getExpDatetimeFormat());
   generator->getExpGenerator()->linkClause(this, function_clause);
   
   return 0;
@@ -2842,6 +2710,9 @@ short LOBinsert::codeGen(Generator * generator)
   li->setLobStorageLocation((char*)lobStorageLocation().data());
   li->setLobMaxSize(getLobMaxSize());
   li->setLobMaxChunkMemSize(getLobMaxChunkMemSize());
+  li->setLobGCLimit(getLobGCLimit());
+  li->setLobHdfsServer((char *)getLobHdfsServer().data());
+  li->setLobHdfsPort(getLobHdfsPort());
   generator->getExpGenerator()->linkClause(this, li);
   
   return 0;
@@ -2867,7 +2738,8 @@ short LOBdelete::codeGen(Generator * generator)
   ld->lobNum() = lobNum();
   ld->setLobStorageType(lobStorageType());
   ld->setLobStorageLocation((char*)lobStorageLocation().data());
-  
+  ld->setLobHdfsServer((char *)getLobHdfsServer().data());
+  ld->setLobHdfsPort(getLobHdfsPort());
   generator->getExpGenerator()->linkClause(this, ld);
  
   return 0;
@@ -2911,6 +2783,9 @@ short LOBupdate::codeGen(Generator * generator)
   lu->setLobStorageLocation((char*)lobStorageLocation().data());
   lu->setLobMaxSize(getLobMaxSize());
   lu->setLobMaxChunkMemSize(getLobMaxChunkMemSize());
+  lu->setLobGCLimit(getLobGCLimit());
+  lu->setLobHdfsServer((char *)getLobHdfsServer().data());
+  lu->setLobHdfsPort(getLobHdfsPort());
   generator->getExpGenerator()->linkClause(this, lu);
  
   return 0;
@@ -2932,7 +2807,8 @@ short LOBselect::codeGen(Generator * generator)
   ls->lobNum() = lobNum();
   ls->setLobStorageType(lobStorageType());
   ls->setLobStorageLocation((char*)lobStorageLocation().data());
- 
+  ls->setLobHdfsServer((char *)getLobHdfsServer().data());
+  ls->setLobHdfsPort(getLobHdfsPort());
   generator->getExpGenerator()->linkClause(this, ls);
  
   return 0;
@@ -2960,7 +2836,8 @@ short LOBconvertHandle::codeGen(Generator * generator)
   lu->lobNum() = lobNum();
   lu->setLobStorageType(lobStorageType());
   lu->setLobStorageLocation((char*)lobStorageLocation().data());
-
+  lu->setLobHdfsServer((char *)getLobHdfsServer().data());
+  lu->setLobHdfsPort(getLobHdfsPort());
   generator->getExpGenerator()->linkClause(this, lu);
  
   return 0;
@@ -2990,6 +2867,8 @@ short LOBconvert::codeGen(Generator * generator)
   lc->setLobStorageLocation((char*)lobStorageLocation().data());
   generator->getExpGenerator()->linkClause(this, lc);
   lc->setConvertSize(getTgtSize());
+  lc->setLobHdfsServer((char *)getLobHdfsServer().data());
+  lc->setLobHdfsPort(getLobHdfsPort());
   return 0;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/generator/GenPreCode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenPreCode.cpp b/core/sql/generator/GenPreCode.cpp
index e6a3e01..2752e61 100644
--- a/core/sql/generator/GenPreCode.cpp
+++ b/core/sql/generator/GenPreCode.cpp
@@ -4824,7 +4824,7 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
     }
    NABoolean isAlignedFormat = getTableDesc()->getNATable()->isAlignedFormat(getIndexDesc());
 
-  if  (producesOutputs())
+  if  (producesOutputs()) 
     {
       retColRefSet_ = getIndexDesc()->getIndexColumns();
     }
@@ -4890,6 +4890,15 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
           // value is needed to retrieve a row. 
           HbaseAccess::addColReferenceFromVIDlist(getIndexDesc()->getIndexKey(), retColRefSet_);
         }
+
+      if (getTableDesc()->getNATable()->hasLobColumn())
+        {
+          for (Lng32 i = 0; i < getIndexDesc()->getIndexColumns().entries(); i++)
+            {
+              const ValueId vid = getIndexDesc()->getIndexColumns()[i];
+              retColRefSet_.insert(vid);
+            }
+        }
     }
 
   NABoolean inlinedActions = FALSE;
@@ -4915,8 +4924,9 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
      uniqueHbaseOper() = FALSE;
      if ((generator->oltOptInfo()->multipleRowsReturned()) &&
 	  (CmpCommon::getDefault(HBASE_ROWSET_VSBB_OPT) == DF_ON) &&
-	  (NOT generator->isRIinliningForTrafIUD()))
-	 uniqueRowsetHbaseOper() = TRUE;
+         (NOT generator->isRIinliningForTrafIUD()) &&
+         (NOT getTableDesc()->getNATable()->hasLobColumn()))
+       uniqueRowsetHbaseOper() = TRUE;
   }
   else
   if (isUnique)
@@ -4933,7 +4943,8 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
 	{
 	  if ((generator->oltOptInfo()->multipleRowsReturned()) &&
 	      (CmpCommon::getDefault(HBASE_ROWSET_VSBB_OPT) == DF_ON) &&
-	      (NOT generator->isRIinliningForTrafIUD()))
+	      (NOT generator->isRIinliningForTrafIUD()) &&
+              (NOT getTableDesc()->getNATable()->hasLobColumn()))
 	    uniqueRowsetHbaseOper() = TRUE;
 	  else if ((NOT generator->oltOptInfo()->multipleRowsReturned()) &&
 		   (listOfDelUniqueRows_.entries() == 0))
@@ -4945,15 +4956,24 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
 	    }
 	}
     }
-  else if (producesOutputs())
+
+  if ((producesOutputs()) &&
+      ((NOT isUnique) || (getUpdateCKorUniqueIndexKey())))
     {
       // Cannot do olt msg opt if:
       //   -- values are to be returned and unique operation is not being used.
+      //   -- or this delete was transformed from an update of pkey/index key
       // set an indication that multiple rows will be returned.
       generator->oltOptInfo()->setMultipleRowsReturned(TRUE);
       generator->oltOptInfo()->setOltCliOpt(FALSE);
     }
 
+  if (getTableDesc()->getNATable()->hasLobColumn())
+    {
+      canDoCheckAndUpdel() = FALSE;
+      uniqueRowsetHbaseOper() = FALSE;
+    }
+
   generator->setUpdSavepointOnError(FALSE);
   generator->setUpdPartialOnError(FALSE);
   
@@ -4988,7 +5008,7 @@ RelExpr * HbaseDelete::preCodeGen(Generator * generator,
 
   // flag for hbase tables
   generator->setHdfsAccess(TRUE);
-
+  
   markAsPreCodeGenned();
 
   return this;  
@@ -11386,7 +11406,7 @@ NABoolean HbaseAccess::isHbaseFilterPredV2(Generator * generator, ItemExpr * ie,
   }
   //check if not an added column with default non null
   if ((foundBinary || foundUnary)&& (NOT hbaseLookupPred)){
-        if (colVID.isAddedColumnWithNonNullDefault()){
+        if (colVID.isColumnWithNonNullNonCurrentDefault()){
             foundBinary=FALSE;
             foundUnary=FALSE;
         }
@@ -11827,7 +11847,7 @@ RelExpr * HbaseAccess::preCodeGen(Generator * generator,
           {
             if (originExePreds->isNotNullable(vid)){// it is non nullable
                 OperatorTypeEnum operatorType = vid.getItemExpr()->getOperatorType();
-                if ((operatorType == ITM_BASECOLUMN || operatorType == ITM_INDEXCOLUMN) && !vid.isAddedColumnWithNonNullDefault()){//check if  added and  with default... notgood
+                if ((operatorType == ITM_BASECOLUMN || operatorType == ITM_INDEXCOLUMN) && !vid.isColumnWithNonNullNonCurrentDefault()){//check if with non null or non current default... notgood
                     needAddingNonNullableColumn = false; // we found one column meeting all criteria
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/generator/GenRelUpdate.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelUpdate.cpp b/core/sql/generator/GenRelUpdate.cpp
index e544c36..ec5c3b4 100644
--- a/core/sql/generator/GenRelUpdate.cpp
+++ b/core/sql/generator/GenRelUpdate.cpp
@@ -787,6 +787,7 @@ short HbaseDelete::codeGen(Generator * generator)
   ex_expr *convert_expr = NULL;
   ex_expr * keyColValExpr = NULL;
   ex_expr *preCondExpr = NULL;
+  ex_expr *lobExpr = NULL;
 
   ex_cri_desc * givenDesc 
     = generator->getCriDesc(Generator::DOWN);
@@ -891,6 +892,7 @@ short HbaseDelete::codeGen(Generator * generator)
 
   ULng32 convertRowLen = 0;
 
+  ValueIdList lobDelVIDlist;
   for (CollIndex ii = 0; ii < numColumns; ii++)
     {
       ItemExpr * col_node = ((columnList[ii]).getValueDesc())->getItemExpr();
@@ -917,6 +919,15 @@ short HbaseDelete::codeGen(Generator * generator)
       
       castValue->bindNode(generator->getBindWA());
       convertExprCastVids.insert(castValue->getValueId());
+
+      if (col_node->getValueId().getType().isLob())
+        {
+          ItemExpr * ld = new(generator->wHeap())
+            LOBdelete(castValue);
+          ld->bindNode(generator->getBindWA());
+          lobDelVIDlist.insert(ld->getValueId());
+        }
+      
     } // for (ii = 0; ii < numCols; ii++)
 
   // Add ascii columns to the MapTable. After this call the MapTable
@@ -1060,7 +1071,39 @@ short HbaseDelete::codeGen(Generator * generator)
       expGen->generateExpr(newPredTree->getValueId(), ex_expr::exp_SCAN_PRED,
 			   &scanExpr);
     }
-  
+
+  ex_expr * lobDelExpr = NULL;
+  if (getTableDesc()->getNATable()->hasLobColumn())
+    {
+      // generate code to delete rows from LOB desc table
+      expGen->generateListExpr(lobDelVIDlist, 
+                               ex_expr::exp_ARITH_EXPR, &lobDelExpr);
+    }
+
+#ifdef __ignore
+  ex_expr * lobDelExpr = NULL;
+  if (getTableDesc()->getNATable()->hasLobColumn())
+    {
+      // generate code to delete rows from LOB desc table
+
+      ValueIdList lobDelVIDlist;
+      for (Lng32 i = 0; i < getIndexDesc()->getIndexColumns().entries(); i++)
+        {
+	  const ValueId vid = getIndexDesc()->getIndexColumns()[i];
+          if (vid.getType().isLob())
+            {
+              ItemExpr * ld = new(generator->wHeap())
+                LOBdelete(vid.getItemExpr());
+              ld->bindNode(generator->getBindWA());
+              lobDelVIDlist.insert(ld->getValueId());
+            }
+        }
+
+      expGen->generateListExpr(lobDelVIDlist, 
+                               ex_expr::exp_ARITH_EXPR, &lobDelExpr);
+    }
+#endif
+
   ULng32 rowIdAsciiRowLen = 0; 
   ExpTupleDesc * rowIdAsciiTupleDesc = 0;
   ex_expr * rowIdExpr = NULL;
@@ -1219,7 +1262,7 @@ short HbaseDelete::codeGen(Generator * generator)
 		      scanExpr,
 		      rowIdExpr,
 		      NULL, // updateExpr
-		      NULL, // mergeInsertExpr
+		      lobDelExpr, // NULL, // mergeInsertExpr
 		      NULL, // mergeInsertRowIdExpr
 		      NULL, // mergeUpdScanExpr
 		      NULL, // projExpr

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/generator/Generator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/Generator.cpp b/core/sql/generator/Generator.cpp
index 2486755..d1e174b 100644
--- a/core/sql/generator/Generator.cpp
+++ b/core/sql/generator/Generator.cpp
@@ -1979,6 +1979,7 @@ desc_struct * Generator::createVirtualTableDesc(
   index_desc->body.indexes_desc.tablename = table_desc->body.table_desc.tablename;
   index_desc->body.indexes_desc.indexname = table_desc->body.table_desc.tablename;
   index_desc->body.indexes_desc.keytag = 0; // primary index
+  index_desc->body.indexes_desc.indexUID = 0;
   index_desc->body.indexes_desc.record_length = table_desc->body.table_desc.record_length;
   index_desc->body.indexes_desc.colcount = table_desc->body.table_desc.colcount;
   index_desc->body.indexes_desc.isVerticalPartition = 0;
@@ -1989,8 +1990,10 @@ desc_struct * Generator::createVirtualTableDesc(
   index_desc->body.indexes_desc.rowFormat = table_desc->body.table_desc.rowFormat;
   if (tableInfo)
   {
-      index_desc->body.indexes_desc.numSaltPartns = tableInfo->numSaltPartns;
-      if (tableInfo->hbaseCreateOptions)
+    index_desc->body.indexes_desc.indexUID = tableInfo->objUID;
+    
+    index_desc->body.indexes_desc.numSaltPartns = tableInfo->numSaltPartns;
+    if (tableInfo->hbaseCreateOptions)
       {
         index_desc->body.indexes_desc.hbaseCreateOptions  = 
           new HEAP char[strlen(tableInfo->hbaseCreateOptions) + 1];
@@ -1998,7 +2001,7 @@ desc_struct * Generator::createVirtualTableDesc(
                tableInfo->hbaseCreateOptions);
       }
   }
-
+  
   if (numIndexes > 0)
     {
       desc_struct * prev_desc = index_desc;
@@ -2014,6 +2017,7 @@ desc_struct * Generator::createVirtualTableDesc(
 	  curr_index_desc->body.indexes_desc.indexname = new HEAP char[strlen(indexInfo[i].indexName)+1];
 	  strcpy(curr_index_desc->body.indexes_desc.indexname, indexInfo[i].indexName);
 
+          curr_index_desc->body.indexes_desc.indexUID = indexInfo[i].indexUID;
 	  curr_index_desc->body.indexes_desc.keytag = indexInfo[i].keytag;
 	  curr_index_desc->body.indexes_desc.unique = indexInfo[i].isUnique;
 	  curr_index_desc->body.indexes_desc.isCreatedExplicitly = indexInfo[i].isExplicit;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/nskgmake/Makerules.linux
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/Makerules.linux b/core/sql/nskgmake/Makerules.linux
index a707a5e..d0b0e63 100755
--- a/core/sql/nskgmake/Makerules.linux
+++ b/core/sql/nskgmake/Makerules.linux
@@ -423,10 +423,10 @@ copytoolslibs:
 	cp -Pf $(THRIFT_LIB_DIR)/$(THRIFT_SO)* $(LIBROOT)
 	cp -Pf $(THRIFT_LIB_DIR)/libthrift.so $(LIBROOT)
 	# if these are not found, then...
-	-cp -Pf $(HADOOP_LIB_DIR)/$(LIBHDFS_SO)* $(LIBROOT)
-	-cp -Pf $(HADOOP_LIB_DIR)/$(LIBHADOOP_SO)* $(LIBROOT)
-	-cp -Pf $(HADOOP_INC_DIR)/hdfs.h $(MY_SQROOT)/export/include
-	# download Hadoop source and build the hdfs library
+	-cp -Pf $(HADOOP_BLD_LIB)/$(LIBHDFS_SO)* $(LIBROOT)
+	-cp -Pf $(HADOOP_BLD_LIB)/$(LIBHADOOP_SO)* $(LIBROOT)
+	-cp -Pf $(HADOOP_BLD_INC)/hdfs.h $(MY_SQROOT)/export/include
+	# download Hadoop-common distro
 	get_libhdfs_files --verbose
 
 linuxmklinksdebug linuxmklinksrelease: copytoolslibs

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/nskgmake/SqlCompilerDebugger/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/SqlCompilerDebugger/Makefile b/core/sql/nskgmake/SqlCompilerDebugger/Makefile
index e34afa2..2d49b72 100644
--- a/core/sql/nskgmake/SqlCompilerDebugger/Makefile
+++ b/core/sql/nskgmake/SqlCompilerDebugger/Makefile
@@ -35,9 +35,10 @@ FINAL_DLLS += $(CMPGUI_FINAL)
 
 $(CMPGUI_FINAL) : cmpdbg_qt_build
 
+# optional component, ignore cp return code
 cmpdbg_qt_build :
-	cd ../$(basename $(CMPGUI_OBJ)) && . ./mk.sh; \
-                                  cp -f $$PWD/$(LIBPREFIX)$(notdir $(obj)) $(CMPGUI_FINAL);
+	cd ../$(basename $(CMPGUI_OBJ)) && . ./mk.sh
+	-cp -f ../$(basename $(CMPGUI_OBJ))/$(LIBPREFIX)$(notdir $(obj)) $(CMPGUI_FINAL)
 
 #when clean, this clean first
 


[16/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/querystats.jsp
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/querystats.jsp b/dcs/src/main/resources/dcs-webapps/master/querystats.jsp
deleted file mode 100644
index 4f1e668..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/querystats.jsp
+++ /dev/null
@@ -1,89 +0,0 @@
-<%--
-/**
- *@@@ 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 @@@
- */
---%>
-<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
-<%@ page contentType="text/html;charset=UTF-8"
-  import="java.io.*"
-  import="java.util.*"
-  import="java.sql.*"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.trafodion.dcs.master.DcsMaster"
-  import="org.trafodion.dcs.util.DcsConfiguration"
-  import="org.trafodion.dcs.Constants"
-  import="org.trafodion.dcs.util.Bytes"
-  import="org.trafodion.dcs.util.JdbcT4Util"
-  import="org.codehaus.jettison.json.JSONArray"
-  import="org.codehaus.jettison.json.JSONException"
-  import="org.codehaus.jettison.json.JSONObject"
- %>
-<% 
-
-  java.sql.Connection connection = null;
-  java.sql.Statement stmt = null;
-  java.sql.ResultSet rs = null;
-  
-  try {
-      DcsMaster master = (DcsMaster)getServletContext().getAttribute(DcsMaster.MASTER);
-      Configuration conf = master.getConfiguration();
-      boolean readOnly = conf.getBoolean("dcs.master.ui.readonly", false);
-      String masterServerName = master.getServerName();
-      int masterInfoPort = master.getInfoPort();
-      String trafodionHome = master.getTrafodionHome();
-      boolean trafodionLogs = conf.getBoolean(Constants.DCS_MASTER_TRAFODION_LOGS, Constants.DEFAULT_DCS_MASTER_TRAFODION_LOGS);
-      String queryText = conf.get(Constants.TRAFODION_REPOS_METRIC_QUERY_TABLE_QUERY,Constants.DEFAULT_TRAFODION_REPOS_METRIC_QUERY_TABLE_QUERY);
-      JSONArray metricQueryJson = null;
-      JdbcT4Util jdbcT4Util = master.getServerManager().getJdbcT4Util();
-      connection = jdbcT4Util.getConnection();
-      stmt = connection.createStatement();
-      rs = stmt.executeQuery(queryText);
-      metricQueryJson = jdbcT4Util.convertResultSetToJSON(rs);
-      rs.close();
-      stmt.close();
-      connection.close();
-      response.setContentType("application/json");
-      response.getWriter().print(metricQueryJson);
-  } catch (SQLException e) {
-    SQLException nextException = e;
-    StringBuilder sb = new StringBuilder();
-    do {
-        sb.append(nextException.getMessage());
-        sb.append("\nSQLState   " + nextException.getSQLState());
-        sb.append("\nError Code " + nextException.getErrorCode());
-    } while ((nextException = nextException.getNextException()) != null);
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(sb.toString());
-  } catch (Exception e) {
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(e.getMessage());
-  } finally {
-      if (rs != null)
-        rs.close();
-      if (stmt != null)
-        stmt.close();
-      if (connection != null)
-        connection.close();
-   }
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/repository.jsp
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/repository.jsp b/dcs/src/main/resources/dcs-webapps/master/repository.jsp
deleted file mode 100644
index bf748fa..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/repository.jsp
+++ /dev/null
@@ -1,114 +0,0 @@
-<%--
-/**
- * @@@ 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 @@@     
- */
---%>
-<%@ page contentType="text/html;charset=UTF-8"
-  import="java.io.*"
-  import="java.util.*"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.trafodion.dcs.master.DcsMaster"
-  import="org.trafodion.dcs.util.DcsConfiguration"
-  import="org.trafodion.dcs.Constants"
-  import="org.trafodion.dcs.util.Bytes"
-  import="org.codehaus.jettison.json.JSONArray"
-  import="org.codehaus.jettison.json.JSONException"
-  import="org.codehaus.jettison.json.JSONObject"
- %>
-<% 
-  DcsMaster master = (DcsMaster)getServletContext().getAttribute(DcsMaster.MASTER);
-  Configuration conf = master.getConfiguration();
-  boolean readOnly = conf.getBoolean("dcs.master.ui.readonly", false);
-  String masterServerName = master.getServerName();
-  int masterInfoPort = master.getInfoPort();
-  String trafodionHome = master.getTrafodionHome();
-  String type = request.getParameter("type");
-%>
-<?xml version="1.0" encoding="UTF-8" ?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-<title>Repository: <%= type %></title>
-<!--
-<link rel="stylesheet" type="text/css" href="/static/dcs.css" />
--->
-    <title>Trafodion Query Tools</title>
-    <link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
-    <link rel="stylesheet" type="text/css" href="jquery-ui/jquery-ui.css" />
-    <script type="text/javascript" src="js/lib/jquery-1.11.0.js"></script>
-    <script type="text/javascript" src="jquery-ui/jquery-ui.js"> </script> 
-        
-    <script type="text/javascript">
-    $(function() {
-        $("#tabs").tabs({
-            ajaxOptions: {
-                eror: function(xhr, status, index, anchor) {
-                    $(anchor.hash).html("Failed to load this tab!");
-                }
-            }
-        });
-
-        $('#tabs div.ui-tabs-panel').height(function() {
-            return $('#tabs-container').height()
-                   - $('#tabs-container #tabs ul.ui-tabs-nav').outerHeight(true)
-                   - ($('#tabs').outerHeight(true) - $('#tabs').height())
-                                   // visible is important here, sine height of an invisible panel is 0
-                   - ($('#tabs div.ui-tabs-panel:visible').outerHeight(true)  
-                      - $('#tabs div.ui-tabs-panel:visible').height());
-        });
-    });
-    </script>
-
-    <style type="text/css">
-        .ui-tabs .ui-tabs-panel {
-            overflow: auto;
-        }
-    </style>        
-</head>
-<body>
-
-        <div class="bannerArea">
-            <div class="container1">
-                <div style="padding-bottom: 5px; font-weight: bold; font-size: 28px; position: absolute;left:5px;top: 5px; color: #FFF; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; font-style: italic;">
-                    <span id="Label1">Trafodion Query Tools</span>
-                </div>
-            </div>
-        </div>
-
-        <div id="tabs-container" style="height:1000px; border:1px #aaa solid;">
-            <div id="tabs">
-                <ul>
-                    <li><a href="explain.html">Query Plan</a></li>
-                    <li><a href="querystats.html">Query Statistics</a></li>
-                    <li><a href="sessions.html">Sessions</a></li>
-                    <li><a href="aggr_querystats.html">Aggregated Query Statistics</a></li>
-                </ul>
-            </div>        
-        </div>
-
-        <script>
-            $(document).ready(function() {
-                $("#tabs").tabs().css({'height': '100%','overflow': 'auto'})
-            });
-        </script>
-</body>
-</html>        
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/sessions.html
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/sessions.html b/dcs/src/main/resources/dcs-webapps/master/sessions.html
deleted file mode 100644
index c2af17f..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/sessions.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!-- @@@ 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 @@@                                                           -->
-<head>
-	<link type="text/css" href="datatables/css/jquery.dataTables_themeroller.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_page.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_table_jui.css" rel="stylesheet" />
-	<link type="text/css" href="jquery-ui/jquery-ui.css" rel="stylesheet" />	
-	<script type="text/javascript" src="js/lib/jquery-1.11.0.js" />
-	<script type="text/javascript" src="datatables/js/jquery.dataTables.js"/></script>
-</head>
-
-	<div id="progress">
-	<p><span style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 18px;">Fetching session data ...</p>
-	<img src="img/ajax-loader.gif"/>
-	</div>
-	<div id="dynamic-sessions"></div>
-
-<script type="text/javascript">
-$(document).ready(function(){
-	document.body.style.cursor = 'wait';
-	$('#dynamic-sessions').html('').css('color','black');
-    var jqxhr = $.getJSON('sessions.jsp',function(result){
-    	
-    var keys;
-    $.each(result, function(i, data){
-      keys = Object.keys(data);
-	});
-    
-    var sb = '<table class="display1" id="sessions-table" style="font-size:small"><thead><tr>';
-    for (var r=0,len=keys.length; r<len; r++) {
-      sb += '<th><b></b>' + keys[r] + '</th>';
-    }
-    sb += '</tr></thead><tbody> </tbody></table>';
-    $('#dynamic-sessions').html( sb );
-    
-	var aoColumns = [];
-	var aaData = [];
-	
-	$.each(result, function(i, data){
-	var rowData = [];
-	  $.each(keys, function(k, v) {
-	    rowData.push(data[v]);
-	  });
-	  aaData.push(rowData);
-	});
-
-	// add needed columns
-	$.each(keys, function(k, v) {
-	obj = new Object();
-	obj.sTitle = v;
-	aoColumns.push(obj);
-	});
-	
-	 $('#sessions-table').dataTable({"bProcessing": true,"bJQueryUI": true,"sPaginationType": "full_numbers","aaData": aaData, "aoColumns" : aoColumns });
-	 
-	var elem = document.getElementById('progress');
-	elem.parentNode.removeChild(elem);
-	document.body.style.cursor = 'default';
-	
-    });
-    
-    jqxhr.fail(function(){
-		$('#dynamic-sessions').html( jqxhr.responseText ).css('color','red');
-		var elem = document.getElementById('progress');
-		elem.parentNode.removeChild(elem);
-		document.body.style.cursor = 'default';
-	});
-  });
-</script>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/sessions.jsp
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/sessions.jsp b/dcs/src/main/resources/dcs-webapps/master/sessions.jsp
deleted file mode 100644
index c3b8ba7..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/sessions.jsp
+++ /dev/null
@@ -1,89 +0,0 @@
-<%--
-/**
- *@@@ 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 @@@
- */
-
---%>
-<%@ page contentType="text/html;charset=UTF-8"
-  import="java.io.*"
-  import="java.util.*"
-  import="java.sql.*"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.trafodion.dcs.master.DcsMaster"
-  import="org.trafodion.dcs.util.DcsConfiguration"
-  import="org.trafodion.dcs.Constants"
-  import="org.trafodion.dcs.util.Bytes"
-  import="org.trafodion.dcs.util.JdbcT4Util"
-  import="org.codehaus.jettison.json.JSONArray"
-  import="org.codehaus.jettison.json.JSONException"
-  import="org.codehaus.jettison.json.JSONObject"
- %>
-<% 
-
-  java.sql.Connection connection = null;
-  java.sql.Statement stmt = null;
-  java.sql.ResultSet rs = null;
-  
-  try {
-     DcsMaster master = (DcsMaster)getServletContext().getAttribute(DcsMaster.MASTER);
-     Configuration conf = master.getConfiguration();
-     boolean readOnly = conf.getBoolean("dcs.master.ui.readonly", false);
-     String masterServerName = master.getServerName();
-     int masterInfoPort = master.getInfoPort();
-     String trafodionHome = master.getTrafodionHome();
-     boolean trafodionLogs = conf.getBoolean(Constants.DCS_MASTER_TRAFODION_LOGS, Constants.DEFAULT_DCS_MASTER_TRAFODION_LOGS);
-     String queryText = conf.get(Constants.TRAFODION_REPOS_METRIC_SESSION_TABLE_QUERY,Constants.DEFAULT_TRAFODION_REPOS_METRIC_SESSION_TABLE_QUERY);
-     JSONArray metricSessionJson = null;
-     JdbcT4Util jdbcT4Util = master.getServerManager().getJdbcT4Util();
-     connection = jdbcT4Util.getConnection();
-     stmt = connection.createStatement();
-     rs = stmt.executeQuery(queryText);
-     metricSessionJson = jdbcT4Util.convertResultSetToJSON(rs);
-     rs.close();
-     stmt.close();
-     connection.close();
-     response.setContentType("application/json");
-     response.getWriter().print(metricSessionJson);
-  } catch (SQLException e) {
-      SQLException nextException = e;
-      StringBuilder sb = new StringBuilder();
-      do {
-          sb.append(nextException.getMessage());
-          sb.append("\nSQLState   " + nextException.getSQLState());
-          sb.append("\nError Code " + nextException.getErrorCode());
-      } while ((nextException = nextException.getNextException()) != null);
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(sb.toString());
-  } catch (Exception e) {
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(e.getMessage());
-  } finally {
-      if (rs != null)
-        rs.close();
-      if (stmt != null)
-        stmt.close();
-      if (connection != null)
-        connection.close();
-  }  
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc b/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
index 8c20cfd..739d0e6 100644
--- a/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/odbc_windows.adoc
@@ -24,7 +24,7 @@
 These installation instructions apply to Trafodion Release 1.3.*_n_* and subsequent updates of the product until otherwise indicated.
 
 == Installation Package
-The installer file for the Trafodion ODBC Driver for Windows is packaged within the Trafodion clients tar file, `clients-1.3.*_n_*.tar.gz`, on the
+The installer file for the Trafodion ODBC Driver for Windows is packaged within the Trafodion clients tar file, `Trafodion Clients`, on the
 Trafodion downloads site http://trafodion.incubator.apache.org/download.html. Use this installer file to install the Trafodion ODBC Driver for Windows:
 
 [cols="25%l,25%,50%",options="header"]
@@ -73,10 +73,10 @@ NOTE: To install the driver on your PC, you must be logged on with a user ID tha
 
 ==== Task 1: Download the ODBC client installation file
 1.  Create a download folder on the client workstation.
-2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.com/download.html
-3.  Click on the `clients-1.3.*_n_*.tar.gz` link to start downloading the Trafodion clients tar file to your workstation.
-4.  Place the `clients-1.3.*_n_*.tar.gz file` into the download folder.
-5.  Extract the contents of the `clients-1.3.*_n_*.tar.gz` file by using an extract tool like WinZip. The package file contains the
+2.  Open a Web browser and navigate to the Trafodion downloads site http://trafodion.incubator.apache.org/download.html
+3.  Click on the `Trafodion Clients` link to start downloading the Trafodion clients tar file to your workstation.
+4.  Place the `*.tar.gz file` into the download folder.
+5.  Extract the contents of the `*.tar.gz` file by using an extract tool like WinZip. The package file contains the
 `TFODBC64-1.3.*_n_*.msi` installer file, which is extracted to the clients sub-directory.
 
 ==== Task 2: Start the InstallShield wizard

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/pom.xml
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/pom.xml b/docs/cqd_reference/pom.xml
index 9fbb88c..2075c15 100644
--- a/docs/cqd_reference/pom.xml
+++ b/docs/cqd_reference/pom.xml
@@ -236,15 +236,15 @@
                   - target/docs/<version>/<document> contains the PDF version and the web book. The web book is named index.html
                 --> 
                 <!-- Copy the PDF file to its target directories -->
-                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/cqd_reference_guide/Trafodion_CQD_Reference_Guide.pdf" />
-                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/${project.version}/cqd_reference_guide/Trafodion_CQD_Reference_Guide.pdf" />
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/cqd_reference/Trafodion_CQD_Reference_Guide.pdf" />
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/${project.version}/cqd_reference/Trafodion_CQD_Reference_Guide.pdf" />
                 <!-- Copy the Web Book files to their target directories -->
-                <copy todir="${basedir}/../target/docs/cqd_reference_guide">
+                <copy todir="${basedir}/../target/docs/cqd_reference">
                   <fileset dir="${basedir}/target/site">
                     <include name="**/*.*"/>  <!--All sub-directories, too-->
                   </fileset>
                 </copy>
-                <copy todir="${basedir}/../target/docs/${project.version}/cqd_reference_guide">
+                <copy todir="${basedir}/../target/docs/${project.version}/cqd_reference">
                   <fileset dir="${basedir}/target/site">
                     <include name="**/*.*"/>  <!--All sub-directories, too-->
                   </fileset>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/debugging.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/debugging.adoc b/docs/cqd_reference/src/asciidoc/_chapters/debugging.adoc
new file mode 100644
index 0000000..3d50322
--- /dev/null
+++ b/docs/cqd_reference/src/asciidoc/_chapters/debugging.adoc
@@ -0,0 +1,95 @@
+////
+/**
+* @@@ 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 @@@
+  */
+////
+
+[[debugging]]
+= Debugging
+
+This section describes CQDs that are used for debugging controls.
+
+[[udr-debug-flags]]
+== UDR_DEBUG_FLAGS
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Used when debugging user-defined functions (UDFs).
+| *Values*                    |
+*0-n* +
+ +
+Default: *'0'*.
+| *Usage*                     |
+See See https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode[UDF Tutorial]. 
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | Not applicable.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[udr_jvm_debug_port]]
+== UDR_JVM_DEBUG_PORT
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Used when debugging user-defined functions (UDFs).
+| *Values*                    |
+*0-n* +
+ +
+Default: *'0'*.
+| *Usage*                     |
+See See https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode[UDF Tutorial]. 
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | Not applicable.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[udr-jvm-debug-timeout]]
+== UDR_JVM_DEBUG_TIMEOUT
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Used when debugging user-defined functions (UDFs).
+| *Values*                    |
+*0-n* +
+ +
+Default: *'0'*.
+| *Usage*                     |
+See See https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode[UDF Tutorial]. 
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | Not applicable.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/histograms.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/histograms.adoc b/docs/cqd_reference/src/asciidoc/_chapters/histograms.adoc
index 53d1539..7086d90 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/histograms.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/histograms.adoc
@@ -33,9 +33,8 @@ This section describes CQDs that are used to manage histograms.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
-| *Description*               | Defines the time interval after which timestamps for cached histograms are checked to be refreshed.
-| *Values*                    | Unsigned integer Unit is seconds. +
+| *Description*               | Defines the time interval after which timestamps for cached histograms are checked for refresh processing.
+| *Values*                    | Unsigned integer in seconds. +
  + 
 The default value is *'3600'* (1 hour).
 | *Usage*                     | Histogram statistics are cached so that the compiler can avoid access to the metadata tables, thereby reducing compile times.
@@ -51,10 +50,10 @@ being updated during that time. On the other hand, if you are updating statistic
 enough, and you want these to be picked up immediately by the compiler because you have seen this to have a dramatic impact on plan quality, then you can
 make the refresh more frequent.
 | *Production Usage*          | Not applicable.
-| *Impact*                    | Longer histogram refresh intervals can improve compile times. However, the longer the refresh interval the more obsolete
-the histograms. That could result in poor performance for queries that could leverage recently updated statistics.
+| *Impact*                    | Longer histogram refresh intervals can improve compile times. However, longer refresh intervals yield more obsolete
+the histograms. More obsolete histograms may result in poor performance for queries that could leverage recently updated statistics.
 | *Level*                     | System or Service.
-| *Conflicts/Synergies*       | Frequency of update statistics run either using MAINTAIN or using Update Statistics Automation Server.
+| *Conflicts/Synergies*       | Frequency of update statistics run using MAINTAIN.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
@@ -66,22 +65,20 @@ the histograms. That could result in poor performance for queries that could lev
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
-| *Description*               | Controls the level of missing statistics warnings that should be displayed. The warnings impacted are 6007, 6008, 6010 and 6011.
+| *Description*               | Controls the level of missing statistics warnings that should be displayed. The warnings impacted are 6007, 6008, 6010, and 6011.
 | *Values*                    |
-*'0'*: Display no warnings. Update Statistics Automation Server still continues to record missing column statistics. +
+*'0'*: Display no warnings. +
  +
 *'1'*: Display only missing single column statistics warnings. These include 6008 and 6011. +
  +
 *'2'*: Display all missing single and multi-column statistics warnings for scans only. +
  +
-*'3'*: Display all missing single and multi-column statistics warnings for scans and join operators only.
-Update Statistics Automation Server continues to record missing column statistics. +
+*'3'*: Display all missing single and multi-column statistics warnings for scans and join operators only. +
  +
 *'4'*: Display all missing single and multi-column statistics warnings. +
  +
 The default value is *'4'*.
-| *Usage*                     | Update Statistics Automation Server captures these warnings and gathers appropriate statistics.
+| *Usage*                     | 
 If you do not want to see these warnings, then change the setting to '0'. If you want to track the warnings, then you have a
 choice of which warnings you want to track. Each setting gives you the ability to filter the warnings seen for missing single
 or multi-column statistics for join or scan operations. This controls the resulting number of warning messages. +
@@ -101,8 +98,7 @@ to get several warnings. Not all warnings may contribute to plan improvements. T
 based on the search path, some of which may not even impact the plan quality. Also, the cost of gathering statistics on those columns
 may not bring commensurate benefit to a large number of queries.
 | *Level*                     | System.
-| *Conflicts/Synergies*       | Update Statistics Automation Server does capture these warnings and gathers statistics felt appropriate
-for query performance. If you are using USAS then you may set the warning level to low or 0.
+| *Conflicts/Synergies*       | Not applicable.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
@@ -114,9 +110,8 @@ for query performance. If you are using USAS then you may set the warning level
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
 | *Description*               | Defines the time interval after which the fake histograms in the cache should be refreshed unconditionally.
-| *Values*                    | Unsigned integer Unit is seconds. +
+| *Values*                    | Unsigned integer. Unit is seconds. +
  + 
 The default value is *'3600'* (1 hour).
 | *Usage*                     | Histogram statistics are "fake" when update statistics is not being run, but instead the customer is
@@ -143,7 +138,6 @@ then the compiler may be working with obsolete histogram statistics, potentially
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
 | *Description*               | Influences the compiler to pre-fetch the histograms and save them in cache.
 | *Values*                    |
 *'ON'*: Pre-fetches the histograms. +
@@ -154,7 +148,7 @@ The default value is *'ON'*.
 | *Production Usage*          | Not applicable.
 | *Impact*                    | Though it makes compilation time faster, it may result in the histogram cache to be filled with histograms that may never be used.
 | *Level*                     | System or Service.
-| *Conflicts/Synergies*       | Use this CQD with CACHE_HISTOGRAMS. If CACHE_HISTOGRAMS is OFF, then this CQD has no effect. $$$
+| *Conflicts/Synergies*       | Use this CQD with <<cache-histograms,CACHE_HISTOGRAMS>>. If CACHE_HISTOGRAMS is OFF, then this CQD has no effect.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
@@ -166,9 +160,8 @@ The default value is *'ON'*.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
-| *Description*               | Specifies the minimum row count for which the optimizer needs histograms, in order to compute better cardinality estimates.
-The optimizer does not issue any missing statistics warnings for tables whose size is smaller than the value of this CQD.
+| *Description*               | Specifies the minimum row count for which the Trafodion Optimizer needs histograms, in order to compute better cardinality estimates.
+The Optimizer does not issue any missing statistics warnings for tables whose size is smaller than the value of this CQD.
 | *Values*                    | Integer. +
  +
 The default value is *'50000'*.
@@ -190,7 +183,6 @@ then this CQD does not have any effect. Also, for tables having fewer rows than
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Manage Histograms 
 | *Description*               | Enables the Compile Time Stats feature. Compile Time Stats are produced during query plan generation by executing a
 subset of the query on a subset of data to gather more accurate cardinality estimations.
 | *Values*                    |
@@ -208,7 +200,7 @@ It can also be disabled if the extra collection of statistics seems to be advers
 | *Impact*                    | The feature improves cardinality estimates for Scan operators thus improving the plan quality.
 However, it can also increase the compile time.
 | *Level*                     | Any.
-| *Conflicts/Synergies*       | In order to use the feature in its default form, sample tables should exist in `public_access_schema`. $$$
+| *Conflicts/Synergies*       | In order to use the feature in its default form, sample tables should exist in `public_access_schema`.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/introduction.adoc b/docs/cqd_reference/src/asciidoc/_chapters/introduction.adoc
index 5ba441e..fe3be20 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/introduction.adoc
@@ -27,7 +27,7 @@
 = Introduction
 
 Refer to the 
-http://trafodion.apache.org/docs/sql_reference/index.html#control_query_cancel_statement[Trafofion SQL Reference Manual]
+http://trafodion.apache.org/docs/sql_reference/index.html#control_query_cancel_statement[Trafodion SQL Reference Manual]
 full documentation of the CQD (CONTROL QUERY DEFAULT) statement.
 
 The CONTROL QUERY DEFAULT statement changes the default settings for the current process. You can execute
@@ -71,22 +71,13 @@ CONTROL QUERY DEFAULT HBASE_MAX_COLUMN_NAME_LENGTH RESET;
 ```
 
 <<<
-[[introduction-cqd-descriptin]]
+[[introduction-cqd-descriptions]]
 == CQD Descriptions
 
 The following information is provided for each CQD:
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Identifies one of these categories with which the CQD is associated: +
- +
-&#8226; Influence Query Plans +
-&#8226; Manage Histograms +
-&#8226; Transaction control and locking +
-&#8226; Run time controls +
-&#8226; Schema controls +
-&#8226; Update Statistics and Reorg +
-&#8226; Operational controls 
 | *Description*               | Describes the purpose of the CQD.
 | *Values*                    | Identifies this information: +
  +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/operational_controls.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/operational_controls.adoc b/docs/cqd_reference/src/asciidoc/_chapters/operational_controls.adoc
index aad0e7f..8d077cf 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/operational_controls.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/operational_controls.adoc
@@ -33,15 +33,15 @@ This section describes CQDs that are used for operational controls.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Operational Controls
 | *Description*               | Indicates whether a warning should be issued when a query is retried, in case a failed query is automatically retried.
-| *Values*                    | *'ON'* or *'OFF'* +
+| *Values*                    |
+*'ON'* or *'OFF'* +
  +
 The default value is *'OFF'*.
-| *Usage*                     | There are certain cases, such as when a node failure occurs, where a query may fail midstream. In many of such failure scenarios,
-if the query has not returned any data, then it is retried automatically. +
+| *Usage*                     | There are certain cases, such as when a node failure occurs, where a query may fail midstream. The query is usually
+retried automatically if it has not returned any data. +
  +
-When such retries happen, you may want to see a warning that an automatic retry took place. That would be a reason to turn this on.
+When such retries happen, then you may want to see a warning that an automatic retry took place. That would be a reason to turn this on.
 | *Production Usage*          | Not applicable.
 | *Impact*                    | You get a warning message every time a query is automatically retried due to a failure. When there is a node failure,
 then a large number of queries may be impacted. Therefore, you need to assess if you want to see a flood of warnings. The warning is returned after the query completes.
@@ -53,12 +53,89 @@ then a large number of queries may be impacted. Therefore, you need to assess if
 |===
 
 <<<
+[[explain-description-column-size]]
+== EXPLAIN_DESCRIPTION_COLUMN_SIZE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Specifies maximum length of DESCRIPTION column for EXPLAIN virtual tables.
+| *Values*                    |
+Positive integer > 10,000 +
+ +
+Default: -1, indicating a maximum size of 10,000.
+| *Usage*                     | Query-plan information for a SQL DML statement is stored temporarily in the Explain virtual table. 
+For large queries or queries with complex predicates, the default size of 10 KB may be insufficient to describe certain nodes in the query plan. 
+Specifying a larger value for this CQD allows more bytes to be stored in the description column. +
+ +
+Change this setting if you see explain plan being undesirably truncated only.
+| *Production Usage*          | Yes.
+| *Impact*                    | The explain plan truncation is reduced or removed.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-region-server-max-heap-size]]
+== HBASE_REGION_SERVER_MAX_HEAP_SIZE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Enables Trafodion to use HBase block cache in an optimal manner.  Defines the maximum Java
+heap size (-Xmx option) the HBase Region Server are assigned, in MB units.
+| *Values*                    |
+Positive integer. +
+ +
+Default: *'1024'*.
+| *Usage*                     | If the HBase Region servers are configured with a maximum Java heap size different than 1 GB, then
+set this attribute so that Trafodion is aware of the actual maximum heap size of the Region Servers.
+| *Production Usage*          | Yes.
+| *Impact*                    | When set correctly, this CQD ensures that HBase block cache are be used optimally. Small scans
+are cached and larger scans are not cached to avoid cache trashing.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hive-metadata-refresh-interval]]
+== HIVE_METADATA_REFRESH_INTERVAL
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Controls the metadata cache for Hive tables.
+| *Values*                    | 
+*-1*: Never invalidate any cache entries. +
+*0*: Always check the latest meta-data from Hive. +
+*> 0*: The cached Hive meta-data is valid only for <value> seconds. +
+ +
+Default: *'0'*.
+| *Usage*                     | Use a value of -1 when the Hive tables are read-only. This allows Trafodion to avoid repeatedly reading the
+metadata when the table is referenced in multiple queries. +
+ +
+Use a value of 0 when updates to the Hive tables are likely to be frequent. +
+ +
+Use a positive value _n_ to cause Trafodion to re-read metadata after n seconds has elapsed.
+Use this option when updates to the Hive table happen at least _n_ seconds apart. 
+| *Production Usage*          | Consult with the Trafodion community.
+| *Impact*                    | Compilation time.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
 [[query-cache]]
 == QUERY_CACHE
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Operational Controls $$$
 | *Description*               | Attempts to reduce compilation times by storing and reusing previously compiled query plans.
 It maximizes the chances of plan reuse by parameterizing literals in equality predicates. Two equality predicates, "col = val1" and "col = val2",
 are considered to match if their selectivities match. +
@@ -108,3 +185,52 @@ If the plan object is not produced due to a text cache miss, then the plan is st
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
 |===
+
+<<<
+[[traf-load-allow-risky-index-maintenance]]
+== TRAF_LOAD_ALLOW_RISKY_INDEX_MAINTENANCE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allows incremental index maintenance during bulk load.
+| *Values*                    |
+*'ON'*: Incremental index maintenance enabled. +
+*'OFF'*: Incremental index maintenance disabled. +
+ +
+Default: *'OFF'*.
+| *Usage*                     | When this CQD is ON during a bulk load, then any indexes on a table are maintained incrementally.
+New rows are added to the base table and all the indexes in HFiles and then during LOAD COMPLETE phase all new files are moved to HBase.
+Indexes are not offline. However, it causes the index to be inconsistent with the base table if any of the new rows have the same key value as an existing row.
+Change the default to ON only when certain that new rows do not have a conflict with existing rows in table.
+| *Production Usage*          | Yes.
+| *Impact*                    | Bulk load into tables with index is faster, when the attribute is set to ON.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[traf-load-flush-size-in-kb]]
+== TRAF_LOAD_FLUSH_SIZE_IN_KB
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Specifies the flush size used by bulk load when writing to HFiles.
+| *Values*                    |
+Positive integer. +
+ +
+Default: *'2014'*.
+| *Usage*                     | If the system is not memory constrained, then specifying a larger value may make the write phase of the LOAD statement to proceed faster. +
+ +
+Consider using lower values if the table has several indexes and is memory constrained.
+| *Production Usage*          | Yes.
+| *Impact*                    | Affects memory usage patterns and write performance of LOAD.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/query_execution.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/query_execution.adoc b/docs/cqd_reference/src/asciidoc/_chapters/query_execution.adoc
new file mode 100644
index 0000000..eae1ff3
--- /dev/null
+++ b/docs/cqd_reference/src/asciidoc/_chapters/query_execution.adoc
@@ -0,0 +1,239 @@
+////
+/**
+* @@@ 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 @@@
+  */
+////
+
+[[query-execution]]
+= Query Execution
+
+This section describes CQDs that are used to influence query execution.
+
+[[hbase-async-operation]]
+== HBASE_ASYNC_OPERATION
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allows index maintenance to be performed concurrently with base table operation. 
+| *Values*                    | *'ON'* Index maintenance is allowed. +
+*'OFF'* Index maintenance is not allowed. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | HBase `put` operations are blocking. When the table has one or more indexes, 
+then the insert/update/delete (IUD) operation response time is improved by executing the index maintenance 
+operations concurrently with the base table operation: the put operations to these HBase tables are executed 
+in different threads.
+| *Production Usage*          | Yes.  It is 'ON' by default. This feature can be disabled by setting this CQD to 'OFF'.
+| *Impact*                    | IUD operations on tables with one or more indexes can become slower.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-cache-blocks]]
+== HBASE_CACHE_BLOCKS
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Influences HBase to retain the data blocks in memory after they are read. 
+| *Values*                    |
+*'ON'/'OFF'/'SYSTEM'*  +
+ +
+The default value is *'SYSTEM'*.
+| *Usage*                     | HBase maintains the block cache structure to retain the data blocks in memory after they are read.
+In LRU block cache configuration, the amount of block cache retained in memory is proportional to the amount of reserved maximum
+Java heap size of the region server. LRU Block Cache is the default in HBase. +
+ +
+The Trafodion Optimizer determines whether a sequential scan of the HBase table in a query would cause the full eviction of the
+data blocks cached earlier thereby impacting the performance of the random reads. The cache blocks option is turned off for the table
+in such a case. +
+ +
+Set the CQD <<hbase-region-server-max-heap-size,HBASE_REGION_SERVER_MAX_HEAP_SIZE>> value to reflect the amount of java heap size reserved for the region servers.
+This CQD is used by the Trafodion Optimizer to evaluate if the block cache should be turned off. 
+| *Production Usage*          | Leave the setting to be 'SYSTEM' when HBase is configured to use LRU block cache. If needed,
+you can override this settings with 'ON' or 'OFF'.  +
+ +
+With other HBase configurations, you need to set HBASE_CACHE_BLOCKS to 'ON' or 'OFF' based on your application needs.
+| *Impact*                    | Automatically retains the random read performance.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-filter-preds]]
+== HBASE_FILTER_PREDS
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allows push down of predicates to HBase Region Servers using HBase filters and optimize the columns retrieved
+from Region Servers. Only supported for NON ALIGN FORMAT tables.
+| *Values*                    |
+*'OFF'*: Predicates are never pushed down. +
+*'ON'*: A first implementation targeted for deprecation is enabled. Support simple predicate formed by a combination of AND only.
+Could be counter-productive when applied on nullable columns. +
+*'1'*: Same as *'ON'*. +
+*'2'*: Full feature is enabled. +
+ +
+An explain plan can show whether predicates are successfully pushed down to the Region Servers and what columns are really retrieved. +
+ +
+The default value is *'OFF'*.
+| *Usage*                     | Used to improve performance by reducing the number of columns retrieved to a strict minimum
+and filter out rows as early as possible.
+| *Production Usage*          | Please consult the Trafodion community.
+| *Impact*                    | Using this CQD increases the amount of work done in the HBase Region Servers.
+| *Level*                     | System or Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 2.0.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-hash2-partitioning]]
+== HBASE_HASH2_PARTITIONING
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Treat salted Trafodion tables as hash-partitioned on the salt columns.
+| *Values*                    |
+*'OFF'*: Salted Trafodion tables are not hash-partitioned on the salt columns. +
+*'ON'*: Salted Trafodion tables are hash-partitioned on the salt columns. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | If, for any reason, there are issues with parallel plans on salted tables (especially with data skew) then try setting this CQD to OFF.
+| *Production Usage*          | Yes.
+| *Impact*                    | Not applicable.
+| *Level*                     | System or Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 2.0.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase_num_cache_rows_max]]
+== HBASE_NUM_CACHE_ROWS_MAX
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Determines the number of rows obtained from HBase in one RPC call to the HBase Region Server in a sequential scan operation,
+| *Values*                    |
+Numeric value. +
+ +
+The default value is *'10000'*.
+| *Usage*                     | This CQD can be used to tune the query to perform optimally by reducing the number of interactions to the HBase Region Servers during
+a sequential scan of a table. +
+ +
+You need to consider how soon the maximum number of rows are materialized on the Region Servers.  When filtering is pushed down to Region Servers,
+then it can take a longer time depending upon the query and the predicates involved. This can result in HBase scanner timeouts. 
+| *Production Usage*          | Use the default setting and reduce the value to avoid HBase scanner timeouts. Consult with the Trafodion community
+if you think that you need to use this CQD.
+| *Impact*                    | Not applicable.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-rowset-vsbb-opt]]
+== HBASE_ROWSET_VSBB_OPT
+
+[cols="25%h,75%"]
+|===
+| *Description*               |	Allows INSERT, UPDATE, and DELETE (IUD) operations to be performed as an HBase batch `put` operation. 
+| *Values*                    |
+*'ON'*: Perform IUD operations as an HBase batch `put` operation. +
+*'OFF'*: Do not perform IUD operations as an HBase batch `put` operation. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | When IUD operation involves multiple tuples, then the Trafodion Optimizer evaluates whether these operations
+can be done in a batch manner at the HBase level thereby reducing the network interactions between the client applications and the HBase Region Servers. +
+ +
+If possible, then the query plan involves VSBB operators. The Virtual Sequential Block Buffer(VSBB) name is retained in Trafodion though it is unrelated to HBase.
+| *Production Usage*          | Yes.
+| *Impact*                    | IUD operations can become slower if this CQD is set to 'OFF'.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-rowset-vsbb-size]]
+== HBASE_ROWSET_VSBB_SIZE
+
+[cols="25%h,75%"]
+|===
+| *Description*               |	Determines the maximum number of rows in a batch `put` operation to HBase. 
+| *Values*                    |
+Numeric value.
+ +
+The default value is *'1024'*.
+| *Usage*                     | The Trafodion execution engine already adjusts the number of rows in a batch depending upon how fast
+the queue to IUD (INSERT,UPDATE,DELETE) operator is filled up in the data flow architecture of Trafodion. +
+ +
+You can adjust the maximum size to suit your application needs and thus tune it to perform optimally.
+| *Production Usage*          | Yes. You can disable this feature by setting the HBASE_ROWSET_VSBB_OPT CQD to 'OFF'.
+| *Impact*                    | The performance of your application may be affected by setting this CQD too low.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-small-scanner]]
+== HBASE_SMALL_SCANNER
+
+[cols="25%h,75%"]
+|===
+| *Description*               |	Enables Trafodion to leverage the HBase small scanner optimization. This optimization reduces I/O usage up to 66% 
+and enables non-blocking reads for higher concurrency support. When a scan is known to require less than a HBASE BLOCK SIZE (default is 64K),
+then enabling the HBase small scanner optimization increases performance.
+| *Values*                    |
+*'OFF'*: Never use the HBase small scanner optimization. +
+*'SYSTEM'*: Only enable the HBase small scanner optimization when the Trafodion Compiler determines that the scan size will fit in the table's HBASE BLOCK SIZE +
+*'ON'*: Enable the HBase small scanner optimization regardless of the size of scan. +
+ +
+The default value is *'OFF'*.
+| *Usage*                     | Consider using this CQD to improve the performance of your queries.
+| *Production Usage*          | Consult with the Trafodion community.
+| *Impact*                    | The performance of small scan may increase by 1.4x. This CQD can be very useful for MDAM scans.
+| *Level*                     | System or Session.
+| *Conflicts/Synergies*       | MDAM performance may be improved by 1.4x when correctly picking HBase block size so that each MDAM scan operation fit within a HBASE BLOCK SIZE boundary. +
+ +
+If you enable small scanner on large size scan incorrectly, then you are likely to see a 6% performance decrease. The returned results will still be correct.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 2.0.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/query_plans.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/query_plans.adoc b/docs/cqd_reference/src/asciidoc/_chapters/query_plans.adoc
index 33bc8d6..c72aa46 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/query_plans.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/query_plans.adoc
@@ -23,8 +23,8 @@
   */
 ////
 
-[[influence-query-plans]]
-= Influence Query Plans
+[[query-plans]]
+= Query Plans
 
 This section describes CQDs that are used to influence query plans.
 
@@ -33,24 +33,29 @@ This section describes CQDs that are used to influence query plans.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
-| *Description*               | Defines the minimum size for query operator parallelism. 
-The optimizer may choose an adaptive segment size that is equal to, or the multiple of, 
-the value of this CQD, depending on the maximum estimated resource consumed by any single 
-operator in the query. The optimizer may also decide to run the query with no parallelism 
-if the resource consumption estimate is very low.
-| *Values*                    | Unsigned Integer. +
+| *Description*               | Defines the minimum size of the adaptive segment; that is, the number of processors 
+available for query operator parallelism. The optimizer may choose an adaptive-segment size that is equal to, or the multiple of, 
+the value of this CQD depending on the maximum estimated resource consumed by any single operator in the query. 
+The optimizer may also decide to run the query with no parallelism if the resource consumption estimate is very low.
+| *Values*                    |
+Unsigned Integer. +
+ +
 The default value is *'16'*.
-| *Usage*                     | For clusters running at higher levels of concurrency with 
-workloads that include a large number of small queries, reducing the default degree of 
-parallelism may help achieve higher throughput.
+| *Usage*                     | For systems running at higher levels of concurrency with workloads that include a large 
+number of small queries, reducing the default degree of parallelism may help achieve higher throughput. +
+ +
+With the default of 16, for 32-node systems, adaptive segmentation can use two 16-node virtual segments to execute queries that 
+do not require a degree of parallelism of 32.  This default setting can, for example, be changed to 8 for a 16-node system, 
+to allow adaptive segmentation to leverage a lower degree of parallelism.
+
 | *Production Usage*          | Not applicable.
 | *Impact*                    | Lowering the value of this CQD can increase the throughput of 
 high-concurrency small-query workloads, but has the potential disadvantage of increasing the 
-elapsed time for some of the longer running queries.
-| *Level*                     | System. 
+elapsed time for some of the longer running queries that leverage adaptive segmentation.
+| *Level*                     | System. There may be scenarios where you want to influence the degree of adaptive segmentation 
+parallelism only for a certain set of queries and use it at the service level.
 | *Conflicts/Synergies*       | Not applicable.
-| *Real Problem Sddressed*    | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
 |===
@@ -61,19 +66,68 @@ elapsed time for some of the longer running queries.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
-| *Description*               | Determines if Hash Join is considered by the optimizer to generate an execution plan.
-| *Values*                    | *'ON'* Hash Join is considered. +
-'OFF Hash Join is disabled. +
+| *Description*               | Determines whether the Trafodion Optimizer considers Hash Join when generating an execution plan.
+| *Values*                    |
+*'ON'* Hash Join is considered. +
+*'OFF'* Hash Join is not considered. +
  +
 The default value is *'ON'*.
-| *Usage*                     | Use this CQD when you want to force a query plan not to use any Hash Joins.
+| *Usage*                     | Use this CQD when you want to force the optimizer to generate a query plan that does not use any Hash Joins.
 | *Production Usage*          | Hash Join is an important join implementation strategy for most complex queries.
-It is highly recommended not to turn Hash Join OFF. It should only be used to force a query plan for a particular query on an exception basis.
-| *Impact*                    | Turning Hash Join OFF may result in very inefficient query plans with expensive nested joins or sorts for merge joins.
+It is highly recommended that you do not turn HASH_JOINS OFF; that is, this CQD should be used to force a query plan for a particular query on an exception basis only.
+| *Impact*                    | Turning HASH_JOINS OFF may result in very inefficient query plans that use expensive nested joins or sorts for merge joins.
 | *Level*                     | Query.
-| *Conflicts/Synergies*       | Avoid turning all the three join implementations OFF (Hash Joins, Nested Joins, and Merge Joins).
-This may result in the compiler failing to generate query plans.
+| *Conflicts/Synergies*       | If you turn all three join implementations OFF (Hash Joins, Nested Joins, and Merge Joins), then the compiler may fail to generate query plans.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-coprocessors]]
+== HBASE_COPROCESSORS
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allow HBase coprocessors to be used when computing aggregates.
+| *Values*                    |
+*'ON'*: Use HBase coprocessors. +
+*'OFF'*: Do not use HBase coprocessors. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | Enables Trafodion to use HBase coprocessors to do early aggregation and filtering
+at the HBase Region Server level. This CQD does not affect Transaction coprocessors used by Trafodion. +
+ +
+As of Release 2.0 only COUNT(*) queries will be affected by this attribute.
+| *Production Usage*          | Yes.
+| *Impact*                    | Network traffic between Region Server and Trafodion processes is reduced but
+the Region Server can become very busy when aggregating over large tables.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hive-num-esps-per-datanode]]
+== HIVE_NUM_ESPS_PER_DATANODE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Determines number of ESP processes used to scan a Hive table, per HDFS DataNode. 
+| *Values*                    |
+Positive integer. +
+ +
+The default value is *'2'*.
+| *Usage*                     | Use this CQD to increase or decrease the number of scanners that process a single Hive table.
+If a Hive scan is found to be the bottleneck for a particular query, then increasing this attribute to; for example, 4 or higher will help.
+On the other hand decreasing the attribute to 1 could help with concurrency.
+| *Production Usage*          | Yes.
+| *Impact*                    | Controls number of ESPs and, therefore, affects query execution time and system workload.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | The CQD <<hive-min-bytes-per-esp-partition,HIVE_MIN_BYTES_PER_ESP_PARTITION>> (default = 67108864) may need to be adjusted downward
+when this attribute is used to increase the parallelism of scanning smaller Hive tables.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
@@ -85,10 +139,10 @@ This may result in the compiler failing to generate query plans.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Enables or disables the join order in which the optimizer joins the tables to be the sequence of the
 tables in the FROM clause of the query.
-| *Values*                    | *'ON'* Join order is forced. +
+| *Values*                    |
+*'ON'* Join order is forced. +
 *'OFF'* Join order is decided by the optimizer. +
  +
 The default value is *'OFF'*.
@@ -105,6 +159,67 @@ specified in the FROM clause, the plan generated may not be the optimal one.
 | *Deprecated In Release*     | Not applicable.
 |===
 
+<<<
+[[mc-skew-sensitivity-threshold]]
+== MC_SKEW_SENSITIVITY_THRESHOLD
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Define the multi-column skew sensitivity threshold T used by multi-column skew-insensitive hash join (Skew Buster). +
+ +
+Let `f` be the occurrence frequency of a skew value `v`, `DoP` be the degree of parallelism of a hash join operator, and `RC` be the row count of
+the source data (for example, fact table) where the skew originates. +
+ +
+The hash join will run in the anti-skew mode for `v` if `f >= T * DoP / RC`.
+| *Values*                    |
+*< 0*: Disable the multi-column skew buster. +
+*&#62;= 0*: Define the threshold T. + 
+ +
+Default value: *0.1*.  
+| *Usage*                     | Use of a *negative value* to disable multi-column anti-skew hash joins. This may slow down query performance when
+multi-column skew values are present in the fact table. +
+ +
+A value of *0* treats every multi-column value as skew values. This may increase network traffic since skewed values are broadcasted from the inner
+side child of the hash join to all join processes. +
+ +
+A value *greater than 0* selects those multi-column values as skewed values if their occurrence frequencies are high enough. 
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | This CQD impacts runtime performance.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[mdam-no-stats-positions-threshold]]
+== MDAM_NO_STATS_POSITIONS_THRESHOLD
+
+[cols="25%h,75%"]
+|===
+| *Description*               | This CQD effects the behavior of the query optimizer when there are no statistics available for a query
+having range predicates on key columns. The Trafodion Optimizer calculates the worst case number of seeks that the MDAM access method
+would do if chosen for the query. +
+ +
+If this number is greater than the value of MDAM_NO_STATS_POSITIONS_THRESHOLD, then MDAM is not considered for the query execution plan. 
+| *Values*                    |
+Any integer greater than equal to zero. +
+ +
+Default value: *10*.  
+| *Usage*                     | In certain situations, queries on tables lacking statistics may not be optimal because MDAM was not chosen.
+Increasing the value for this CQD allows MDAM to be chosen in more cases. On the other hand, if the value is made too high and the worst case
+scenario actually occurs, an MDAM plan may perform poorly.
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | Table scans on tables lacking statistics may improve by varying the value of this CQD.
+Results vary depending on the actual data in the table and the semantics of the query.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | If <<mdam-scan-method,MDAM_SCAN_METHOD>> is set to *'OFF'*, then this CQD has no effect.
+| *Real Problem Addressed*    | Perform UPDATE STATISTICS on the table (at the very least on key columns) to obtain statistics.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
 
 <<<
 [[mdam-scan-method]]
@@ -112,15 +227,15 @@ specified in the FROM clause, the plan generated may not be the optimal one.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
-| *Description*               | Enables or disables the Multi-Dimensional Access Method.
-| *Values*                    | *'ON'* MDAM is considered. +
+| *Description*               | Enables or disables the Multi-Dimensional Access Method (MDAM).
+| *Values*                    |
+*'ON'* MDAM is considered. +
 *'OFF'* MDAM is disabled. +
  +
 The default value is *'ON'*.
-| *Usage*                     | In certain situations, the optimizer might choose MDAM inappropriately, causing poor performance.
+| *Usage*                     | In certain situations, the Trafodion Optimizer might choose MDAM inappropriately, causing poor performance.
 In such situations you may want to turn MDAM OFF for the query it is effecting.
-| *Production Usage*          | Not applicable.
+| *Production Usage*          | Yes.
 | *Impact*                    | Table scans with predicates on non-leading clustering key column(s) could benefit from MDAM access
 method if the leading column(s) has a small number of distinct values. Turning MDAM off results in a longer scan time for such queries.
 | *Level*                     | Set this CQD at the query level when MDAM is not working efficiently for a specific query. However,
@@ -138,24 +253,26 @@ to set it at the service or system level.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Determines if Merge Join is considered by the optimizer to generate an execution plan.
-| *Values*                    | *'ON'* Merge Join is considered. +
-*'OFF'* Merge Join is disabled. +
+| *Values*                    |
+*'ON'*: Merge Join is considered. +
+*'OFF'*: Merge Join is disabled. +
  +
 The default value is *'ON'*.
 | *Usage*                     | Use this CQD when you want to force a query plan not to use Merge Joins. This is useful as a workaround
-for query plans with very expensive sorts for Merge Joins. Turning Merge Join OFF also has the advantage of reducing the query compile time. 
+for query plans with very expensive sorts for Merge Joins. Turning MERGE_JOINS OFF also has the advantage of reducing the query compile time. 
 | *Production Usage*          | Merge Join is an efficient join implementation strategy if the physical schema was designed to take advantage
 of it. For example, large tables are physically ordered based on the most frequently joined column(s).
-| *Impact*                    | Turning Merge Join OFF may result in the optimizer not considering potentially efficient query plans,
-for queries with large joins on tables that are physically ordered by the join column(s). Turning Merge Join ON causes an increase in compile
+| *Impact*                    | Turning MERGE_JOINS OFF may result in the optimizer not considering potentially efficient query plans,
+for queries with large joins on tables that are physically ordered by the join column(s). +
+ +
+Turning MERGE_JOINS ON causes an increase in compile
 time because the optimizer now has to consider many more join options.
 | *Level*                     | Set this CQD at the query level when a Merge Join is not working efficiently for a specific query. However,
 there may be cases (usually a defect) where a larger set of queries is being negatively impacted by Merge Joins. In those cases you may want to
 set it at the service or system level.
 | *Conflicts/Synergies*       | Avoid turning all the three join implementations OFF (Hash Joins, Nested Joins, and Merge Joins).
-This may result in the compiler failing to generate query plans.
+This may result in the Trafodion Compiler failing to generate query plans.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
@@ -167,24 +284,24 @@ This may result in the compiler failing to generate query plans.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Determines if Nested Join is considered by the optimizer to generate an execution plan.
-| *Values*                    | *'ON'* Nested Join is considered. +
-*'OFF'* Nested Join is disabled. +
+| *Values*                    |
+*'ON'*: Nested Join is considered. +
+*'OFF'*: Nested Join is disabled. +
  +
 The default value is *'ON'*.
 | *Usage*                     | Use this CQD when you want to force a query plan not to use Nested Joins. This is useful
 as a workaround for query plans with very expensive Nested Joins, which may occur if the optimizer fails to estimate the
 cost of a Nested Join correctly.
 | *Production Usage*          | Nested Join is an important join implementation strategy for many complex queries. It is
-recommended not to turn Nested Join OFF. It should only be used to force a query plan for a particular query on an exception basis.
-| *Impact*                    | Turning Nested Join OFF may result in inefficient query plans for certain type of queries,
+recommended not to turn NESTED_JOINS OFF. It should only be used to force a query plan for a particular query on an exception basis.
+| *Impact*                    | Turning NESTED_JOINS OFF may result in inefficient query plans for certain type of queries,
 such as light workloads and star join queries.
 | *Level*                     | Query.
 | *Conflicts/Synergies*       | Avoid turning all the three join implementations OFF (Hash Joins, Nested Joins, and Merge Joins).
 This may result in the compiler failing to generate query plans.
 | *Real Problem Addressed*    | The problem of inefficient Nested Joins can be better handled using a higher degree of query plan
-robustness as set by the ROBUST_QUERY_OPTIMIZATION CQD.
+robustness as set by the <<robust-query-optimization,ROBUST_QUERY_OPTIMIZATION>> CQD.
 | *Introduced In Release*     | Trafodion 1.3.0.
 | *Deprecated In Release*     | Not applicable.
 |===
@@ -195,11 +312,12 @@ robustness as set by the ROBUST_QUERY_OPTIMIZATION CQD.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Controls the optimizer resources and time spent for optimizing a query plan, with level 0 indicating
 the least amount of optimization effort and level 5 indicating the most. Lower optimization levels produce lower plan quality with
 minimal compile time, while higher optimization levels cause the compiler to spend more compilation time to produce better plan quality.
-| *Values*                    | '0', '2', '3', '5'
+| *Values*                    |
+'0', '2', '3', '5' +
+ +
 The default value is *'3'*.
 | *Usage*                     | Reduce the optimization level when compile time is longer than desired and queries have relatively small
 execution cost and are simple in structure.
@@ -219,8 +337,7 @@ Increasing the optimization level over the system default may result in very hig
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
-| *Description*               | Controls the maximum number of parallel ESPs that work on a particular operation, like a join.
+| *Description*               | Controls the maximum number of parallel ESPs that work on a particular operation; for example, a join.
 | *Values*                    | Unsigned Integer: The maximum number of ESPs that should be used for a particular operation.
 The value must be less than the number of nodes in the cluster. +
  +
@@ -245,9 +362,9 @@ query workloads, but has the potential disadvantage of increasing the elapsed ti
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Influences the optimizer to choose other types of joins over nested joins, by making a nested join plan relatively more expensive.
-| *Values*                    | Any positive fractional value. +
+| *Values*                    |
+Any positive fractional value. +
  +
 The default value is *'1.2'*.
 | *Usage*                     | Review <<robust-query-optimization,ROBUST_QUERY_OPTIMIZATION>> before considering the use of this CQD. +
@@ -261,7 +378,7 @@ may be used to influence the optimizer to consider another join instead, such as
  +
 NESTED_JOINS OFF could turn nested joins off completely. However, there are many cases where nested joins do provide better performance than hash
 joins, and turning them off completely may negatively impact the performance of queries that can do a lot better with nested joins.
-| *Production Usage*          | Not applicable.
+| *Production Usage*          | Consult with the Trafodion community.
 | *Impact*                    | Specifying a risk premium insures against nested joins being chosen when they should not have been. However,
 this can also result in nested joins not being chosen where the cardinality estimation was in fact accurate and a nested join could have
 performed better. Therefore, this setting should be used with care in order to get robustness with a net gain in performance.
@@ -281,9 +398,9 @@ addressing nested join issues and need to use this setting independent of that C
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Influences the optimizer to choose a parallel plan over a serial plan, by making a serial plan relatively more expensive.
-| *Values*                    | Any positive fractional value. +
+| *Values*                    |
+Any positive fractional value. +
  +
 The default value is *'1.2'*.
 | *Usage*                     | Review <<robust-query-optimization,ROBUST_QUERY_OPTIMIZATION>> before considering the use of this CQD. +
@@ -294,7 +411,7 @@ allowed to win over competing parallel plans. +
  +
 If it is determined that the optimizer is using serial plans often enough where these plans are resulting in poor performance, then this CQD
 may be used to influence the optimizer to consider parallel plans instead in some of those cases. +
-| *Production Usage*          | Not applicable.
+| *Production Usage*          | Consult with the Trafodion community.
 | *Impact*                    | Specifying a risk premium insures against serial plans being chosen when they should not have been.
 However, this can also result in serial plans not being chosen where the cardinality estimation was in fact accurate and a serial plan
 could have performed better. Therefore, this setting should be used with care in order to get robustness with a net gain in performance.
@@ -309,12 +426,37 @@ addressing serial plan issues and need to use this setting independent of that C
 |===
 
 <<<
+[[risk-premium-serial-scaleback-maxcard-threshold]]
+== RISK_PREMIUM_SERIAL_SCALEBACK_MAXCARD_THRESHOLD
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Defines the minimal estimated max cardinality or row count of any relational operators in a query above
+which the risk premium for serial plan is applied. +
+ +
+A serial query plan is favored by the Trafodion Compiler when it estimates the query reads and processes small amount of data.
+The estimation error could become large when some operator is calculated to produce many rows yielding a non-optimal serial plan.
+This CQD helps prevent utilizing serial plan in such cases.
+| *Values*                    | An unsigned integer value. 
+| *Usage*                     | Adjust this CQD when necessary only.  +
+ +
+Use of a value smaller than the default (10,000) to penalize more serial plans or favor more parallel plans for operators produce less number of rows. 
+Otherwise, use of a larger value.
+| *Production Usage*          | Consult with the Trafodion community.
+| *Impact*                    | This CQD impacts plan quality.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
 [[robust-query-optimization]]
 == ROBUST_QUERY_OPTIMIZATION
 
 [cols="25%h,75%a"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Provides a simpler way to influence the optimizer's choice of query plans. The optimizer chooses query plans
 based on cardinality estimates (the number of result rows estimated at each step of a query execution plan). Actual cardinalities encountered
 at query execution often differ from estimates. The optimizer considers risky choices and exacts risk premiums before it chooses a plan that
@@ -397,7 +539,6 @@ optimizer may warn about. However, cardinality underestimations may still happen
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Turns on the reporting of anti-skew join plan details in EXPLAIN or EXPLAIN OPTIONS 'f'.
 | *Values*                    |
 *'OFF'*: Disables the use of SKEW_EXPLAIN. +
@@ -420,7 +561,6 @@ The default value is *'OFF'*.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | The optimizer looks for skewed values and address that skew if the number of rows in the table exceeds this threshold.
 | *Values*                    |
 *'n'*: where n is the number of rows +
@@ -460,7 +600,6 @@ is relevant if this threshold allows a skew to be detected only.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Used to specify a threshold that determines whether a value in the join column is considered skewed.
 | *Values*                    |
 *'-1'*: Disables the use of skew buster. +
@@ -489,12 +628,85 @@ However, there may be design opportunities that could help address the problem a
 |===
 
 <<<
+[[subquery_unnesting]]
+== SUBQUERY_UNNESTING
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allows correlated subqueries in a SQL statement to be unnested, so that they can be executed efficiently.
+| *Values*                    |
+*'ON'*: Unnesting enabled. +
+*'OFF'*: Unnesting disabled. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | Turn this CQD OFF when (in rare cases) unnesting a correlated subquery causes performance to degrade.
+If this attribute has to be turned OFF, then that could indicate a bug in the Trafodion Optimizer. Consult with the Trafodion community.
+| *Production Usage*          | Yes.
+| *Impact*                    | Turn OFF with caution at a system level, as other queries which rely on un-nesting could be adversely impacted.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[traf-allow-esp-colocation]]
+== TRAF_ALLOW_ESP_COLOCATION
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Enables or disables whether ESP are colocated with HBase Region Servers, which minimizes the inter-node
+network traffic between the ESP processes and the HBase Region Servers.
+| *Values*                    |
+*'ON'*: Colocation enabled. +
+*'OFF'*: Colocation disabled. +
+ +
+The default value is *'OFF'*.
+| *Usage*                     | Enable the feature when each region server serves approximately equal amount of data, and/or reducing network traffic is important.  
+| *Production Usage*          | Consult with the Trafodion community.
+| *Impact*                    | Plan quality.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[traf-upsert-with-insert-default-semantics]]
+== TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Enables population of omitted columns in an UPSERT statement with default values when the table is created in aligned-row format mode.
+| *Values*                    |
+*'ON'*: Default population enabled. +
+*'OFF'*: Default population disabled. +
+ +
+The default value is *'ON'*.
+| *Usage*                     | When a column with default value is omitted in an UPSERT statement of a table in aligned row format mode,
+then the statement is transformed to merge. +
+ +
+If the row already exists, then the omitted columns are populated with values from the existing row. +
+ +
+If the row doesn't exist, then the omitted columns are populated with default values. This default behavior can be changed by setting this CQD to 'ON',
+which improves the performance of the UPSERT statements with omitted default value columns.
+| *Production Usage*          | Yes.
+| *Impact*                    | Improved upsert performance of aligned row format tables.
+| *Level*                     | Query.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
 [[upd-ordered]]
 == UPD_ORDERED
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influence Query Plans 
 | *Description*               | Controls whether rows should be inserted, updated, or deleted in clustering key order.
 | *Values*                    |
 *'ON'*: The optimizer generates and considers plans where the rows are inserted, updated, or deleted in clustering key order. +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/runtime_controls.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/runtime_controls.adoc b/docs/cqd_reference/src/asciidoc/_chapters/runtime_controls.adoc
index 6f1c7c7..4196115 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/runtime_controls.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/runtime_controls.adoc
@@ -33,7 +33,6 @@ This section describes CQDs that are used for runtime controls.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Runtime Controls
 | *Description*               | Ensures that all parts of the query plan are executed but no rows are returned by the query.
 | *Values*                    | *'ON'* or *'OFF'*. +
  +
@@ -56,9 +55,8 @@ is the same as when you do not use the [LAST 0] clause in the query.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Runtime Controls
 | *Description*               | Use to limit the amount of CPU time that a query is allowed to use in any one server process (MXESP)
-including the NDCS server (MXOSRVR). Also includes the CPU time the query spends in the disk process (ESAM). $$$ +
+including the NDCS server (MXOSRVR). Also includes the CPU time the query spends in the disk process (ESAM). +
  +
 If a query exceeds the limit, then an error is raised and the query is terminated. This is a way to limit the impact on the
 system of a poorly written or badly optimized query.


[25/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/EXPECTED006
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED006 b/core/sql/regress/compGeneral/EXPECTED006
deleted file mode 100644
index 120b3c7..0000000
--- a/core/sql/regress/compGeneral/EXPECTED006
+++ /dev/null
@@ -1,1235 +0,0 @@
->>obey TEST006(create_tables);
->>
->>create table t006t1 (a varchar (200));
-
---- SQL operation complete.
->>
->>create table t006t2 (a int);
-
---- SQL operation complete.
->>
->>create table t006t3 (a int not null);
-
---- SQL operation complete.
->>
->>create table t006t4 (a char(10) not casespecific, b char(10));
-
---- SQL operation complete.
->>
->>create table t006t5 (a int     not null,
-+>                     b char(3) not null,
-+>                     c date    not null,
-+>                     primary key(a));
-
---- SQL operation complete.
->>
->>create table t006t6 (a char(10) character set ucs2);
-
---- SQL operation complete.
->>
->>create view t006t1_v as select a from t006t1;
-
---- SQL operation complete.
->>
->>create table t006t7 (a float);
-
---- SQL operation complete.
->>
->>create table t006t8 (a time);
-
---- SQL operation complete.
->>
->>-- used for large scope rules
->>create table x1 (a int not null, b int not null primary key);
-
---- SQL operation complete.
->>create table x2 (c int not null primary key, d int);
-
---- SQL operation complete.
->>create table x3 (e int not null, f int) store by (e);
-
---- SQL operation complete.
->>
->>insert into x1 values (1,1),(2,2);
-
---- 2 row(s) inserted.
->>insert into x2 values (1,1),(2,2),(3,3),(4,4),(5,5);
-
---- 5 row(s) inserted.
->>
->>create mv mvx refresh on request initialize on create as select a,sum(b) s_b
-+>from x1 group by a;
-
---- SQL operation complete.
->>
->>update statistics for table x1 on every column;
-
---- SQL operation complete.
->>update statistics for table x2 on every column;
-
---- SQL operation complete.
->>update statistics for table x3 on every column;
-
---- SQL operation complete.
->>
->>obey TEST006(negative_tests);
->>
->>-- Error 2055
->>control query default mp_subvolume 'raydddddd';
-
-*** ERROR[2055] The specified value 'RAYDDDDDD' for DEFAULTS attribute MP_SUBVOLUME is not valid.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default mp_subvolume 'raydd~@';
-
-*** ERROR[2055] The specified value 'RAYDD~@' for DEFAULTS attribute MP_SUBVOLUME is not valid.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 3233
->>prepare xx from update with no rollback t006t4 set a = b;
-
-*** ERROR[3233] This type of UPDATE is not allowed when NO ROLLBACK transaction setting is in effect. Suggestion: Set ALLOW_RISKY_UPDATE_WITH_NO_ROLLBACK CQD to ON to allow UPDATE command with right-hand side SET clause consisting of columns.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 3416
->>prepare xx from select coalesce(a, NULL) from t006t1;
-
-*** ERROR[3416] The last operand of function COALESCE must not be NULL.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4009
->>prepare xx from select sum(max(a)) from t006t1;
-
-*** ERROR[4009] An aggregate is not allowed inside an aggregate function.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4022
->>prepare xx from insert into t006t2(a, a) select a, a from t006t3;
-
-*** ERROR[4022] Target column A was specified more than once.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4026
->>control query default COMP_BOOL_58 'ON';
-
---- SQL operation complete.
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>control query default R2_HALLOWEEN_SUPPORT 'ON';
-
---- SQL operation complete.
->>prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
-
-*** ERROR[4026] Reading from and inserting into, or updating in, or deleting from the same table, CAT.SCH.T006T3, is not currently supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default R2_HALLOWEEN_SUPPORT reset;
-
---- SQL operation complete.
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>control query default COMP_BOOL_58 reset;
-
---- SQL operation complete.
->>
->>-- Error 4034
->>prepare xx from select * from t006t1 where a = 1234 collate default;
-
-*** ERROR[4034] The operation (1234 COLLATE DEFAULT)  is not allowed.
-
-*** ERROR[4073] The COLLATE clause may appear only after an expression of character data type, not NUMERIC.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4036
->>prepare xx from select year(a) from t006t2;
-
-*** ERROR[4036] The source field of the EXTRACT function must be of DateTime or Interval type.
-
-*** ERROR[4062] The preceding error actually occurred in function YEAR.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4039
->>prepare xx from insert into t006t3 values ('a');
-
-*** ERROR[4039] Column A is of type INTEGER, incompatible with the value's type, CHAR(1).
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4043
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where to_number(1112) = A;
-
-*** ERROR[4043] The operand of function TO_NUMBER must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>prepare xx from select tokenstr('a', a) from t006t2;
-
-*** ERROR[4043] The operand of function TOKENSTR must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select queryid_extract(a, b) from t006t5;
-
-*** ERROR[4043] The operand of function QUERYID_EXTRACT must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select os_userid(a) from t006t2;
-
-*** ERROR[4043] The operand of function OS_USERID must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select convertfromhex(a) from t006t2;
-
-*** ERROR[4043] The operand of function CONVERTFROMHEX must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select char_length(a) from t006t2;
-
-*** ERROR[4043] The operand of function CHARACTER_LENGTH, CHAR_LENGTH, or LENGTH must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select lower(a) from t006t2;
-
-*** ERROR[4043] The operand of function LOWER or LCASE must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select octet_length(a) from t006t2;
-
-*** ERROR[4043] The operand of function OCTET_LENGTH must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4045
->>prepare xx from select zeroifnull(a) from t006t1;
-
-*** ERROR[4045] The operand of function ZEROIFNULL must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select nullifzero(a) from t006t1;
-
-*** ERROR[4045] The operand of function NULLIFZERO must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select abs(a) from t006t1;
-
-*** ERROR[4045] The operand of function ABS must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select user(a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select ~a from t006t1;
-
-*** ERROR[4045] The operand of function BITNOT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select sin(a) from t006t1;
-
-*** ERROR[4045] The operand of function SIN must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
-
-*** ERROR[4045] The operand of function FORMAT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>
->>-- Error 4046
->>prepare xx from select ~(a) from t006t7;
-
-*** ERROR[4046] The operands of function BITNOT must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select bitextract(a, a, a) from t006t7;
-
-*** ERROR[4046] The operands of function BITEXTRACT must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select mod(a,a) from t006t1;
-
-*** ERROR[4046] The operands of function MOD must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select mod(a,a) from t006t7;
-
-*** ERROR[4046] The operands of function MOD must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select repeat('a', a) from t006t7;
-
-*** ERROR[4046] The operands of function REPEAT must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4047
->>prepare xx from select round(3.224, 2.3) from t006t1;
-
-*** ERROR[4047] The operands of function ROUND must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select round(3.224, 3, 2.3) from t006t1;
-
-*** ERROR[4047] The operands of function ROUND must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select round(t006t2.a, 1.1) from t006t1, t006t2;
-
-*** ERROR[4047] The operands of function ROUND must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select ~(1.1) from t006t1;
-
-*** ERROR[4047] The operands of function BITNOT must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select bitextract(a, a, 1.1) from t006t2;
-
-*** ERROR[4047] The operands of function BITEXTRACT must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select mod(a,1.1) from t006t2;
-
-*** ERROR[4047] The operands of function MOD must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select repeat(a, 1.1) from t006t1;
-
-*** ERROR[4047] The operands of function REPEAT must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>control query default JDBC_PROCESS 'ON';
-
---- SQL operation complete.
->>prepare xx from select locate(a,a,1.1) from t006t1;
-
-*** ERROR[4047] The operands of function POSITION must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default JDBC_PROCESS reset;
-
---- SQL operation complete.
->>
->>prepare xx from select substring(a,1.1) from t006t1;
-
-*** ERROR[4047] The operands of function SUBSTRING must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select substring(a,1,1.1) from t006t1;
-
-*** ERROR[4047] The operands of function SUBSTRING must have a scale of 0.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4051
->>prepare xx from select repeat(a, a) from t006t2;
-
-*** ERROR[4051] The first operand of function REPEAT must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select substring(a,a) from t006t2;
-
-*** ERROR[4051] The first operand of function SUBSTRING must be character.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4052
->>prepare xx from select a^b from t006t5;
-
-*** ERROR[4052] The second operand of function BITXOR must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select 1**a from t006t1;
-
-*** ERROR[4052] The second operand of function '**' must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select substring(a,a) from t006t1;
-
-*** ERROR[4052] The second operand of function SUBSTRING must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select round(t006t2.a, t006t1.a) from t006t1, t006t2;
-
-*** ERROR[4052] The second operand of function ROUND must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select repeat(a, a) from t006t1;
-
-*** ERROR[4052] The second operand of function REPEAT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select offset(a,a,a) from t006t1;
-
-*** ERROR[4052] The second operand of function OFFSET must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>control query default COMP_BOOL_58 'ON';
-
---- SQL operation complete.
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>prepare xx from select rows since(a = 11, a) from t006t1 sequence by a;
-
-*** ERROR[4052] The second operand of function ROWS SINCE must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>control query default COMP_BOOL_58 reset;
-
---- SQL operation complete.
->>
->>-- Error 4053
->>prepare xx from select bitextract(a, a, b) from t006t5;
-
-*** ERROR[4053] The third operand of function BITEXTRACT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select substring(a,1,a) from t006t1;
-
-*** ERROR[4053] The third operand of function SUBSTRING must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>control query default JDBC_PROCESS 'ON';
-
---- SQL operation complete.
->>prepare xx from select locate(a,a,a) from t006t1;
-
-*** ERROR[4053] The third operand of function POSITION must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default JDBC_PROCESS reset;
-
---- SQL operation complete.
->>
->>prepare xx from select insert(a, 1, 2.1, 3) from t006t2;
-
-*** ERROR[4053] The third operand of function INSERT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select round(t006t2.a, t006t2.a, t006t1.a) from t006t1, t006t2;
-
-*** ERROR[4053] The third operand of function ROUND must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select offset(a,1,a) from t006t1;
-
-*** ERROR[4053] The third operand of function OFFSET must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select movingcount(a, 1, a) from t006t1 sequence by a;
-
-*** ERROR[4053] The third operand of function MOVINGCOUNT must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4059
->>prepare xx from select round(a) from t006t1;
-
-*** ERROR[4059] The first operand of function ROUND must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select trunc(a) from t006t1;
-
-*** ERROR[4059] The first operand of function TRUNC must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>prepare xx from select a**a from t006t1;
-
-*** ERROR[4059] The first operand of function '**' must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4065
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where to_date(A, '201005') = A;
-
-*** ERROR[4065] The format, "201005", specified in the TO_DATE function is not supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
-
-*** ERROR[4065] The format, "YYYYMM", specified in the TO_DATE function is not supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>
->>-- Error 4067
->>prepare xx from select * from table (explain(NULL, 5));
-
-*** ERROR[4067] The operands of function EXPLAIN must be character data types.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4068
->>prepare xx from select convertfromhex(cast(a as char(1))) from t006t1;
-
-*** ERROR[4068] The operand of function CONVERTFROMHEX must contain an even number of characters.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4070
->>prepare xx from select converttimestamp(a) from t006t1;
-
-*** ERROR[4070] The operand of function CONVERTTIMESTAMP must be exact numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4071
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where last_day(A) = A;
-
-*** ERROR[4071] The first operand of function LAST_DAY must be a datetime.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>
->>prepare xx from select juliantimestamp(a) from t006t1;
-
-*** ERROR[4071] The first operand of function JULIANTIMESTAMP must be a datetime.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4073
->>prepare xx from select * from t006t1 where a = (select a from t006t3) collate default;
-
-*** ERROR[4034] The operation (SCALAR_AGGR(SCAN CAT.SCH.T006T3) COLLATE DEFAULT)  is not allowed.
-
-*** ERROR[4073] The COLLATE clause may appear only after an expression of character data type, not INTEGER.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4078
->>prepare xx from select variance(a, b) over (order by a) from t006t2;
-
-*** ERROR[4078] Function VARIANCE does not accept a weight operand.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4106
->>prepare xx from select code_value(ascii(a)) from t006t6;
-
-*** ERROR[4106] The character set for the operand of function ASCII must be ISO88591.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4122
->>prepare xx from insert into t006t3 values (NULL);
-
-*** ERROR[4122] NULL cannot be assigned to NOT NULL column CAT.SCH.T006T3.A.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4131
->>alter table t006t1 add constraint t006t1_check check (t006t1.A = current_time);
-
-*** ERROR[4131] Current_time, current_date, or current_timestamp is not allowed in a check constraint.
-
-*** ERROR[1079] SQL was not able to prepare the statement.
-
---- SQL operation failed with errors.
->>
->>-- Error 4132
->>alter table t006t1 add constraint t006t1_check check (t006t1.A = current_user);
-
-*** ERROR[4132] Current_user, session_user, or system_user is not allowed in a check constraint.
-
-*** ERROR[1079] SQL was not able to prepare the statement.
-
---- SQL operation failed with errors.
->>
->>-- Error 4185
->>prepare xx from select sum(a) from t006t1 group by 1;
-
-*** ERROR[4185] Select list index is not allowed to be specified in the GROUP BY clause for this query.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4310
->>prepare xx from select * from t006t1 where user(a) = a;
-
-*** ERROR[4310] USER(x) is currently supported only in the outermost SELECT list. For example, it cannot be a part of the subquery.
-
-*** ERROR[4062] The preceding error actually occurred in function USER(CAT.SCH.T006T1.A).
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select * from t006t1 where a = (select user(a) from t006t2);
-
-*** ERROR[4310] USER(x) is currently supported only in the outermost SELECT list. For example, it cannot be a part of the subquery.
-
-*** ERROR[4062] The preceding error actually occurred in function USER(CAT.SCH.T006T2.A).
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4312
->>prepare xx from update HP_SYSTEM_CATALOG.mxcs_schema.ASSOC2DS set assoc_id = 100;
-
-*** ERROR[4312] HP_SYSTEM_CATALOG.MXCS_SCHEMA.ASSOC2DS is an MXCS metadata table and cannot be directly updated.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 4391
->>prepare xx from select variance(a) over (order by ?p) from t006t2;
-
-*** ERROR[4391] Paramaters and outer references in the PARTITION BY or ORDER BY clause of a window function are not supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Error 8403
->>prepare xx from select substring(a,1,-1) from t006t1;
-
-*** ERROR[8403] The length argument of function SUBSTRING cannot be less than zero or greater than source string length.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>obey TEST006(positive_tests);
->>
->>-- Non-error coverage cases
->>prepare xx from select queryid_extract(a, b) from t006t4;
-
---- SQL command prepared.
->>prepare xx from select round(3.224, 3, 2) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select user(a) from t006t1;
-
---- SQL command prepared.
->>
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2 where to_date(A, '99:99:99:99') = A;
-
---- SQL command prepared.
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
->>
->>prepare xx from select current_running from t006t1;
-
---- SQL command prepared.
->>prepare xx from select position(a in a) from t006t4;
-
---- SQL command prepared.
->>prepare xx from select replace(a, a, a) from t006t4;
-
---- SQL command prepared.
->>
->>control query default COMP_BOOL_58 'ON';
-
---- SQL operation complete.
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>prepare xx from select substring(a for 3) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select substring(a for 3) from t006t3;
-
---- SQL command prepared.
->>prepare xx from select substring(c for 3) from t006t5;
-
---- SQL command prepared.
->>prepare xx from select a from t006t1 group by 1 order by 1;
-
---- SQL command prepared.
->>prepare xx from select a from t006t1 group by A order by A;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where c = 1231999;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where a = date'12/31/1999';
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where cast(a as interval day) = 1;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where 1 = interval '1' day;
-
---- SQL command prepared.
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>control query default COMP_BOOL_58 reset;
-
---- SQL operation complete.
->>
->>prepare xx from select date_trunc('YEAR',a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select date_trunc('YEAR',a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select date_trunc('month',a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select date_trunc('century',a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(year,a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(month,a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(hour,a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(minute,a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(second,a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select datediff(quarter,c, c) from t006t5;
-
---- SQL command prepared.
->>
->>prepare xx from 
-+>select 
-+>decode(CAST (( a + 3) / 4 AS INT ) ,
-+>0,0.04,
-+>1,0.04,
-+>0.06) from t006t3;
-
---- SQL command prepared.
->>
->>prepare xx from select count(*) from t006t1 where lpad(a,0,'') = 'aa';
-
---- SQL command prepared.
->>prepare xx from select count(*) from t006t1 where rpad(a,0,'') = 'aa';
-
---- SQL command prepared.
->>
->>prepare xx from select truncate(a, 2) from t006t3;
-
---- SQL command prepared.
->>prepare xx from select os_userid(a) from t006t1;
-
---- SQL command prepared.
->>
->>control query default ODBC_PROCESS 'ON';
-
---- SQL operation complete.
->>control query default COMP_BOOL_173 'ON';
-
---- SQL operation complete.
->>prepare xx from insert into t006t3 values (?p);
-
---- SQL command prepared.
->>control query default ODBC_PROCESS reset;
-
---- SQL operation complete.
->>control query default COMP_BOOL_173 reset;
-
---- SQL operation complete.
->>
->>control query default INFER_CHARSET 'ON';
-
---- SQL operation complete.
->>prepare xx from select replace(a, a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select * from t006t1 where ?p like a;
-
---- SQL command prepared.
->>prepare xx from select octet_length(a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select locate(a,a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select min(a) from t006t1;
-
---- SQL command prepared.
->>control query default INFER_CHARSET reset;
-
---- SQL operation complete.
->>
->>prepare xx from select lower(a) from t006t4;
-
---- SQL command prepared.
->>
->>control query default PUBLIC_SCHEMA_NAME 'test_public_schema';
-
---- SQL operation complete.
->>create schema $$TEST_CATALOG$$.TEST_PUBLIC_SCHEMA;
-
---- SQL operation complete.
->>Create table test_public_schema.t_pub1 (a int);
-
---- SQL operation complete.
->>prepare xx from select * from t_pub1;
-
---- SQL command prepared.
->>drop schema $$TEST_CATALOG$$.TEST_PUBLIC_SCHEMA cascade;
-
---- SQL operation complete.
->>control query default PUBLIC_SCHEMA_NAME reset;
-
---- SQL operation complete.
->>
->>control query default ALLOW_ISOLATION_LEVEL_IN_CREATE_VIEW 'OFF';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1_v;
-
---- SQL command prepared.
->>control query default ALLOW_ISOLATION_LEVEL_IN_CREATE_VIEW reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_192 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2 full outer join t006t3 on t006t2.a = t006t3.a;
-
---- SQL command prepared.
->>control query default COMP_BOOL_192 reset;
-
---- SQL operation complete.
->>
->>prepare xx from select * from table (explain(_UCS2'NULL', _UCS2's'));
-
---- SQL command prepared.
->>
->>control query default COMP_BOOL_203 'ON';
-
---- SQL operation complete.
->>prepare xx from select rank(a) from t006t1 sequence by a;
-
---- SQL command prepared.
->>control query default COMP_BOOL_203 reset;
-
---- SQL operation complete.
->>
->>control query default MULTI_JOIN_CONSIDER_INITIAL_JOIN_ORDER 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1, t006t2, t006t3, t006t4, t006t5 where t006t2.a=t006t3.a and t006t1.a = t006t4.a and t006t3.a = t006t5.a and t006t5.b = t006t1.a;
-
---- SQL command prepared.
->>control query default MULTI_JOIN_CONSIDER_INITIAL_JOIN_ORDER reset;
-
---- SQL operation complete.
->>
->>control query default HIDE_INDEXES 'KEYINDEXES';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1;
-
---- SQL command prepared.
->>control query default HIDE_INDEXES reset;
-
---- SQL operation complete.
->>
->>prepare xx from select nullifzero(a) from t006t3;
-
---- SQL command prepared.
->>prepare xx from select converttobits(a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select queryid_extract(a, a) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select tokenstr('a', a) from t006t1;
-
---- SQL command prepared.
->>
->>prepare xx from select cast(?p as char(3) not null) from t006t1;
-
---- SQL command prepared.
->>
->>control query default OVERRIDE_SYSKEY 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t7;
-
---- SQL command prepared.
->>control query default OVERRIDE_SYSKEY reset;
-
---- SQL operation complete.
->>
->>control query default VALIDATE_RFORK_REDEF_TS 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t7;
-
---- SQL command prepared.
->>control query default VALIDATE_RFORK_REDEF_TS reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_108 'OFF';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3 where log(t006t2.a)  =  log(t006t3.a);
-
---- SQL command prepared.
->>control query default COMP_BOOL_108 reset;
-
---- SQL operation complete.
->>
->>prepare xx from select * from t006t8 t5_1, t006t8 t5_2 where hour(t5_1.a) = minute(t5_2.a);
-
---- SQL command prepared.
->>prepare xx from select * from t006t8 t5_1, t006t8 t5_2 where second(t5_1.a) = minute(t5_2.a);
-
---- SQL command prepared.
->>
->>control query default MULTI_JOIN_CONSIDER_INITIAL_JOIN_ORDER 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1, t006t2, t006t3, t006t4, t006t5 where t006t2.a=t006t3.a and t006t1.a = t006t4.a and t006t3.a = t006t5.a and t006t5.b = t006t1.a;
-
---- SQL command prepared.
->>control query default MULTI_JOIN_CONSIDER_INITIAL_JOIN_ORDER reset;
-
---- SQL operation complete.
->>
->>prepare xx from select * from t006t5
-+>where c >= current_date - interval '12' day and c < current_date;
-
---- SQL command prepared.
->>
->>control query default HIST_OPTIMISTIC_CARD_OPTIMIZATION '3';
-
---- SQL operation complete.
->>prepare xx from select * from t006t5
-+>where a > 15;
-
---- SQL command prepared.
->>control query default HIST_OPTIMISTIC_CARD_OPTIMIZATION reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_42 'OFF';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3 where t006t2.a = t006t3.a;
-
---- SQL command prepared.
->>control query default COMP_BOOL_42 reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_8 'ON';
-
---- SQL operation complete.
->>control query default ASM_PRECOMPUTE 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1, t006t2, t006t3, t006t4, t006t5 where t006t2.a=t006t3.a and t006t1.a = t006t4.a and t006t3.a = t006t5.a and t006t5.b = t006t1.a;
-
---- SQL command prepared.
->>control query default COMP_BOOL_8 reset;
-
---- SQL operation complete.
->>control query default ASM_PRECOMPUTE reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_119 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3, t006t5 where t006t2.a=t006t3.a and t006t3.a = t006t5.a;
-
---- SQL command prepared.
->>control query default COMP_BOOL_119 reset;
-
---- SQL operation complete.
->>
->>control query default COMP_BOOL_25 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3, t006t5, t006t4 
-+>where 
-+>t006t2.a=4 and t006t3.a = t006t5.a 
-+>or 
-+>t006t4.b=t006t5.b and t006t3.a = 5 
-+>;
-
---- SQL command prepared.
->>control query default COMP_BOOL_25 reset;
-
---- SQL operation complete.
->>
->>control query default OPTIMIZER_HEURISTIC_3 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3, t006t5, t006t4 
-+>where 
-+>t006t2.a=4 and t006t3.a = t006t5.a 
-+>or 
-+>t006t4.b=t006t5.b and t006t3.a = 5 
-+>;
-
---- SQL command prepared.
->>control query default OPTIMIZER_HEURISTIC_3 reset;
-
---- SQL operation complete.
->>
->>control query default COMP_STRING_1 'T5';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2, t006t3, t006t5 as t5 where t006t2.a=t006t3.a and t006t3.a = t5.a;
-
---- SQL command prepared.
->>control query default COMP_STRING_1 reset;
-
---- SQL operation complete.
->>
->>-- coverage for Analyzer and largeScopeRules
->>obey TEST006(analyzer_tests);
->>
->>-- coverage for Analyzer.cpp method QueryAnalysis::newTableAnalysis
->>cqd COMP_BOOL_24 'ON';
-
---- SQL operation complete.
->>prepare st1 from select a,sum(d) s_d from x1,x2 where b=c group by a;
-
---- SQL command prepared.
->>cqd COMP_BOOL_24 reset;
-
---- SQL operation complete.
->>
->>-- coverage for Analyzer.cpp method QueryAnalysis::setHistogramsToDisplay
->>cqd HIST_ROOT_NODE '1,2,3,4';
-
---- SQL operation complete.
->>prepare st1 from select a,sum(d) s_d from x1,x2 where b=c group by a;
-
---- SQL command prepared.
->>cqd HIST_ROOT_NODE reset;
-
---- SQL operation complete.
->>
->>-- coverage for Analyzer.cpp method QueryAnalysis::computeTablesJoinedToLargestTable
->>cqd COMP_BOOL_119 'ON';
-
---- SQL operation complete.
->>prepare st1 from select a,sum(d) s_d from x1,x2 where b=c group by a;
-
---- SQL command prepared.
->>cqd COMP_BOOL_119 reset;
-
---- SQL operation complete.
->>
->>-- coverage for Analyzer.cpp method JBBSubsetAnalysis::isAStarPattern
->>cqd COMP_BOOL_12 'ON';
-
---- SQL operation complete.
->>prepare st1 from select a,sum(d) s_d from x1,x2 where b=c group by a;
-
---- SQL command prepared.
->>cqd COMP_BOOL_12 reset;
-
---- SQL operation complete.
->>
->>-- coverage for Analyzer.cpp method JBB::addJBBC
->>prepare st1 from select a,sum(b) s_b from x1 group by a;
-
---- SQL command prepared.
->>
->>-- coverage for LargeScopeRules.cpp MJEnumRule::nextSubstitute
->>cqd COMP_INT_79 '2';
-
---- SQL operation complete.
->>prepare st1 from select a ,b from x1,x2,x3 where b=e;
-
---- SQL command prepared.
->>cqd COMP_INT_79 reset;
-
---- SQL operation complete.
->>cqd COMP_INT_51 '2';
-
---- SQL operation complete.
->>prepare st1 from select a ,b from x1,x2,x3 where b=e;
-
---- SQL command prepared.
->>cqd COMP_INT_51 reset;
-
---- SQL operation complete.
->>
->>obey TEST006(defaults_tests);
->>
->>-- The plan to support PUBLISHING_ROLES CQD has been
->>-- cancelled so the test cases are commented out.
->>--cqd PUBLISHING_ROLES 'a.b';
->>--cqd PUBLISHING_ROLES reset;
->>
->>cqd POS 'off';
-
---- SQL operation complete.
->>cqd HIST_SCRATCH_VOL '\n.$a.b.c';
-
-*** ERROR[2055] The specified value '\n.$a.b.c' for DEFAULTS attribute HIST_SCRATCH_VOL is not valid.
-
-*** ERROR[8822] The statement was not prepared.
-
->>cqd HIST_SCRATCH_VOL reset;
-
---- SQL operation complete.
->>cqd POS reset;
-
---- SQL operation complete.
->>
->>cqd EID_TRACE_STR 'abc';
-
---- SQL operation complete.
->>cqd EID_TRACE_STR reset;
-
---- SQL operation complete.
->>
->>cqd POS_ABSOLUTE_MAX_TABLE_SIZE '123,456,789';
-
-*** ERROR[2055] The specified value '123,456,789' for DEFAULTS attribute POS_ABSOLUTE_MAX_TABLE_SIZE is not valid.
-
-*** ERROR[8822] The statement was not prepared.
-
->>cqd POS_ABSOLUTE_MAX_TABLE_SIZE reset;
-
---- SQL operation complete.
->>
->>cqd DEFAULT_SCHEMA_NAMETYPE 'user';
-
---- SQL operation complete.
->>cqd DEFAULT_SCHEMA_NAMETYPE reset;
-
---- SQL operation complete.
->>
->>obey TEST006(misc_tests);
->>
->>-- Memory monitor infrastructure
->>control query default MEMORY_MONITOR 'ON';
-
---- SQL operation complete.
->>control query default MEMORY_MONITOR_LOG_INSTANTLY 'on';
-
---- SQL operation complete.
->>control query default MEMORY_MONITOR_LOGFILE 'mml.log';
-
---- SQL operation complete.
->>prepare xx from select * from t006t2;
-
---- SQL command prepared.
->>control query default MEMORY_MONITOR 'OFF';
-
---- SQL operation complete.
->>
->>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/EXPECTED006.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED006.SB b/core/sql/regress/compGeneral/EXPECTED006.SB
index 3d1bf98..58b3b0c 100644
--- a/core/sql/regress/compGeneral/EXPECTED006.SB
+++ b/core/sql/regress/compGeneral/EXPECTED006.SB
@@ -60,9 +60,10 @@
 >>create mv mvx refresh on request initialize on create as select a,sum(b) s_b
 +>from x1 group by a;
 
-*** ERROR[1002] Catalog SEABASE does not exist or has not been registered on node \NSK.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
 
---- SQL operation failed with errors.
 >>
 >>update statistics for table x1 on every column;
 
@@ -138,7 +139,7 @@
 --- SQL operation complete.
 >>prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
 
-*** ERROR[4026] Reading from and inserting into, or updating in, or deleting from the same table, SEABASE.SCH.T006T3, is not currently supported.
+*** ERROR[4026] Reading from and inserting into, or updating in, or deleting from the same table, TRAFODION.SCH.T006T3, is not currently supported.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -275,16 +276,16 @@
 *** ERROR[8822] The statement was not prepared.
 
 >>
->>control query default MODE_SPECIAL_3 'ON';
+>>control query default MODE_SPECIAL_4 'ON';
 
 --- SQL operation complete.
 >>prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
 
-*** ERROR[4045] The operand of function FORMAT must be numeric.
+*** ERROR[4045] The operand of function TO_DATE must be numeric.
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 reset;
+>>control query default MODE_SPECIAL_4 reset;
 
 --- SQL operation complete.
 >>
@@ -548,7 +549,7 @@
 
 >>
 >>-- Error 4065
->>control query default MODE_SPECIAL_3 'ON';
+>>control query default MODE_SPECIAL_4 'ON';
 
 --- SQL operation complete.
 >>prepare xx from select * from t006t1 where to_date(A, '201005') = A;
@@ -559,11 +560,11 @@
 
 >>prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
 
-*** ERROR[4065] The format, "YYYYMM", specified in the TO_DATE function is not supported.
+*** ERROR[4041] Type DATE cannot be compared with type INTEGER.
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 reset;
+>>control query default MODE_SPECIAL_4 reset;
 
 --- SQL operation complete.
 >>
@@ -615,7 +616,7 @@
 >>-- Error 4073
 >>prepare xx from select * from t006t1 where a = (select a from t006t3) collate default;
 
-*** ERROR[4034] The operation (SCALAR_AGGR(SCAN SEABASE.SCH.T006T3) COLLATE DEFAULT)  is not allowed.
+*** ERROR[4034] The operation (SCALAR_AGGR(SCAN TRAFODION.SCH.T006T3) COLLATE DEFAULT)  is not allowed.
 
 *** ERROR[4073] The COLLATE clause may appear only after an expression of character data type, not INTEGER.
 
@@ -641,7 +642,7 @@
 >>-- Error 4122
 >>prepare xx from insert into t006t3 values (NULL);
 
-*** ERROR[4122] NULL cannot be assigned to NOT NULL column SEABASE.SCH.T006T3.A.
+*** ERROR[4122] NULL cannot be assigned to NOT NULL column TRAFODION.SCH.T006T3.A.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -673,7 +674,7 @@
 
 *** ERROR[4310] USER(x) is currently supported only in the outermost SELECT list. For example, it cannot be a part of the subquery.
 
-*** ERROR[4062] The preceding error actually occurred in function USER(SEABASE.SCH.T006T1.A).
+*** ERROR[4062] The preceding error actually occurred in function USER(TRAFODION.SCH.T006T1.A).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -681,7 +682,7 @@
 
 *** ERROR[4310] USER(x) is currently supported only in the outermost SELECT list. For example, it cannot be a part of the subquery.
 
-*** ERROR[4062] The preceding error actually occurred in function USER(SEABASE.SCH.T006T2.A).
+*** ERROR[4062] The preceding error actually occurred in function USER(TRAFODION.SCH.T006T2.A).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -689,7 +690,7 @@
 >>-- Error 4312
 >>prepare xx from update HP_SYSTEM_CATALOG.mxcs_schema.ASSOC2DS set assoc_id = 100;
 
-*** ERROR[4312] HP_SYSTEM_CATALOG.MXCS_SCHEMA.ASSOC2DS is an MXCS metadata table and cannot be directly updated.
+*** ERROR[1002] Catalog HP_SYSTEM_CATALOG does not exist or has not been registered on node .
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -723,13 +724,13 @@
 
 --- SQL command prepared.
 >>
->>control query default MODE_SPECIAL_3 'ON';
+>>control query default MODE_SPECIAL_4 'ON';
 
 --- SQL operation complete.
 >>prepare xx from select * from t006t2 where to_date(A, '99:99:99:99') = A;
 
 --- SQL command prepared.
->>control query default MODE_SPECIAL_3 reset;
+>>control query default MODE_SPECIAL_4 reset;
 
 --- SQL operation complete.
 >>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/EXPECTED013.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED013.SB b/core/sql/regress/compGeneral/EXPECTED013.SB
index 740cff2..97143c6 100644
--- a/core/sql/regress/compGeneral/EXPECTED013.SB
+++ b/core/sql/regress/compGeneral/EXPECTED013.SB
@@ -367,7 +367,55 @@ SCAN
 
 --- 2 row(s) inserted.
 >>
+>>create table fksalta ( id int not null, PRIMARY KEY (id))SALT USING 4 PARTITIONS;
+
+--- SQL operation complete.
+>>
+>>CREATE TABLE fksaltb ( id int not null, val int,
++>  PRIMARY KEY (id),
++>  CONSTRAINT FKsalt FOREIGN KEY (val) REFERENCES fksalta (id))
++>  SALT USING 4 PARTITIONS;
+
+--- SQL operation complete.
+>>
+>>INSERT INTO fksalta VALUES ( 1 );
+
+--- 1 row(s) inserted.
+>>
+>>INSERT INTO fksaltb VALUES ( 1, 1);
+
+--- 1 row(s) inserted.
+>>
+>>INSERT INTO fksaltb VALUES ( 2, 2);
+
+*** ERROR[8103] The operation is prevented by referential integrity constraint TRAFODION.SCH.FKSALT on table TRAFODION.SCH.FKSALTB.
+
+--- 0 row(s) inserted.
+>>
+>>CREATE TABLE fkdiva( store_id integer not null,
++>                   item_id  integer not null,
++>                sale_date date default date '2000-01-01' not null,
++>                  sale_amt numeric(10,2),
++>                   primary key (store_id, item_id, sale_date))
++> division by (date_part('YEARMONTH', sale_date));
+
+--- SQL operation complete.
 >>
+>>create table fkdivb(c1 int not null, c2 int , c3 int, c4  date, primary key(c1), CONSTRAINT FKDIV FOREIGN KEY (c2,c3, c4) REFERENCES fkdiva (store_id,item_id, sale_date));
+
+--- SQL operation complete.
+>>
+>>INSERT INTO fkdiva VALUES ( 1 , 1, date'2016-03-05', 10.2 );
+
+--- 1 row(s) inserted.
+>>INSERT INTO fkdivb VALUES ( 1 , 1, 1, date'2016-03-05');
+
+--- 1 row(s) inserted.
+>>INSERT INTO fkdivb VALUES ( 2 , 2, 1, date'2016-01-25');
+
+*** ERROR[8103] The operation is prevented by referential integrity constraint TRAFODION.SCH.FKDIV on table TRAFODION.SCH.FKDIVB.
+
+--- 0 row(s) inserted.
 >>
 >>--- uk0 should be eliminated
 >>-- two table RI constraint join

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/EXPECTED042
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED042 b/core/sql/regress/compGeneral/EXPECTED042
index 74bb06b..55fb89e 100644
--- a/core/sql/regress/compGeneral/EXPECTED042
+++ b/core/sql/regress/compGeneral/EXPECTED042
@@ -2235,8 +2235,8 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        314           0              3               1
        314           2              1               0
        422           2              1               1
-       471           0              2               3
-       471           1              2               3
+       487           0              2               3
+       487           1              2               3
        492           0              2               1
        492           1              2               1
        619           0              1              14
@@ -2329,8 +2329,8 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        314           0              3               1
        314           2              1               0
        422           2              1               1
-       471           0              2               3
-       471           1              2               3
+       487           0              2               3
+       487           1              2               3
        492           0              2               1
        492           1              2               1
        619           0              1              14

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/TEST006
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST006 b/core/sql/regress/compGeneral/TEST006
index 06a0ff4..e560192 100644
--- a/core/sql/regress/compGeneral/TEST006
+++ b/core/sql/regress/compGeneral/TEST006
@@ -159,9 +159,9 @@ prepare xx from select user(a) from t006t1;
 prepare xx from select ~a from t006t1;
 prepare xx from select sin(a) from t006t1;
 
-control query default MODE_SPECIAL_3 'ON';
+control query default MODE_SPECIAL_4 'ON';
 prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
-control query default MODE_SPECIAL_3 reset;
+control query default MODE_SPECIAL_4 reset;
 
 -- Error 4046
 prepare xx from select ~(a) from t006t7;
@@ -233,10 +233,10 @@ control query default MODE_SPECIAL_3 reset;
 prepare xx from select a**a from t006t1;
 
 -- Error 4065
-control query default MODE_SPECIAL_3 'ON';
+control query default MODE_SPECIAL_4 'ON';
 prepare xx from select * from t006t1 where to_date(A, '201005') = A;
 prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
-control query default MODE_SPECIAL_3 reset;
+control query default MODE_SPECIAL_4 reset;
 
 -- Error 4067
 prepare xx from select * from table (explain(NULL, 5));
@@ -295,9 +295,9 @@ prepare xx from select queryid_extract(a, b) from t006t4;
 prepare xx from select round(3.224, 3, 2) from t006t1;
 prepare xx from select user(a) from t006t1;
 
-control query default MODE_SPECIAL_3 'ON';
+control query default MODE_SPECIAL_4 'ON';
 prepare xx from select * from t006t2 where to_date(A, '99:99:99:99') = A;
-control query default MODE_SPECIAL_3 reset;
+control query default MODE_SPECIAL_4 reset;
 
 prepare xx from select current_running from t006t1;
 prepare xx from select position(a in a) from t006t4;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/TEST013
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST013 b/core/sql/regress/compGeneral/TEST013
index ceca013..9e77bcf 100644
--- a/core/sql/regress/compGeneral/TEST013
+++ b/core/sql/regress/compGeneral/TEST013
@@ -167,7 +167,31 @@ create table t_013 ( a int not null,
 
 insert into t_013 values (1, 'abc', 'def'), (2, 'ghi', 'jkl');
 
+create table fksalta ( id int not null, PRIMARY KEY (id))SALT USING 4 PARTITIONS;
 
+CREATE TABLE fksaltb ( id int not null, val int,
+  PRIMARY KEY (id),
+  CONSTRAINT FKsalt FOREIGN KEY (val) REFERENCES fksalta (id))
+  SALT USING 4 PARTITIONS;
+
+INSERT INTO fksalta VALUES ( 1 );
+
+INSERT INTO fksaltb VALUES ( 1, 1);
+
+INSERT INTO fksaltb VALUES ( 2, 2);
+
+CREATE TABLE fkdiva( store_id integer not null,
+                   item_id  integer not null,
+                sale_date date default date '2000-01-01' not null,
+                  sale_amt numeric(10,2),
+                   primary key (store_id, item_id, sale_date))
+ division by (date_part('YEARMONTH', sale_date));
+
+create table fkdivb(c1 int not null, c2 int , c3 int, c4  date, primary key(c1), CONSTRAINT FKDIV FOREIGN KEY (c2,c3, c4) REFERENCES fkdiva (store_id,item_id, sale_date));
+
+INSERT INTO fkdiva VALUES ( 1 , 1, date'2016-03-05', 10.2 );
+INSERT INTO fkdivb VALUES ( 1 , 1, 1, date'2016-03-05');
+INSERT INTO fkdivb VALUES ( 2 , 2, 1, date'2016-01-25');
 
 --- uk0 should be eliminated
 -- two table RI constraint join
@@ -347,5 +371,9 @@ drop table uk1;
 drop table uk2;
 drop table uk3;
 drop table t_013;
+drop table fksalta CASCADE;
+drop table fksaltb CASCADE;
+drop table fkdiva  CASCADE;
+drop table fkdivb  CASCADE;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/EXPECTED001.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED001.SB b/core/sql/regress/core/EXPECTED001.SB
index 2cbd15d..8870be4 100644
--- a/core/sql/regress/core/EXPECTED001.SB
+++ b/core/sql/regress/core/EXPECTED001.SB
@@ -13,11 +13,12 @@
 >>
 >>invoke t001t1;
 
--- Definition of Seabase table SEABASE.SCH.T001T1
--- Definition current  Wed Jul 31 14:25:27 2013
+-- Definition of Trafodion table TRAFODION.SCH.T001T1
+-- Definition current  Mon Mar  7 19:30:10 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                CHAR(9) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   , C                                INT DEFAULT NULL
@@ -30,11 +31,12 @@
 >>#ifMX
 >>invoke $$TEST_SCHEMA$$.t001ut1;
 
--- Definition of Seabase table SEABASE.SCH.T001UT1
--- Definition current  Wed Jul 31 14:25:27 2013
+-- Definition of Trafodion table TRAFODION.SCH.T001UT1
+-- Definition current  Mon Mar  7 19:30:10 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                CHAR(9) CHARACTER SET UCS2 COLLATE DEFAULT
       DEFAULT NULL
   , C                                INT DEFAULT NULL
@@ -184,19 +186,19 @@ A
 >>
 >>select b || NULL from t001t1;
 
-*** ERROR[4097] A NULL operand is not allowed in function (SEABASE.SCH.T001T1.B || NULL).
+*** ERROR[4097] A NULL operand is not allowed in function (TRAFODION.SCH.T001T1.B || NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
 >>select NULL || b from t001t1;
 
-*** ERROR[4097] A NULL operand is not allowed in function (NULL || SEABASE.SCH.T001T1.B).
+*** ERROR[4097] A NULL operand is not allowed in function (NULL || TRAFODION.SCH.T001T1.B).
 
 *** ERROR[8822] The statement was not prepared.
 
 >>select a from t001t1 where c between 2 and null;
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.C BETWEEN 2 AND NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.C BETWEEN 2 AND NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -208,13 +210,13 @@ A
 
 >>select a from t001t1 where b like null;
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.B LIKE NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.B LIKE NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
 >>select a from t001t1 where b like 'x' escape null;
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.B like 'x' escape NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.B like 'x' escape NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -261,7 +263,7 @@ A
 
 >>select DateFormat 	(null, usa) from t001t1;
 
-*** ERROR[4097] A NULL operand is not allowed in function (DATEFORMAT(NULL)).
+*** ERROR[4097] A NULL operand is not allowed in function (DATEFORMAT(NULL, USA)).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -345,6 +347,18 @@ A
 
 *** ERROR[8822] The statement was not prepared.
 
+>>select To_char   	(null, 'YYYYMMDD') from t001t1;
+
+*** ERROR[4097] A NULL operand is not allowed in function (TO_CHAR(NULL, 'YYYYMMDD')).
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select To_date   	(null, 'YYYYMMDD') from t001t1;
+
+*** ERROR[4097] A NULL operand is not allowed in function (TO_DATE(NULL, 'YYYYMMDD')).
+
+*** ERROR[8822] The statement was not prepared.
+
 >>select Trim  		(null) from t001t1;
 
 *** ERROR[4097] A NULL operand is not allowed in function TRIM, LTRIM or RTRIM.
@@ -379,7 +393,7 @@ A
 
 >>select a from t001t1 where c in (1,null,2);
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.C = NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.C = NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -398,13 +412,13 @@ A
 
 >>select (case a when null then 1 else 2 end) from t001t1;
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.A = NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.A = NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
 >>select (case a when 1 then 1 when null then 2 else 3 end) from t001t1;
 
-*** ERROR[4099] A NULL operand is not allowed in predicate (SEABASE.SCH.T001T1.A = NULL).
+*** ERROR[4099] A NULL operand is not allowed in predicate (TRAFODION.SCH.T001T1.A = NULL).
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -485,8 +499,8 @@ A            B          C            D     (EXPR)
 A            B          C            D   
 -----------  ---------  -----------  ----
 
-         20  defg                30  wx  
         101  abc                 20  xy  
+         20  defg                30  wx  
 
 --- 2 row(s) selected.
 >>
@@ -501,8 +515,8 @@ A            B          C            D
 A            B          C            D   
 -----------  ---------  -----------  ----
 
-         20  defg                30  wx  
         101  abc                 20  xy  
+         20  defg                30  wx  
 
 --- 2 row(s) selected.
 >>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/EXPECTED037.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED037.SB b/core/sql/regress/core/EXPECTED037.SB
index 144e600..809df01 100755
--- a/core/sql/regress/core/EXPECTED037.SB
+++ b/core/sql/regress/core/EXPECTED037.SB
@@ -75,10 +75,11 @@
 >>invoke table_name;
 
 -- Definition of Trafodion table TRAFODION.SCH.TABLE_NAME
--- Definition current  Fri Aug  8 22:34:29 2014
+-- Definition current  Thu Feb 25 06:24:08 2016
 
   (
-    ABSOLUTE                         INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , ABSOLUTE                         INT NO DEFAULT NOT NULL NOT DROPPABLE
   , ACCESS                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , ANSIVARCHAR                      INT NO DEFAULT NOT NULL NOT DROPPABLE
   , ASCENDING                        INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -223,10 +224,11 @@
 >>invoke system_name;
 
 -- Definition of Trafodion table TRAFODION.SCH.SYSTEM_NAME
--- Definition current  Fri Aug  8 22:34:33 2014
+-- Definition current  Thu Feb 25 06:24:10 2016
 
   (
-    LARGEINT                         INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , LARGEINT                         INT NO DEFAULT NOT NULL NOT DROPPABLE
   , LEADING_PRECISION                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , LENGTH                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , LINE_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -648,7 +650,7 @@ SELECT GENERAL GENERAL from (values(0)) GENERAL(GENERAL);
 
 *** ERROR[15001] A syntax error occurred at or before: 
 SELECT IDENTITY IDENTITY from (values(0)) IDENTITY(IDENTITY);
-                       ^ (24 characters from start of SQL statement)
+              ^ (15 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -1010,7 +1012,7 @@ SELECT ROUTINE ROUTINE from (values(0)) ROUTINE(ROUTINE);
 
 *** ERROR[15001] A syntax error occurred at or before: 
 SELECT ROW ROW from (values(0)) ROW(ROW);
-             ^ (14 characters from start of SQL statement)
+         ^ (10 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/EXPECTED056.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED056.SB b/core/sql/regress/core/EXPECTED056.SB
index c1621af..4eb2f50 100755
--- a/core/sql/regress/core/EXPECTED056.SB
+++ b/core/sql/regress/core/EXPECTED056.SB
@@ -2026,9 +2026,6 @@ T056T56_COL            T056T56_COL2  T056T56_COL3  T056T56_COL4
 
 --- 1 row(s) selected.
 >>
->>cqd hbase_filter_preds 'on' ;
-
---- SQL operation complete.
 >>create table t056t57 (a1 numeric(2,2) signed default 0 not null);
 
 --- SQL operation complete.
@@ -2153,9 +2150,6 @@ A1
     .00
 
 --- 1 row(s) selected.
->>cqd hbase_filter_preds '2' ;
-
---- SQL operation complete.
 >>
 >>obey TEST056(tests4);
 >>obey test056(test4OLTops);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/EXPECTED061.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED061.SB b/core/sql/regress/core/EXPECTED061.SB
index 7d026dd..f25fb2a 100755
--- a/core/sql/regress/core/EXPECTED061.SB
+++ b/core/sql/regress/core/EXPECTED061.SB
@@ -10,10 +10,11 @@
 >>invoke t2421;
 
 -- Definition of Trafodion table TRAFODION.SCH.T2421
--- Definition current  Sun Aug 17 13:04:04 2014
+-- Definition current  Thu Feb 25 06:40:41 2016
 
   (
-    A                                DECIMAL(1, 0) UNSIGNED DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                DECIMAL(1, 0) UNSIGNED DEFAULT NULL
   , B                                DECIMAL(1, 1) UNSIGNED DEFAULT NULL
   , C                                DECIMAL(18, 8) DEFAULT NULL
   , D                                DECIMAL(2, 1) DEFAULT NULL
@@ -47,10 +48,11 @@ A  B   C                     D     E    F   H
 >>invoke        t101t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T101T2
--- Definition current  Sun Aug 17 13:04:07 2014
+-- Definition current  Thu Feb 25 06:40:43 2016
 
   (
-    C01                              CHAR(2) CHARACTER SET ISO88591 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C01                              CHAR(2) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   , C02                              CHAR(2) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
@@ -103,13 +105,14 @@ ab   4    abcdefghijklmnopqrstu  1
 >>invoke t104t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T104T2
--- Definition current  Sun Aug 17 13:04:09 2014
+-- Definition current  Thu Feb 25 06:40:45 2016
 
   (
     C                                CHAR(15) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (C ASC, D ASC)
 
 --- SQL operation complete.
 >>showddl t104t2;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/EXPECTED116
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116
index 42092e2..1128c8e 100644
--- a/core/sql/regress/core/EXPECTED116
+++ b/core/sql/regress/core/EXPECTED116
@@ -335,13 +335,17 @@ A1           C1           B1
 +>   c varchar(4) character set utf8 not null);
 
 --- SQL operation complete.
+>>create view t116v1 as select * from t116t1;
+
+--- SQL operation complete.
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:04:39 2016
+-- Definition current  Sun Mar 13 00:13:59 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                VARCHAR(2) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
@@ -352,16 +356,46 @@ A1           C1           B1
 >>begin work;
 
 --- SQL operation complete.
+>>invoke t116t1;
+
+-- Definition of Trafodion table TRAFODION.SCH.T116T1
+-- Definition current  Sun Mar 13 00:13:59 2016
+
+  (
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(2) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:00 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(2) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>alter table t116t1 alter column b varchar(3);
 
 --- SQL operation complete.
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:04:40 2016
+-- Definition current  Sun Mar 13 00:14:10 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
@@ -369,16 +403,31 @@ A1           C1           B1
   )
 
 --- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:10 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>commit work;
 
 --- SQL operation complete.
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:04:51 2016
+-- Definition current  Sun Mar 13 00:14:14 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
@@ -386,20 +435,64 @@ A1           C1           B1
   )
 
 --- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:15 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>
 >>begin work;
 
 --- SQL operation complete.
+>>invoke t116t1;
+
+-- Definition of Trafodion table TRAFODION.SCH.T116T1
+-- Definition current  Sun Mar 13 00:14:15 2016
+
+  (
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL /*altered_col*/
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:15 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>alter table t116t1 alter column b varchar(4);
 
 --- SQL operation complete.
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:04:52 2016
+-- Definition current  Sun Mar 13 00:14:25 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                VARCHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
@@ -407,6 +500,20 @@ A1           C1           B1
   )
 
 --- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:25 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(4) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>rollback work;
 
 --- SQL operation complete.
@@ -414,10 +521,11 @@ A1           C1           B1
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:05:01 2016
+-- Definition current  Sun Mar 13 00:14:30 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
@@ -425,9 +533,23 @@ A1           C1           B1
   )
 
 --- SQL operation complete.
+>>invoke t116v1;
+
+-- Definition of Trafodion view TRAFODION.SCH.T116V1
+-- Definition current  Sun Mar 13 00:14:30 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(3) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>
 >>-- concurrent ddl operations
->>drop table if exists t116t1;
+>>drop table if exists t116t1 cascade;
 
 --- SQL operation complete.
 >>begin work;
@@ -472,10 +594,11 @@ End of MXCI Session
 >>invoke t116t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T116T1
--- Definition current  Mon Feb 15 16:05:22 2016
+-- Definition current  Sun Mar 13 00:14:46 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   )
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/TEST001
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST001 b/core/sql/regress/core/TEST001
index 023ac31..cd0ec0a 100755
--- a/core/sql/regress/core/TEST001
+++ b/core/sql/regress/core/TEST001
@@ -111,6 +111,8 @@ select Position 	(b in null) from t001t1;
 select rtrim            (null) from t001t1;
 select Substring	(null from 2) from t001t1;
 select Substring	(b from null) from t001t1;
+select To_char   	(null, 'YYYYMMDD') from t001t1;
+select To_date   	(null, 'YYYYMMDD') from t001t1;
 select Trim  		(null) from t001t1;
 select Upper  		(null) from t001t1;
 select Upshift  	(null) from t001t1;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/TEST029
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST029 b/core/sql/regress/core/TEST029
index adfc463..7601251 100755
--- a/core/sql/regress/core/TEST029
+++ b/core/sql/regress/core/TEST029
@@ -39,7 +39,6 @@ obey TEST029(ddbMX);
 drop   table MT;
 create table MT(a int);		-- empty table, for NULL data source
 #ifMX
-cqd hbase_filter_preds 'on' ;
 log  LOG029 clear;
 obey TEST029(tests);
 obey TEST029(ddbMXMP);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/TEST056
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST056 b/core/sql/regress/core/TEST056
index 41b8e40..8629a17 100755
--- a/core/sql/regress/core/TEST056
+++ b/core/sql/regress/core/TEST056
@@ -807,7 +807,6 @@ alter table t056t56 add column t056t56_col3 pic 9 default +00;
 alter table t056t56 add column t056t56_col4 decimal default 0;
 select * from t056t56;
 
-cqd hbase_filter_preds 'on' ;
 create table t056t57 (a1 numeric(2,2) signed default 0 not null);
 showddl t056t57;
 insert into t056t57 default values;
@@ -832,7 +831,6 @@ create table t056t61 (a1 numeric(2,2) default -0.0 not null);
 showddl t056t61;
 insert into t056t61 default values;
 select * from t056t61;
-cqd hbase_filter_preds '2' ;
 
 ?section test4ddl
 ------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/core/TEST116
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST116 b/core/sql/regress/core/TEST116
index 9d04754..663a593 100755
--- a/core/sql/regress/core/TEST116
+++ b/core/sql/regress/core/TEST116
@@ -143,22 +143,31 @@ insert into t116t3 values(2,2,'b');
 drop table if exists t116t1;
 create table t116t1(a int not null, b varchar(2), 
    c varchar(4) character set utf8 not null);
+create view t116v1 as select * from t116t1;
 invoke t116t1;
 begin work;
+invoke t116t1;
+invoke t116v1;
 alter table t116t1 alter column b varchar(3);
 invoke t116t1;
+invoke t116v1;
 commit work;
 invoke t116t1;
+invoke t116v1;
 
 begin work;
+invoke t116t1;
+invoke t116v1;
 alter table t116t1 alter column b varchar(4);
 invoke t116t1;
+invoke t116v1;
 rollback work;
 
 invoke t116t1;
+invoke t116v1;
 
 -- concurrent ddl operations
-drop table if exists t116t1;
+drop table if exists t116t1 cascade;
 begin work;
 create table t116t1 (a int);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED001
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED001 b/core/sql/regress/executor/EXPECTED001
index cc27d67..26e1f4e 100755
--- a/core/sql/regress/executor/EXPECTED001
+++ b/core/sql/regress/executor/EXPECTED001
@@ -32,11 +32,12 @@
 >>
 >>invoke t001t1;
 
--- Definition of table CAT.SCH.T001T1
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001T1
+-- Definition current  Thu Feb 25 07:44:34 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                CHAR(9) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   , C                                INT DEFAULT NULL
@@ -47,13 +48,13 @@
 --- SQL operation complete.
 >>invoke t001tn;
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 --- SQL operation failed with errors.
 >>invoke t001t2;
 
--- Definition of table CAT.SCH.T001T2
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001T2
+-- Definition current  Thu Feb 25 07:44:36 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -63,12 +64,13 @@
   , D                                CHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke t001t3;
 
--- Definition of table CAT.SCH.T001T3
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001T3
+-- Definition current  Thu Feb 25 07:44:38 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -78,17 +80,19 @@
   , D                                CHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC, B ASC)
 
 --- SQL operation complete.
 >>
 >>#ifMX
 >>invoke $$TEST_SCHEMA$$.t001ut1;
 
--- Definition of table CAT.SCH.T001UT1
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001UT1
+-- Definition current  Thu Feb 25 07:44:38 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                CHAR(9) CHARACTER SET UCS2 COLLATE DEFAULT
       DEFAULT NULL
   , C                                INT DEFAULT NULL
@@ -99,8 +103,8 @@
 --- SQL operation complete.
 >>invoke $$TEST_SCHEMA_NAME$$.t001ut2;
 
--- Definition of table CAT.SCH.T001UT2
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001UT2
+-- Definition current  Thu Feb 25 07:44:39 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -110,12 +114,13 @@
   , D                                CHAR(4) CHARACTER SET UCS2 COLLATE DEFAULT
       DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke         t001ut3;
 
--- Definition of table CAT.SCH.T001UT3
--- Definition current  Tue Aug 10 22:34:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T001UT3
+-- Definition current  Thu Feb 25 07:44:40 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -125,6 +130,7 @@
   , D                                CHAR(4) CHARACTER SET UCS2 COLLATE DEFAULT
       DEFAULT NULL
   )
+  PRIMARY KEY (A ASC, B ASC)
 
 --- SQL operation complete.
 >>#ifMX
@@ -173,8 +179,8 @@ A            B          C            D
 A            B          C            D   
 -----------  ---------  -----------  ----
 
-         20  defg                30  wx  
          10  abc                 20  xy  
+         20  defg                30  wx  
 
 --- 2 row(s) selected.
 >>select * from t001t3;
@@ -202,8 +208,8 @@ A            B                   C            D
 A            B                   C            D       
 -----------  ------------------  -----------  --------
 
-         20  defg                         30  wx      
          10  abc                          20  xy      
+         20  defg                         30  wx      
 
 --- 2 row(s) selected.
 >>select * from t001ut3;
@@ -211,8 +217,8 @@ A            B                   C            D
 A            B                   C            D       
 -----------  ------------------  -----------  --------
 
-         20  defg                         30  wx      
          10  abc                          20  xy      
+         20  defg                         30  wx      
 
 --- 2 row(s) selected.
 >>#ifMX
@@ -396,10 +402,10 @@ A            D
 A            B                   C            D         A            B                   C            D
 -----------  ------------------  -----------  --------  -----------  ------------------  -----------  --------
 
-         10  abc                          20  xy                 20  defg                         30  wx      
          10  abc                          20  xy                 10  abc                          20  xy      
-         20  defg                         30  wx                 20  defg                         30  wx      
+         10  abc                          20  xy                 20  defg                         30  wx      
          20  defg                         30  wx                 10  abc                          20  xy      
+         20  defg                         30  wx                 20  defg                         30  wx      
 
 --- 4 row(s) selected.
 >>#ifMX
@@ -554,14 +560,14 @@ select a from t001t1 where b like _SJIS'sj';
 >>
 >>select b from t001tn UNION     select d from t001tn;
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
 >>			-- not comparable
 >>select b from t001tn UNION ALL select d from t001tn;
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -569,7 +575,7 @@ select a from t001t1 where b like _SJIS'sj';
 >>select * from (
 +>  select b from t001tn UNION ALL select d from t001tn) u(b) where b='x';
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -577,7 +583,7 @@ select a from t001t1 where b like _SJIS'sj';
 >>select * from (
 +>  select b from t001tn UNION ALL select d from t001tn) u(b) where b=(select b from t001tn);
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -586,7 +592,7 @@ select a from t001t1 where b like _SJIS'sj';
 
 *** WARNING[3169] SJIS is not a known collation.
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -595,7 +601,7 @@ select a from t001t1 where b like _SJIS'sj';
 
 *** WARNING[3169] SJIS is not a known collation.
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -605,7 +611,7 @@ select a from t001t1 where b like _SJIS'sj';
 
 *** WARNING[3169] SJIS is not a known collation.
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -613,7 +619,7 @@ select a from t001t1 where b like _SJIS'sj';
 
 *** WARNING[3169] XYZW is not a known collation.
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -622,7 +628,7 @@ select a from t001t1 where b like _SJIS'sj';
 
 *** WARNING[3169] XYZW is not a known collation.
 
-*** ERROR[4082] Object CAT.SCH.T001TN does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T001TN does not exist or is inaccessible.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -663,8 +669,8 @@ A            A
 A            A          
 -----------  -----------
 
-         10           20
          10           10
+         10           20
          20           10
 
 --- 3 row(s) selected.
@@ -675,8 +681,8 @@ A            A
 A            A          
 -----------  -----------
 
-         10           20
          10           10
+         10           20
          20           10
 
 --- 3 row(s) selected.
@@ -696,10 +702,10 @@ A            A
 A            B          C            D     A            B          C            D
 -----------  ---------  -----------  ----  -----------  ---------  -----------  ----
 
-         10  abc                 20  xy             20  defg                30  wx  
          10  abc                 20  xy             10  abc                 20  xy  
-         20  defg                30  wx             20  defg                30  wx  
+         10  abc                 20  xy             20  defg                30  wx  
          20  defg                30  wx             10  abc                 20  xy  
+         20  defg                30  wx             20  defg                30  wx  
 
 --- 4 row(s) selected.
 >>
@@ -737,8 +743,8 @@ A
 A            B        
 -----------  ---------
 
-         20  defg     
          10  abc      
+         20  defg     
 
 --- 2 row(s) selected.
 >>
@@ -766,8 +772,8 @@ A
 A          
 -----------
 
-         20
          10
+         20
 
 --- 2 row(s) selected.
 >>select x.a, x.b from (select a, b, c from t001ut1 natural join t001ut2) x join t001ut3
@@ -886,8 +892,8 @@ A            B          C            D
 A            B          C            D   
 -----------  ---------  -----------  ----
 
-         20  gfe                 31  wx  
          10  abc                 20  xy  
+         20  gfe                 31  wx  
 
 --- 2 row(s) selected.
 >>
@@ -914,8 +920,8 @@ A            B                   C            D
 A            B                   C            D       
 -----------  ------------------  -----------  --------
 
-         20  gfe                          31  wx      
          10  abc                          20  xy      
+         20  gfe                          31  wx      
 
 --- 2 row(s) selected.
 >>#ifMX

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED013.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED013.SB b/core/sql/regress/executor/EXPECTED013.SB
index 808f9ef..b83960c 100644
--- a/core/sql/regress/executor/EXPECTED013.SB
+++ b/core/sql/regress/executor/EXPECTED013.SB
@@ -21,10 +21,11 @@
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:35:15 2016
+-- Definition current  Sat Mar 12 07:39:38 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   )
 
 --- SQL operation complete.
@@ -49,12 +50,13 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Sun Feb 21 07:35:27 2016
+-- Definition current  Sat Mar 12 07:39:53 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>insert into t013t1 values (1,2);
@@ -111,10 +113,11 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:36:26 2016
+-- Definition current  Sat Mar 12 07:40:59 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   )
 
 --- SQL operation complete.
@@ -136,13 +139,14 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Sun Feb 21 07:36:38 2016
+-- Definition current  Sat Mar 12 07:41:18 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                INT DEFAULT NULL
   , C                                INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>insert into t013t1 values (1,2,3);
@@ -175,10 +179,11 @@ A            B            C
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:36:52 2016
+-- Definition current  Sat Mar 12 07:41:32 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   )
 
 --- SQL operation complete.
@@ -197,7 +202,7 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Sun Feb 21 07:36:58 2016
+-- Definition current  Sat Mar 12 07:41:38 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -205,6 +210,7 @@ A
   , C                                INT DEFAULT NULL
   , D                                INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>insert into t013t1 values (1,2,3,4);
@@ -335,7 +341,7 @@ CREATE VIEW TRAFODION.T013_SCH.TEMPV AS
 >>-- this will return an error, no permanent table exists
 >>alter table t013t2 add column z int default 0 not null;
 
-*** ERROR[4082] Object TRAFODION.T013_SCH.T013T2 does not exist or is inaccessible.
+*** ERROR[1146] Object TRAFODION.T013_SCH.T013T2 could not be altered because it either does not exist or is not a table.
 
 --- SQL operation failed with errors.
 >>
@@ -449,10 +455,11 @@ CONTROL QUERY DEFAULT
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:37:55 2016
+-- Definition current  Sat Mar 12 07:42:40 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , Z                                INT DEFAULT 0 NOT NULL NOT DROPPABLE
       /*added_col*/
   )
@@ -469,10 +476,11 @@ CONTROL QUERY DEFAULT
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:38:00 2016
+-- Definition current  Sat Mar 12 07:42:49 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , Z                                INT DEFAULT 0 NOT NULL NOT DROPPABLE
       /*added_col*/
   )
@@ -560,10 +568,11 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Sun Feb 21 07:38:45 2016
+-- Definition current  Sat Mar 12 07:43:35 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT DEFAULT NULL
   )
 
@@ -577,11 +586,12 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion volatile table T013T3
--- Definition current  Sun Feb 21 07:38:50 2016
+-- Definition current  Sat Mar 12 07:43:40 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>
@@ -592,10 +602,11 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Sun Feb 21 07:39:03 2016
+-- Definition current  Sat Mar 12 07:43:52 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT DEFAULT NULL
   )
 
@@ -657,10 +668,11 @@ CREATE VOLATILE TABLE T013T3
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Sun Feb 21 07:39:46 2016
+-- Definition current  Sat Mar 12 07:44:35 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT DEFAULT NULL
   )
 
@@ -1278,10 +1290,11 @@ CREATE VOLATILE TABLE T013T1
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Sun Feb 21 07:46:01 2016
+-- Definition current  Sat Mar 12 07:51:06 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , Z                                INT DEFAULT 0 NOT NULL NOT DROPPABLE
       /*added_col*/
   )



[43/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/perlpython.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/perlpython.adoc b/docs/command_interface/src/asciidoc/_chapters/perlpython.adoc
index f560abd..2516849 100644
--- a/docs/command_interface/src/asciidoc/_chapters/perlpython.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/perlpython.adoc
@@ -23,17 +23,17 @@
   */
 ////
 
-= Run TrafCI From Perl or Python
+= Run trafci From Perl or Python
 
-You can execute SQL statements in Perl or Python by invoking the TrafCI
+You can execute SQL statements in Perl or Python by invoking the trafci
 Perl or Python wrapper script.
 
-These instructions assume that you installed the TrafCI product. For more information,
+These instructions assume that you installed the trafci product. For more information,
 see <<install, Install and Configure>>.
 
 == Set the Login Environment Variables
 
-Before launching TrafCI from Perl or Python, set these login environment variables:
+Before launching trafci from Perl or Python, set these login environment variables:
 
 
 [cols="45%l,55%",options="header"]
@@ -181,9 +181,9 @@ script is `trafci.py`. By default, these wrapper scripts are located in the `bin
 | Linux/Unix       | <trafci-installation-directory>/trafci/bin
 |===
 
-_trafci-installation-directory_ is the directory where you installed the TrafCI software files.
+_trafci-installation-directory_ is the directory where you installed the trafci software files.
 
-== Launch TrafCI From the Perl or Python Command Line
+== Launch trafci From the Perl or Python Command Line
 
 You can launch the Perl or Python wrapper scripts as shown below:
 
@@ -197,62 +197,26 @@ You can launch the Perl or Python wrapper scripts as shown below:
 <<<
 === Example Perl Program (`sample.pl`)
 
-[source,perl]
-----
-use lib 'C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\perl';
-use Session;
-
-# create a new session
-$sess = Session->new();
-
-# connect to the database
-$sess->connect("user1","password","16.123.456.78","37800");
-
-$retval=$sess->execute(" set schema TRAFODION.CI_SAMPLE ");
-print $retval;
+You can download the `sample.pl` example from
+http://trafodion.incubator.apache.org/docs/command_interface/resources/source/sample.pl.
 
-# Execute sample queries
-$retval=$sess->execute("select * from employee"); print $retval;
-$retval=$sess->execute("get statistics"); print $retval;
+Alternatively, copy and paste the following code into a file named `sample.pl`:
 
-# disconnect from the database
-print "\n\nSession 1: Disconnecting first session. \n\n";
-$sess->disconnect();
+[source,perl]
+----
+include::{sourcedir}/sample.pl[]
 ----
 
 <<<
 === Example Python Program (`sample.py`)
 
-[source,python]
-----
-import os import sys
+You can download the `sample.py` example from
+http://trafodion.incubator.apache.org/docs/command_interface/resources/source/sample.py.
 
-## Modify this path
-sys.path.append("C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\python")
-import Session
+Alternatively, copy and paste the following code into a file named `sample.py`:
 
-# create a new session
-sess = Session.Session()
-
-# Connect to the database
-x=sess. connect ("user1","password","16.123.456.78","37800")
-
-# Execute sample queries
-
-# execute takes the query string as argument
-setSchema = "set schema TRAFODION.CI_SAMPLE"
-selectTable = "select * from employee"
-getStats = "get statistics"
-
-#Contruct a list of SQL statements to be executed
-queryList = [setSchema, selectTable, getStats] print "\n";
-
-for query in queryList:
-   print sess.execute (query)
-
-# disconnect the session
-sess.disconnect()
-del sess
-sess=None
+[source,python]
+----
+include::{sourcedir}/sample.py[]
 ----
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/_chapters/scripts.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/_chapters/scripts.adoc b/docs/command_interface/src/asciidoc/_chapters/scripts.adoc
index 9c70f7e..e74107d 100644
--- a/docs/command_interface/src/asciidoc/_chapters/scripts.adoc
+++ b/docs/command_interface/src/asciidoc/_chapters/scripts.adoc
@@ -28,7 +28,7 @@
 [[script_create]]
 == Create a Script File
 
-A script file that you run in TrafCI must be an ASCII text file that contains only these elements:
+A script file that you run in trafci must be an ASCII text file that contains only these elements:
 
 * <<script_sql_statements, SQL Statements>>
 * <<script_commands, Commands>>
@@ -37,13 +37,13 @@ A script file that you run in TrafCI must be an ASCII text file that contains on
 
 For an example, see <script_example, Example Script File>>.
 
-NOTE: You cannot use shell commands in a script file that you run in TrafCI. To create shell scripts
-that run TrafCI, see <<perl_or_python, Run TrafCI from Perl or Python>>.
+NOTE: You cannot use shell commands in a script file that you run in trafci. To create shell scripts
+that run trafci, see <<perl_or_python, Run trafci from Perl or Python>>.
 
 [[script_sql_statements]]
 == SQL Statements
 
-Script files support any of the various SQL statements that you can run in TrafCI. For more information about
+Script files support any of the various SQL statements that you can run in trafci. For more information about
 SQL statements, see the
 http://trafodion.incubator.apache.org/docs/sql_reference/index.html[_Trafodion SQL Reference Manual_].
 
@@ -78,7 +78,7 @@ To create sections of commands within a script file, put a section header at the
 ====
 
 The `_section-name_` cannot begin with a number or an underscore. Each section name in a script file should be unique
-because TrafCI executes the first section that it finds that matches the section name in the `@` or `OBEY` command.
+because trafci executes the first section that it finds that matches the section name in the `@` or `OBEY` command.
 For more information, see the <<cmd_at_sign, @ Command>> <<cmd_obey, OBEY Command>>.
 
 [[script_example]]
@@ -90,8 +90,8 @@ image:{images}/script.jpg[Sample script]
 
 == Run a Script File
 
-To run a script file in TrafCI, use the `@` or OBEY command. The `@` and `OBEY` commands run one script file at a time
-in TrafCI. To run a script file when launching TrafCI, see <<trafci_run_script, Run Script When Launching TrafCI>>.
+To run a script file in trafci, use the `@` or OBEY command. The `@` and `OBEY` commands run one script file at a time
+in trafci. To run a script file when launching trafci, see <<trafci_run_script, Run Script When Launching trafci>>.
 
 *Example*
 
@@ -146,16 +146,16 @@ the <<cmd_obey, OBEY Command>>.
 
 == Log Output
 
-To log output of an TrafCI session while running one script file at a time, use the `SPOOL` or `LOG` command.
-When you run an `OBEY` or `@` command, TrafCI displays each command in the script file, the output for each
-command, and diagnostic messages in TrafCI. The `SPOOL` or `LOG` command captures this output as it appears
-in TrafCI and logs it in a log file.
+To log output of an trafci session while running one script file at a time, use the `SPOOL` or `LOG` command.
+When you run an `OBEY` or `@` command, trafci displays each command in the script file, the output for each
+command, and diagnostic messages in trafci. The `SPOOL` or `LOG` command captures this output as it appears
+in trafci and logs it in a log file.
 
 For more information, <<interactive_log_output, Log Output>>.
 
 == Run Scripts in Parallel
 
-In TrafCI, the `@` and `OBEY` commands allow you to run only one script file at a time. However, the `PRUN` command
+In trafci, the `@` and `OBEY` commands allow you to run only one script file at a time. However, the `PRUN` command
 allows you to run multiple script files simultaneously.
 
 The `PRUN` command is most useful for running sets of data definition language (DDL) statements simultaneously, which

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/asciidoc/index.adoc b/docs/command_interface/src/asciidoc/index.adoc
index c39e642..a9d1bec 100644
--- a/docs/command_interface/src/asciidoc/index.adoc
+++ b/docs/command_interface/src/asciidoc/index.adoc
@@ -35,6 +35,7 @@
 :title-logo-image: ../../../shared/trafodion-logo.jpg
 
 :images: ../images
+:sourcedir: ../../resources/source
 :leveloffset: 1
 
 // The directory is called _chapters because asciidoctor skips direct
@@ -56,9 +57,12 @@ specific language governing permissions and limitations under the License.
 
 Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation. Java® is a registered trademark of Oracle and/or its affiliates. DbVisualizer™ is a trademark of DbVis Software AB.
 
+*Revision History*
+
 [cols="2",options="header"]
 |===
 | Version    | Date
+| 2.0.0      | To be announced.
 | 1.3.0      | January, 2016  
 |===
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/resources/source/sample.pl
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/resources/source/sample.pl b/docs/command_interface/src/resources/source/sample.pl
new file mode 100644
index 0000000..8fdfd38
--- /dev/null
+++ b/docs/command_interface/src/resources/source/sample.pl
@@ -0,0 +1,19 @@
+use lib 'C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\perl';
+use Session;
+
+# create a new session
+$sess = Session->new();
+
+# connect to the database
+$sess->connect("user1","password","16.123.456.78","23400");
+
+$retval=$sess->execute(" set schema TRAFODION.CI_SAMPLE ");
+print $retval;
+
+# Execute sample queries
+$retval=$sess->execute("select * from employee"); print $retval;
+$retval=$sess->execute("get statistics"); print $retval;
+
+# disconnect from the database
+print "\n\nSession 1: Disconnecting first session. \n\n";
+$sess->disconnect();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/command_interface/src/resources/source/sample.py
----------------------------------------------------------------------
diff --git a/docs/command_interface/src/resources/source/sample.py b/docs/command_interface/src/resources/source/sample.py
new file mode 100644
index 0000000..a41283e
--- /dev/null
+++ b/docs/command_interface/src/resources/source/sample.py
@@ -0,0 +1,29 @@
+import os import sys
+
+## Modify this path
+sys.path.append("C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\python")
+import Session
+
+# create a new session
+sess = Session.Session()
+
+# Connect to the database
+x=sess. connect ("user1","password","16.123.456.78","23400")
+
+# Execute sample queries
+
+# execute takes the query string as argument
+setSchema = "set schema TRAFODION.CI_SAMPLE"
+selectTable = "select * from employee"
+getStats = "get statistics"
+
+#Contruct a list of SQL statements to be executed
+queryList = [setSchema, selectTable, getStats] print "\n";
+
+for query in queryList:
+   print sess.execute (query)
+
+# disconnect the session
+sess.disconnect()
+del sess
+sess=None

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/pom.xml
----------------------------------------------------------------------
diff --git a/docs/spj_guide/pom.xml b/docs/spj_guide/pom.xml
new file mode 100644
index 0000000..d569367
--- /dev/null
+++ b/docs/spj_guide/pom.xml
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!-- 
+* @@@ 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 @@@
+-->
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.trafodion</groupId>
+  <artifactId>spj-guide</artifactId>
+  <version>${env.TRAFODION_VER}</version>
+  <packaging>pom</packaging>
+  <name>Trafodion SPJ Guide</name>
+  <description>This guide describes how to develop, deploy, and manage Stored Procedures in Java (SPJs) on the Trafodion database.</description>
+  <url>http://trafodion.incubator.apache.org</url>
+  <inceptionYear>2015</inceptionYear>
+
+  <parent>
+    <groupId>org.apache.trafodion</groupId>
+    <artifactId>trafodion</artifactId>
+    <version>1.3.0</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+
+
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+      <comments>A business-friendly OSS license</comments>
+    </license>
+  </licenses>
+
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org</url>
+  </organization>
+
+  <issueManagement>
+    <system>JIRA</system>
+    <url>http://issues.apache.org/jira/browse/TRAFODION</url>
+  </issueManagement>
+
+  <scm>
+    <connection>scm:git:http://git-wip-us.apache.org/repos/asf/incubator-trafodion.git</connection>
+    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-trafodion.git</developerConnection>
+    <url>https://git-wip-us.apache.org/repos/asf?p=incubator-trafodion.git</url>
+    <tag>HEAD</tag>
+  </scm>
+
+  <ciManagement>
+    <system>Jenkins</system>
+    <url>https://jenkins.esgyn.com</url>
+  </ciManagement>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <asciidoctor.maven.plugin.version>1.5.2.1</asciidoctor.maven.plugin.version>
+    <asciidoctorj.pdf.version>1.5.0-alpha.11</asciidoctorj.pdf.version>
+    <asciidoctorj.version>1.5.4</asciidoctorj.version>
+    <rubygems.prawn.version>2.0.2</rubygems.prawn.version>
+    <jruby.version>9.0.4.0</jruby.version>
+  </properties>
+
+  <repositories>
+    <repository>
+      <id>rubygems-proxy-releases</id>
+      <name>RubyGems.org Proxy (Releases)</name>
+      <url>http://rubygems-proxy.torquebox.org/releases</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  
+  <dependencies>
+    <dependency>
+      <groupId>rubygems</groupId>
+      <artifactId>prawn</artifactId>
+      <version>${rubygems.prawn.version}</version>
+      <type>gem</type>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jruby</groupId>
+      <artifactId>jruby-complete</artifactId>
+      <version>${jruby.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.asciidoctor</groupId>
+      <artifactId>asciidoctorj</artifactId>
+      <version>${asciidoctorj.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>de.saumya.mojo</groupId>
+        <artifactId>gem-maven-plugin</artifactId>
+        <version>1.0.10</version>
+        <configuration>
+          <!-- align JRuby version with AsciidoctorJ to avoid redundant downloading -->
+          <jrubyVersion>${jruby.version}</jrubyVersion>
+          <gemHome>${project.build.directory}/gems</gemHome>
+          <gemPath>${project.build.directory}/gems</gemPath>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>initialize</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.7</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+          <attributes>
+            <generateReports>false</generateReports>
+          </attributes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.asciidoctor</groupId>
+        <artifactId>asciidoctor-maven-plugin</artifactId>
+        <version>${asciidoctor.maven.plugin.version}</version> 
+        <dependencies>
+          <dependency>
+            <groupId>org.asciidoctor</groupId>
+            <artifactId>asciidoctorj-pdf</artifactId>
+            <version>${asciidoctorj.pdf.version}</version>
+          </dependency>
+          <dependency>
+            <groupId>org.asciidoctor</groupId>
+            <artifactId>asciidoctorj</artifactId>
+            <version>${asciidoctorj.version}</version>
+          </dependency>
+        </dependencies>
+        <configuration>
+          <sourceDirectory>${basedir}/src</sourceDirectory>
+        </configuration>
+        <executions>
+          <execution>
+            <id>generate-html-doc</id> 
+            <goals>
+              <goal>process-asciidoc</goal> 
+            </goals>
+            <phase>site</phase>
+            <configuration>
+              <doctype>book</doctype>
+              <backend>html5</backend>
+              <sourceHighlighter>coderay</sourceHighlighter>
+              <outputDirectory>${basedir}/target/site</outputDirectory>
+              <requires>
+                <require>${basedir}/../shared/google-analytics-postprocessor.rb</require>
+              </requires>
+              <attributes>
+                <!-- Location of centralized stylesheet -->
+                <stylesheet>${basedir}/../shared/trafodion-manuals.css</stylesheet>
+                <project-version>${env.TRAFODION_VER}</project-version>
+                <build-date>${maven.build.timestamp}</build-date>
+                <google-analytics-account>UA-72491210-1</google-analytics-account>
+              </attributes>
+            </configuration>
+          </execution>
+          <execution>
+            <id>generate-pdf-doc</id>
+            <phase>site</phase>
+            <goals>
+              <goal>process-asciidoc</goal>
+            </goals>
+            <configuration>
+              <doctype>book</doctype>
+              <backend>pdf</backend>
+              <sourceHighlighter>coderay</sourceHighlighter>
+              <outputDirectory>${basedir}/target</outputDirectory>
+              <attributes>
+                <pdf-stylesdir>${basedir}/../shared</pdf-stylesdir>
+                <pdf-style>trafodion</pdf-style>
+                <icons>font</icons>
+                <pagenums/>
+                <toc/>
+                <idprefix/>
+                <idseparator>-</idseparator>
+                <project-version>${env.TRAFODION_VER}</project-version>
+                <build-date>${maven.build.timestamp}</build-date>
+              </attributes>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin> 
+      <!-- Rename target/site/index.pdf to client-install-guide.pdf -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.8</version>
+        <inherited>false</inherited>
+        <executions>
+          <execution>
+            <id>populate-release-directories</id>
+            <phase>post-site</phase>
+            <configuration>
+              <target name="Populate Release Directories">
+                <!-- The website uses the following organization for the docs/target/docs directory:
+                  - To ensure a known location, the base directory contains the LATEST version of the web book and the PDF files.
+                  - The know location is docs/target/docs/<document>
+                  - target/docs/<version>/<document> contains version-specific renderings of the documents.
+                  - target/docs/<version>/<document> contains the PDF version and the web book. The web book is named index.html
+                --> 
+                <!-- Copy the PDF file to its target directories -->
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/spj_guide/Trafodion_SPJ_Guide.pdf" />
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/${project.version}/spj_guide/Trafodion_SPJ_Guide.pdf" />
+                <!-- Copy the Web Book files to their target directories -->
+                <copy todir="${basedir}/../target/docs/spj_guide">
+                  <fileset dir="${basedir}/target/site">
+                    <include name="**/*.*"/>  <!--All sub-directories, too-->
+                  </fileset>
+                </copy>
+                <copy todir="${basedir}/../target/docs/${project.version}/spj_guide">
+                  <fileset dir="${basedir}/target/site">
+                    <include name="**/*.*"/>  <!--All sub-directories, too-->
+                  </fileset>
+                </copy>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <!-- Included because this is required. No reports are generated. -->
+  <reporting>
+    <excludeDefaults>true</excludeDefaults>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.8</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <distributionManagement>
+    <site>
+      <id>trafodion.incubator.apache.org</id>
+      <name>Trafodion Website at incubator.apache.org</name>
+      <!-- On why this is the tmp dir and not trafodion.incubator.apache.org, see
+      https://issues.apache.org/jira/browse/HBASE-7593?focusedCommentId=13555866&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13555866
+      -->
+      <url>file:///tmp</url>
+    </site>
+  </distributionManagement>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/about.adoc b/docs/spj_guide/src/asciidoc/_chapters/about.adoc
new file mode 100644
index 0000000..c4b69cd
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/about.adoc
@@ -0,0 +1,200 @@
+////
+/**
+* @@@ 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 @@@
+  */
+////
+
+= About This Document
+This guide describes how to develop, deploy, and manage Stored Procedures in Java (SPJs) on the Trafodion database.
+
+== Intended Audience
+This manual is intended for application programmers who are writing and compiling Java code for stored procedures
+and for database administrators who are deploying and managing Stored Procedures in Java (SPJs) on the Trafodion
+database. The reader should know:
+
+* The Java programming language.
+* JDBC and the Trafodion JDBC Type-4 Driver.
+* Structured Query Language (SQL) and database terms and concepts.
+
+Although not required, it helps to be familiar with the part of the ANSI SQL/Foundation standard called
+SQL/JRT (Java Routines and Types) on which this implementation of stored procedures is based.
+
+== Document Organization
+
+This document is organized as follows:
+
+[cols="30%,70%", options="header"]
+|===
+| Chapter                                              | Description
+| *<<introduction, Introduction>>*                     | Defines what an SPJ is, describes the benefits of using SPJs on the database,
+and lists steps for developing and deploying SPJs on Trafodion.
+| *<<get-started, Get Started>>*                       | Describes the software requirements for using SPJs on the Trafodion database.
+| *<<develop-spj-methods, Develop SPJ Methods>>*       | Provides guidelines for writing and compiling a Java method to be used as the
+body of a stored procedure.
+| *<<xeploy-spj-jar-files, Deploy SPJ JAR Files>>*     | Explains how to deploy SPJ JAR files on the Trafodion database.
+| *<<create-spjs, Create SPJs>>*                       | Explains how to create, drop, and alter an SPJ on the Trafodion database.            
+| *<<grant-privileges, Grant Privileges>>*             | Explains how to grant and revoke privileges for executing SPJs on the
+Trafodion database.
+| *<<execute-spjs, Execute SPJs>>*                     | Explains how to execute an SPJ on the Trafodion database by using the CALL statement.
+| *<<performance-and-troubleshooting, Performance and Troubleshooting>>* | 
+Describes how to improve and monitor the performance of SPJs and provides guidelines for troubleshooting common problems.
+| *<<sample-spjs, Appendix A: Sample SPJs>>*           | Provides examples of SPJ methods that demonstrate business logic on the Trafodion database.
+| *<<sample-database, Appendix B: Sample Database>>*   | Describes the sample database on which the Sample SPJs operate.
+|===
+
+== New and Changed Information
+This is a new manual.
+
+== Notation Conventions
+This list summarizes the notation conventions for syntax presentation in this manual.
+
+* UPPERCASE LETTERS
++
+Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required. 
++
+```
+SELECT
+```
+
+* lowercase letters
++
+Lowercase letters, regardless of font, indicate variable items that you supply. Items not enclosed in brackets are required.
++
+```
+file-name
+```
+
+* &#91; &#93; Brackets 
++
+Brackets enclose optional syntax items.
++
+```
+DATETIME [start-field TO] end-field
+```
++
+A group of items enclosed in brackets is a list from which you can choose one item or none.
++
+The items in the list can be arranged either vertically, with aligned brackets on each side of the list, or horizontally, enclosed in a pair of brackets and separated by vertical lines.
++
+For example: 
++
+```
+DROP SCHEMA schema [CASCADE]
+DROP SCHEMA schema [ CASCADE | RESTRICT ]
+```
+
+* { } Braces 
++
+Braces enclose required syntax items.
++
+```
+FROM { grantee [, grantee ] ... }
+```
++ 
+A group of items enclosed in braces is a list from which you are required to choose one item.
++
+The items in the list can be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines.
++
+For example:
++
+```
+INTERVAL { start-field TO end-field }
+{ single-field } 
+INTERVAL { start-field TO end-field | single-field }
+``` 
+* | Vertical Line 
++
+A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces.
+```
+{expression | NULL} 
+```
+
+* &#8230; Ellipsis
++
+An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times.
++
+```
+ATTRIBUTE[S] attribute [, attribute] ...
+{, sql-expression } ...
+```
++ 
+An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times.
++
+For example:
++
+```
+expression-n ...
+```
+
+<<<
+* Punctuation
++
+Parentheses, commas, semicolons, and other symbols not previously described must be typed as shown.
++
+```
+DAY (datetime-expression)
+@script-file 
+```
++
+Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must type as shown.
++
+For example:
++
+```
+"{" module-name [, module-name] ... "}"
+```
+
+* Item Spacing
++
+Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma.
++
+```
+DAY (datetime-expression) DAY(datetime-expression)
+```
++
+If there is no space between two items, spaces are not permitted. In this example, no spaces are permitted between the period and any other items:
++
+```
+myfile.sh
+```
+
+* Line Spacing
++
+If the syntax of a command is too long to fit on a single line, each continuation line is indented three spaces and is separated from the preceding line by a blank line.
++
+This spacing distinguishes items in a continuation line from items in a vertical list of selections. 
++
+```
+match-value [NOT] LIKE _pattern
+   [ESCAPE esc-char-expression] 
+```
+
+<<<
+== Comments Encouraged
+The Trafodion community encourages your comments concerning this document. We are committed to providing documentation that meets your
+needs. Send any errors found, suggestions for improvement, or compliments to:
+
+issues@trafodion.incubator.apache.org
+
+Include the document title and any comment, error found, or suggestion for improvement you have concerning this document.
+Or, even better, join our community and help us improve our documentation. Please refer to 
+http://trafodion.incubator.apache.org/contributing_redirect.html[Trafodion Contributor Guide] for details.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
new file mode 100644
index 0000000..11c2bc1
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
@@ -0,0 +1,508 @@
+////
+/**
+ *@@@ 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-spjs]]
+= Create SPJs
+
+After creating libraries for the SPJ JAR files on the Trafodion platform,
+you can create the procedures in the Trafodion database. To create or
+drop a procedure from the Trafodion database, use the HP Database Manager
+(HPDM).
+
+Follow these procedures:
+
+* link:#_bookmark116["Create a Procedure" (page 37)]
+* link:#_bookmark128["Drop a Procedure" (page 42)]
+* link:#bookmark130["Display Procedures and Their Properties" (page 42)]
+This chapter also covers:
+* link:#_bookmark114["Required Privileges for Creating or Dropping an
+SPJ" (page 37)]
+* link:#_bookmark136["Altering an SPJ and Its Java Bytecode" (page 44)]
+
+== Required Privileges for Creating or Dropping an SPJ
+
+To create an SPJ in a schema, you must be the schema owner, or you must
+have the CREATE_PROCEDURE privilege for that schema, and you must have
+the CREATE_PROCEDURE privilege for the SQL_OPERATIONS component. You
+must also have the USAGE privilege for the library that will be used in
+the creation of the stored procedure. For more information, see the
+requirements in link:#_bookmark116["Create a Procedure" (page 37)].
+
+To drop an SPJ from a schema, you must be the schema owner, or you must
+have the DROP_PROCEDURE privilege for that schema. For more information,
+see the requirements in link:#_bookmark128["Drop] link:#_bookmark128[a
+Procedure" (page 42)].
+
+To display the current ownership and privileges, see
+link:#bookmark130["Display Procedures and Their Properties"]
+link:#bookmark130[(page 42)].
+
+== Create a Procedure
+
+The Create Procedure tool registers an existing Java method as a stored
+procedure in Java (SPJ) within SQL.
+
+NOTE: HPDM creates procedures with default privileges only. For more
+information about privileges for SPJs, see the Grant/Revoke Privileges
+Tool in HPDM or the GRANT PROCEDURE statement in the __Trafodion SQL
+Reference Manual__.
+
+Requirements:
+
+* You must have the CREATE_PROCEDURE privilege for the SQL_OPERATIONS
+component. For more information, see the component privileges in the _HP
+Database Manager (HPDM) User Guide_ or the online help in HPDM.
+* You must have been granted the USAGE privilege for the library that
+will be used in the creation of the stored procedure. This privilege
+provides you with read access to the library's underlying JAR file,
+which contains the SPJ Java method. For more information, see the
+Grant/Revoke Privileges Tool in HPDM or the GRANT LIBRARY statement in
+the __Trafodion SQL Reference Manual__.
+* You must either be the owner of the schema or have the
+CREATE_PROCEDURE privilege for the schema to create the procedure. The
+schema owner can grant such a schema-level privilege to other users or
+roles. For more information, see the Grant/Revoke Privileges Tool in
+HPDM or the GRANT SCHEMA statement in the _Trafodion SQL Reference
+Manual_
+
+To create a procedure:
+
+1.  In HPDM, select the Database area.
+2.  Expand the navigation tree pane so that you can see the name of the
+schema in which you want to create the procedure and the Procedures
+folder under the schema.
+3.  Right-click the Procedures folder, and select Create Procedure. The
+Create Procedure dialog box appears.
+4.  In the Procedure Name field, enter a name for the stored procedure.
+For detailed information about the Procedure Name field, see
+link:#_bookmark120["Use the Create Procedure Dialog Box" (page 39)].
+5.  In the Code group box, click [ Browse ] to find a Java method.
+
+The [ Browse ] button opens Library Browser. Use the browser to select a
+method from a JAR file within a library. See link:#_bookmark109["Use the
+Library Browser" (page 35)]. If a library containing the JAR file does
+not exist on the Trafodion platform, you can create one by clicking the [
+Create ] button in the Library Browser. See link:#_bookmark98["Use the
+Create Library Dialog Box" (page 31)].
+
+1.  In the Parameters group box, verify that the SQL parameters are
+mapped correctly to the Java parameters of the SPJ method.
+
+NOTE: The result set parameters (java.sql.ResultSet[]) in the Java
+signature do not have corresponding SQL parameters.
+
+a.  To change an SQL parameter, such as the name of the parameter, the
+SQL data type,
+or the parameter mode or direction (IN, INOUT, or OUT), select the
+parameter and click
+
+[ Edit ]. The Edit Parameter dialog box appears.
+
+a.  In the Edit Parameter dialog box, enter a new name for the
+parameter, select a different SQL data type, if permitted, or select a
+different parameter mode (direction), if permitted.
+
+When changing the parameter name, note that the parameter name:
+
+* Is not case-sensitive
+* Must not be a reserved word
+* Must not contain spaces
+* Must begin with a letter, digit, or underscore
+
+When changing the SQL data type, select a data type that is appropriate
+for the parameter of the underlying Java method. For information about
+SQL data types, see the __Trafodion SQL Reference Manual__.
+
+For character string parameters, select either ISO88591 or UCS2
+depending on the column definition in the database. For guidelines, see
+the __Trafodion Character Sets Guide__.
+
+a.  Click [ OK ] to accept the changes, or click [ Cancel ] to quit the
+Edit Parameter dialog box.
+b.  Repeat steps a to c for each parameter that you want to change.
+
+1.  In the Attributes group box, if your SPJ method returns result sets,
+enter the maximum number of result sets to be returned for Number of
+dynamic result sets. The valid range is 1 to 255 inclusive. The actual
+number of result sets returned by the SPJ method can be less than or
+equal to this number.
+
+NOTE: The Number of dynamic result sets control is enabled only if the
+method signature contains a java.sql.ResultSet[] object.
+
+1.  If your SPJ method performs any SQL operations, select the Accesses
+Database option.
+
+NOTE: If you do not select the Accesses Database option and your SPJ
+method performs SQL operations, SQL returns an error when trying to
+execute the procedure.
+
+1.  Select either Invoker or Definer for the external security of the
+stored procedure.
+
+* The Invoker setting determines that users can execute, or invoke, the
+stored procedure using the privileges of the user who invokes the stored
+procedure. This behavior is referred to as __invoker rights__.
+* The Definer setting determines that users can execute, or invoke, the
+stored procedure using the privileges of the user who created the stored
+procedure. This behavior is referred to as __definer rights__. The
+advantage of definer rights is that users are allowed to manipulate data
+by invoking the stored procedure without having to be granted privileges
+to the underlying database objects.
+
+For more information, see link:#_bookmark124["Understand External
+Security" (page 41)].
+
+1.  For the Transaction Required attribute, select either Yes to require
+the procedure to run in a transaction inherited from the calling
+application (the default behavior) or No to allow the procedure to run
+without an inherited transaction. For more information, see
+link:#_bookmark157["Transaction] link:#_bookmark157[Behavior" (page
+49)].
+2.  Click [ Create ] to create the procedure.
+
+Related Topics
+
+link:#_bookmark120["Use the Create Procedure Dialog Box" (page 39)]
+
+== Use the Create Procedure Dialog Box
+
+This table shows reference information for the Create Procedure dialog
+box:
+
+[cols=",,",options="header",]
+|===
+Group Box
+Control or Field
+Action
+Name
+____
+
+Catalog
+Name of the catalog where the procedure will be created. This is a
+read-only field.
+Schema
+Name of the schema where the procedure will be created. This is a
+read-only field.
+Procedure Name
+Enter a name for the procedure. The name must be unique and must not
+exist for any procedure, table, or view in the same schema. The
+procedure name is not case-sensitive. The database engine automatically
+qualifies the procedure name with the name of the catalog and schema in
+which you are creating the procedure. For example, if you enter
+*monthlyorders* as the procedure name, the database engine stores the
+procedure as
+
+__catalog-name__.__schema-name__.MONTHLYORDERS.
+Code
+Library
+Click [ Browse ] to navigate to a library or JAR file.
+Class Name
+Select a class.
+Method Name
+When you select a class, the method names and parameter types for that
+class appear in the right pane.
+NOTE: Only methods that can be used in a procedure are visible. For
+details, see link:#_bookmark123["Use a Method in a Procedure" (page
+40)].
+Parameters
+Name
+____
+
+Is the name for this SQL parameter.
+Direction
+IN passes data to a procedure
+INOUT passes data to and accepts data from a procedure. The parameter
+|===
+
+must be an array.
+
+
+* OUT accepts data from a procedure. The parameter must be an array.
+
+SQL Data Type
+
+Displays the SQL data type that is the best match for the Java signature
+in the
+
+Java Data Type column.
+
+Java Data Type Displays the signature for the Java method that you
+selected.
+
+[ Edit ] Click to edit the selected parameter.
+
+Group Box
+
+Control or Field
+
+Action
+
+Attributes
+
+Number of dynamic result sets
+
+Accesses Database
+
+Controls the maximum number of result sets the procedure can return.
+This control is enabled only if the method signature contains a
+java.sql.ResultSet[] object. If the method contains a result set object,
+the valid range is 1 to 255. This value is automatically set to zero if
+the selected Java method does not have a java.sql.ResultSet[] object.
+
+If selected, the procedure performs SQL operations. If cleared, the
+procedure does not perform SQL operations.
+
+NOTE: SQL returns an error when trying to execute the procedure if this
+attribute is cleared and the procedure performs SQL operations.
+
+External Security
+
+Transaction Required
+
+Select either Invoker or Definer for the external security of the stored
+procedure.
+
+* The Invoker setting determines that users can execute, or invoke, the
+stored procedure using the privileges of the user who invokes the stored
+procedure. This behavior is referred to as __invoker rights__.
+* The Definer setting determines that users can execute, or invoke, the
+stored procedure using the privileges of the user who created the stored
+procedure. This behavior is referred to as __definer rights__. The
+advantage of definer rights is that users are allowed to manipulate data
+by invoking the stored procedure without having to be granted privileges
+to the underlying database objects.
+
+For more information, see link:#_bookmark124["Understand External
+Security" (page 41)].
+
+Select either Yes to require the procedure to run in a transaction
+inherited from the calling application (the default behavior) or No to
+allow the procedure to run without an inherited transaction. For more
+information, see link:#_bookmark157["Transaction]
+link:#_bookmark157[Behavior" (page 49)].
+
+Related Topics
+
+link:#_bookmark116["Create a Procedure" (page 37)]
+
+== Use a Method in a Procedure
+
+To be used in a procedure, a Java method must:
+
+* Be qualified as public static void.
+* Have a java.sql.ResultSet[] parameter at the end of the method
+signature if the method uses result sets.
+
+NOTE: There can be more than one java.sql.ResultSet[] parameter, but
+they must all be at the end of the method signature.
+
+* Have these parameter types:
+
+Parameter Type or Class
+
+Type
+
+character java.lang.String
+
+java.lang.String[]
+
+numeric java.lang.Integer
+
+java.lang.Integer[] java.lang.Long java.lang.Long[] java.lang.Float
+java.lang.Float[]
+
+Parameter Type or Class
+
+Type
+
+java.lang.Double java.lang.Double[] java.math.BigDecimal
+java.math.BigDecimal[]
+
+date/timestamp java.sql.Date
+
+java.sql.Date[] java.sql.Time java.sql.Time[] java.sql.Timestamp
+java.sql.Timestamp[]
+
+primitive short
+
+short[] int int[] long long[] float float[] double double[]
+
+result sets java.sql.ResultSet[]
+
+== Understand External Security
+
+The external security of an SPJ determines the privileges, or rights,
+that users have when executing (or calling) the SPJ. An SPJ can be
+created with one of these types of external security: invoker or
+definer.
+
+If an SPJ is created with the invoker type of external security, the SPJ
+is executed with __invoker rights__. Invoker rights allow a user who has
+the execute privilege on the SPJ to call the SPJ using his or her
+existing privileges. In this case, the user must be granted privileges
+to access the underlying database objects on which the SPJ operates. If
+a user tries to call an SPJ that has invoker external security and that
+operates on database objects to which the user does not have privileges,
+the CALL statement fails with an error message indicating that the user
+does not have the appropriate permissions. Note: Granting a user
+privileges to the underlying database objects gives the user direct
+access to those database objects, which could pose a risk to more
+sensitive or critical data to which users should not have access. For
+example, an SPJ might operate on a subset of the data in an underlying
+database object, but that database object might contain other more
+sensitive or critical data to which users should not have access.
+
+If an SPJ is created with the definer type of external security, the SPJ
+is executed with __definer rights__. Definer rights allow a user who has
+the execute privilege on an SPJ to call the SPJ using the privileges of
+the user who created the SPJ. In this case, the user does not require
+privileges to access the underlying database objects on which the SPJ
+operates. Instead, the user is allowed to access or manipulate data in
+the underlying database objects by invoking the SPJ. That way, users are
+restricted from directly accessing or manipulating more sensitive or
+critical data in the database. However, be careful about the users to
+whom you grant execute privilege on an SPJ with definer external
+security because those users will be able to execute the SPJ without
+requiring privileges to the underlying database objects.
+
+To set the external security of an SPJ, see link:#_bookmark116["Create a
+Procedure" (page 37)].
+
+== Drop a Procedure
+
+To drop a procedure, you must own the procedure or have the
+DROP_PROCEDURE privilege for the schema. The schema owner can grant such
+a schema-level privilege to other users or roles. For example, if the
+schema owner granted you privileges to drop all objects in the schema,
+you could drop procedures. For more information, see the Grant/Revoke
+Privileges Tool in HPDM or the GRANT SCHEMA statement in the __Trafodion
+SQL Reference Manual__.
+
+To drop a procedure:
+
+1.  Under the navigation tree pane, click the Database area.
+2.  Under My Systems, expand the tree for the Trafodion platform
+containing the procedure until you can see the schema folder and the
+Procedures folder underneath it.
+3.  Expand the Procedures folder.
+4.  Right-click the name of the procedure that you want to drop, and
+select Drop Procedure. HPDM asks you to confirm the operation.
+5.  Click [ Yes ] to continue or [ No ] to quit the operation.
+
+== Display Procedures and Their Properties
+
+To display the SPJs in a schema, use either HPDM or trafci:
+
+* link:#_bookmark131["Using HPDM to Display a Procedure in a Schema"
+(page 42)]
+* link:#_bookmark133["Using trafci to Display Procedures in a Schema"
+(page 43)]
+
+=== Using HPDM to Display a Procedure in a Schema
+
+To display one of the procedures in a schema:
+
+1.  Start the HP Database Manager and log on using any user name.
+2.  Click the Database area.
+3.  In the navigation tree pane, select a Schema, and expand the schema
+so that you can see the object folders underneath it.
+4.  Expand the Procedures tab in the right pane and select a procedure
+name, or open the Procedures folder and select a procedure name in the
+tree. HPDM displays the properties of the selected procedure in the
+right pane.
+
+image:media/image7.jpeg[image]
+
+For more information about the procedure properties displayed in HPDM,
+see the _HP Database_ __Manager (HPDM) User Guide__ or the online help
+in HPDM.
+
+==== Using trafci to Display Procedures in a Schema
+
+In the trafci command-line interface, use the SHOW PROCEDURES command to
+display the procedures in a schema. For example, this SHOW PROCEDURES
+command displays a list of the procedures in the SALES schema:
+
+```
+SQL>**set schema demo.sales;**
+
+--- SQL operation complete. SQL>**show procedures** PROCEDURE NAMES
+
+--------------------------------------------------------------------------------
+DAILYORDERS LOWERPRICE MONTHLYORDERS ORDERSUMMARY PARTDATA TOTAL PRICE
+
+SQL>
+```
+
+You can also use a wild-card pattern to search for a particular
+procedure. For example, this SHOW PROCEDURES command displays all the
+procedures in the SALES schema that have price in their names:
+
+```
+SQL>**show procedures %price**
+
+PROCEDURE NAMES
+
+--------------------------------------------------------------------------------
+LOWERPRICE TOTALPRICE
+
+SQL>
+```
+
+For more information about trafci, see the __HP Database Command
+Interface (trafci) Guide__.
+
+==== Altering an SPJ and Its Java Bytecode
+
+Occasionally, you might need to update an SPJ or its Java bytecode. The
+Java bytecode includes the SPJ's class file and any associated class
+files that are packaged in the SPJ JAR file. Suppose that you want to
+update the Java bytecode of an SPJ without changing the class name,
+method name, or Java signature of the SPJ method. In this case, you
+would alter the library by selecting the updated JAR file to upload to
+the Trafodion platform, replacing the previous JAR file for the library.
+For more information, see link:#_bookmark100["Alter a Library" (page
+32)].
+
+NOTE: You are prevented from uploading a JAR file that is already in use
+by another library in the catalog. This restriction prevents you from
+accidentally overwriting a JAR file that has the same name.
+
+If you plan to use a JAR file that contains an SPJ method that has a
+different class name, method name, or signature than the original SPJ
+method, you must drop the SPJ from the database before altering the
+library. After altering the library, re-create the SPJ in the database.
+You must also drop and re-create an SPJ to rename the procedure or
+change the SQL parameter definitions even if the Java bytecode remains
+the same. For more information, see link:#_bookmark116["Create a
+Procedure" (page 37)] and link:#_bookmark128["Drop a Procedure" (page
+42)].
+
+When you update an SPJ or its Java bytecode, try to avoid making those
+changes when client applications are actively calling the SPJ. If you
+update an SPJ or its Java bytecode when a client application is calling
+the SPJ, the CALL statement might return wrong or inconsistent data to
+the calling application. Therefore, schedule a time to update the SPJ or
+its Java bytecode when client applications are not actively calling the
+SPJ.
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
new file mode 100644
index 0000000..67fed93
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
@@ -0,0 +1,557 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[Deploy-spj-jar-files]]
+= Deploy SPJ JAR Files
+
+After developing and packaging the SPJ code into JAR files, you must
+move the JAR files from the client workstation to the Trafodion database.
+
+You can upload a SPJ JAR file and create a library by using
+the ADD LIBRARY command in the Trafodion Command Interface (trafci).
+You use the CREATE LIBRARY, ALTER LIBRARY, and DROP LIBRARY commands.
+
+Libraries provide greater security for JAR files because libraries are
+database objects whose access is controlled using standard SQL security.
+
+Deploying a JAR file to a Trafodion instance requires creating a library,
+and users must have the required privileges for creating libraries in order
+to deploy JAR files.
+
+See these instructions:
+
+* <<create-a-library, Create a Library>>
+* <alter-a-library, Alter a Library>>
+* <<drop-a-library, Drop a Library>>
+* <<download-a-jar-file-from-a-library, Download a JAR File From a Library>>
+* <<display-libraries-and-their-properties, Display Libraries and Their Properties>>
+
+Before you start, see
+<<required-privileges-for-creating-altering-or-dropping-a-library, "Required Privileges for Creating, Altering, or Dropping a Library">>.
+
+
+== Required Privileges for Creating, Altering, or Dropping a Library
+
+Deploying a JAR file to the Trafodion database requires creating a
+library, and you must have the required privileges for creating
+libraries in order to deploy a JAR file. To create a library in a
+schema, you must have both the CREATE_LIBRARY component privilege and
+the CREATE_LIBRARY schema-level privilege for the schema. For more
+information, see the requirements in <create-a-library, Create a Library>>.
+
+To alter a library in a schema, you must have both the UPDATE privilege
+for the library and the ALTER_LIBRARY privilege for the schema. For more
+information, see the requirements in
+<<alter-a-library, Alter a Library>>.
+
+To drop a library from a schema, you must have the DROP_LIBRARY
+privilege for the schema. For more information, see the requirements in
+<<drop-a-library, Drop a Library>>.
+
+To download a JAR file from a library, you must have the CREATE_LIBRARY
+component privilege. For more information, see the requirements in
+<<download-a-jar-file-from-a-library, Download a JAR File From a Library>>.
+
+[[create-a-library]]
+== Create a Library
+
+Refer to the
+http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+for full documentation of the
+http://trafodion.apache.org/docs/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
+statement.
+
+When you create a library, HPDM simultaneously uploads an SPJ JAR file
+from the client workstation to the Trafodion database and creates a
+library for the JAR file in a schema of the database.
+
+Requirements:
+
+* You must have the CREATE_LIBRARY privilege for the SQL_OPERATIONS
+component. For more information, see the component privileges in the _HP
+Database Manager (HPDM) User Guide_ or the online help in HPDM.
+* You must either be the owner of the schema where you will create the
+library or have the CREATE_LIBRARY privilege for the schema to create
+the library. The schema owner can grant such a schema-level privilege to
+other users or roles. For more information, see the
+
+Grant/Revoke Privileges Tool in HPDM or the GRANT SCHEMA statement in
+the __Trafodion SQL Reference Manual__.
+
+* The JAR file that you select for the library must contain valid Java
+bytecode and must not be used by another library in the catalog.
+* The JAR file that you select for the library must not exceed a size
+threshold if one has been set for HPDM's internal WMS service, the data
+source, or the system defaults.
+
+For example, if the CONTROL QUERY DEFAULT (CQD),
+POS_ABSOLUTE_MAX_TABLE_SIZE,
+
+has been set for the HPS_MANAGEABILITY service, it will limit the size
+of JAR files that can be uploaded by HPDM. If the JAR file's size
+exceeds the threshold, a warning message is displayed, and the file is
+not uploaded. By default, this CQD is not set for HPDM's internal WMS
+service, the data source, or the system defaults, and HPDM allows you to
+upload JAR files of any size.
+
+To upload a JAR file and create a library for the JAR file in a schema:
+
+1.  In HPDM, select the Database area.
+2.  In the navigation tree pane, expand the tree to display the folders
+of the schema where you want to create the library.
+3.  Right-click the Libraries folder, and select Create Library. The
+Create Library dialog box appears. For more information, see
+link:#_bookmark98["Use the Create Library Dialog Box" (page 31)].
+4.  In the Create Library dialog box, enter a name for the library.
+
+The name must be unique among the libraries in the schema and must not
+exceed 128 characters. The library name is not case-sensitive. For
+example, if you enter Payroll as the library name, the database engine
+stores the library as
+
+__catalog-name__.__schema-name__.PAYROLL. The database engine
+automatically qualifies the library name with the name of the catalog
+and schema in which you are creating the library.
+
+1.  Click the [ Browse ] button to locate and select a JAR file on the
+client workstation. The "Select a code file" dialog box appears.
+2.  In the "Select a code file" dialog box, locate and select the JAR
+file on the client workstation, and click [ Open ] to return to the
+Create Library dialog box. The Create Library dialog box displays the
+full path of the JAR file in the Code File field.
+3.  Click [ Create ] to create the library, or click [ Close ] to quit
+the dialog box without creating the library.
+
+If you click [ Create ], HPDM validates the JAR file, uploads the JAR
+file, and creates a library for the JAR file in the schema.
+
+1.  When notified that the library was created successfully, click [ OK
+].
+2.  To upload another JAR file and create a library, repeat steps 4
+through 8.
+3.  When you are done uploading JAR files and creating libraries, click
+the [ Close ] button image:media/image4.png[image]) to quit the Create
+Library dialog box and return to the HPDM main window.
+
+Related Topics
+
+link:#_bookmark98["Use the Create Library Dialog Box" (page 31)]
+link:#_bookmark100["Alter a Library" (page 32)]
+
+link:#_bookmark105["Drop a Library" (page 33)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+link:#_bookmark110["Display Libraries and Their Properties" (page 36)]
+
+[[use-the-create-library-dialog-box]]
+== Use the Create Library Dialog Box
+
+The Create Library dialog box allows you to upload an SPJ JAR file from
+the client workstation to the Trafodion database and create a library for
+the JAR file in a schema of the database.
+
+Requirements:
+
+* You must have the CREATE_LIBRARY privilege for the SQL_OPERATIONS
+component. For more information, see the component privileges in the _HP
+Database Manager (HPDM) User Guide_ or the online help in HPDM.
+* You must either be the owner of the schema where you will create the
+library or have the CREATE_LIBRARY privilege for the schema to create
+the library. The schema owner can grant such a schema-level privilege to
+other users or roles. For more information, see the Grant/Revoke
+Privileges Tool in HPDM or the GRANT SCHEMA statement in the __Trafodion
+SQL Reference Manual__.
+* The JAR file that you select for the library must contain valid Java
+bytecode and must not be used by another library in the catalog.
+* The JAR file that you select for the library must not exceed a size
+threshold if one has been set for HPDM's internal WMS service, the data
+source, or the system defaults.
+
+For example, if the CONTROL QUERY DEFAULT (CQD),
+POS_ABSOLUTE_MAX_TABLE_SIZE,
+
+has been set for the HPS_MANAGEABILITY service, it will limit the size
+of JAR files that can be uploaded by HPDM. If the JAR file's size
+exceeds the threshold, a warning message is displayed, and the file is
+not uploaded. By default, this CQD is not set for HPDM's internal WMS
+service, the data source, or the system defaults, and HPDM allows you to
+upload JAR files of any size.
+
+[cols=",,",options="header",]
+|===
+[[group-box]]
+Group Box
+Control or Field
+Description or Action
+Library
+Catalog
+Name of the catalog where the library will be created. This is a
+read-only field.
+Schema
+Name of the schema where the library will be created. This is a
+read-only field.
+Library Name
+Enter a name for the library. The name must be unique among the
+libraries in the schema and must not exceed 128 characters. The library
+name is not case-sensitive. For example, if you enter Payroll as the
+library name, the database engine stores the library as
+
+__catalog-name__.__schema-name__.PAYROLL. The database engine
+automatically qualifies the library name with the name of the catalog
+and schema in which you are creating the library.
+Code File
+Code File
+Click [ Browse ] to launch the "Select a code file" dialog box and
+navigate to a JAR file on the client workstation.
+[ Create ]
+Creates the library.
+[ Close ]
+Closes the dialog box without creating a library.
+[ Help ]
+Displays context-sensitive help for this dialog box.
+|===
+
+[[related-topics]]
+Related Topics
+
+link:#_bookmark95["Create a Library" (page 29)]
+link:#_bookmark100["Alter a Library" (page 32)] link:#_bookmark105["Drop
+a Library" (page 33)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+
+[[alter-a-library]]
+== Alter a Library
+
+When you alter a library, you can change the underlying JAR file of the
+library.
+
+Requirements:
+
+* You must have been granted the UPDATE privilege for the library. For
+more information, see the Grant/Revoke Privileges Tool in HPDM or the
+GRANT LIBRARY statement in the __Trafodion SQL Reference Manual__.
+* You must either be the owner of the schema where you will alter the
+library or have the ALTER_LIBRARY privilege for the schema to alter the
+library. The schema owner can grant such a schema-level privilege to
+other users or roles. For more information, see the Grant/Revoke
+Privileges Tool in HPDM or the GRANT SCHEMA statement in the __Trafodion
+SQL Reference Manual__.
+* The JAR file that you select for the library must contain valid Java
+bytecode and must not be used by another library in the catalog.
+* The JAR file that you select for the library must not exceed a size
+threshold if one has been set for HPDM's internal WMS service, the data
+source, or the system defaults.
+
+For example, if the CONTROL QUERY DEFAULT (CQD),
+POS_ABSOLUTE_MAX_TABLE_SIZE,
+
+has been set for the HPS_MANAGEABILITY service, it will limit the size
+of JAR files that can be uploaded by HPDM. If the JAR file's size
+exceeds the threshold, a warning message is displayed, and the file is
+not uploaded. By default, this CQD is not set for HPDM's internal WMS
+service, the data source, or the system defaults, and HPDM allows you to
+upload JAR files of any size.
+
+To alter a library and change its underlying JAR file:
+
+1.  In HPDM, select the Database area.
+2.  In the navigation tree pane, expand the tree to display the folders
+of the schema that contains the library, and expand the Libraries folder
+to display the libraries within it.
+3.  Right-click the name of the library, and select Alter Library. If
+you selected a system library, a dialog box appears warning you that you
+cannot alter a system library. If you selected a user library, the Alter
+Library dialog box appears. For more information, see
+link:#_bookmark103["Use the Alter] link:#_bookmark103[Library Dialog
+Box" (page 33)].
+4.  In the Alter Library dialog box, click the [ Browse ] button to
+locate and select a new JAR file on the client workstation. The "Select
+a code file" dialog box appears.
+5.  In the "Select a code file" dialog box, locate and select the JAR
+file on the client workstation, and click [ Open ] to return to the
+Alter Library dialog box. The Alter Library dialog box displays the full
+path of the new JAR file in the Code File field.
+6.  Click [ Alter ] to alter the library, or click [ Close ] to quit the
+dialog box without altering the library.
+
+If you click [ Alter ], a dialog box appears warning you that altering a
+library might affect stored procedures that use the library and asking
+if you wish to continue the alter operation. Click [ Yes ] to proceed,
+or click [ No ] to cancel the operation. If you click [ Yes ], HPDM
+validates the JAR file, uploads the JAR file, and alters the library in
+the schema.
+
+1.  When notified that the library was altered successfully, click [ OK
+] to close the Alter Library dialog box and return to the HPDM main
+window.
+
+Related Topics
+
+link:#_bookmark103["Use the Alter Library Dialog Box" (page 33)]
+link:#_bookmark95["Create a Library" (page 29)]
+
+link:#_bookmark105["Drop a Library" (page 33)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+link:#_bookmark110["Display Libraries and Their Properties" (page 36)]
+
+[[use-the-alter-library-dialog-box]]
+== Use the Alter Library Dialog Box
+
+The Alter Library dialog box allows you to alter a library and change
+its underlying JAR file.
+
+Requirements:
+
+* You must have been granted the UPDATE privilege for the library. For
+more information, see the Grant/Revoke Privileges Tool in HPDM or the
+GRANT LIBRARY statement in the __Trafodion SQL Reference Manual__.
+* You must either be the owner of the schema where you will alter the
+library or have the ALTER_LIBRARY privilege for the schema to alter the
+library. The schema owner can grant such a schema-level privilege to
+other users or roles. For more information, see the Grant/Revoke
+Privileges Tool in HPDM or the GRANT SCHEMA statement in the __Trafodion
+SQL Reference Manual__.
+* The JAR file that you select for the library must contain valid Java
+bytecode and must not be used by another library in the catalog.
+* The JAR file that you select for the library must not exceed a size
+threshold if one has been set for HPDM's internal WMS service, the data
+source, or the system defaults.
+
+For example, if the CONTROL QUERY DEFAULT (CQD),
+POS_ABSOLUTE_MAX_TABLE_SIZE,
+
+has been set for the HPS_MANAGEABILITY service, it will limit the size
+of JAR files that can be uploaded by HPDM. If the JAR file's size
+exceeds the threshold, a warning message is displayed, and the file is
+not uploaded. By default, this CQD is not set for HPDM's internal WMS
+service, the data source, or the system defaults, and HPDM allows you to
+upload JAR files of any size.
+
+
+[cols=",,",options="header",]
+|===
+[[group-box]]
+Group Box
+Control or Field
+Description or Action
+Library
+Catalog
+Name of the catalog where the library will be created. This is a
+read-only field.
+Schema
+Name of the schema where the library will be created. This is a
+read-only field.
+Library Name
+Name of the library. This is a read-only field.
+Code File
+Code File
+Click [ Browse ] to launch the "Select a code file" dialog box and
+navigate to a new JAR file on the client workstation.
+[ Alter ]
+Alters the library.
+[ Close ]
+Closes the dialog box without altering the library.
+[ Help ]
+Displays context-sensitive help for this dialog box.
+|===
+
+[[related-topics]]
+Related Topics
+
+link:#_bookmark100["Alter a Library" (page 32)]
+link:#_bookmark95["Create a Library" (page 29)] link:#_bookmark105["Drop
+a Library" (page 33)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+
+[[drop-a-library]]
+== Drop a Library
+
+Dropping a library removes the library from the schema in the database
+and removes the library's underlying JAR file from the Trafodion
+database.
+
+Requirements:
+
+* You must either be the owner of the schema where you will drop the
+library or have the DROP_LIBRARY privilege for the schema to drop the
+library. The schema owner can grant such a schema-level privilege to
+other users or roles. For more information, see the Grant/Revoke
+Privileges Tool in HPDM or the GRANT SCHEMA statement in the __Trafodion
+SQL Reference Manual__.
+
+To drop a library from the database:
+
+1.  In HPDM, select the Database area.
+2.  In the navigation tree pane, expand the tree to display the folders
+of the schema that contains the library, and expand the Libraries folder
+to display the libraries within it.
+3.  Right-click the name of the library, and select Drop Library. The
+Drop Library dialog box appears.
+4.  In the Drop Library dialog box appears, select the Dropping all
+procedures and routines using this library check box to drop all stored
+procedures that are using the library. If you do not select this option
+when stored procedures are using the library, the drop operation will
+fail with an error message.
+5.  Click [ Yes ] to drop the library, or click [ No ] to quit the
+dialog box without dropping the library.
+
+Related Topics
+
+link:#_bookmark95["Create a Library" (page 29)]
+link:#_bookmark100["Alter a Library" (page 32)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+link:#_bookmark110["Display Libraries and Their Properties" (page 36)]
+
+[[download-a-jar-file-from-a-library]]
+== Download a JAR File From a Library
+
+Requirements:
+
+* You must have the CREATE_LIBRARY privilege for the SQL_OPERATIONS
+component. For more information, see the component privileges in the _HP
+Database Manager (HPDM) User Guide_ or the online help in HPDM.
+
+To download a JAR file from a library:
+
+1.  In HPDM, select the Database area.
+2.  In the navigation tree pane, expand the tree to display the folders
+of the schema that contains the library, and expand the Libraries folder
+to display the libraries within it.
+3.  Right-click the name of the library, and select Browse Library. The
+Browse Library dialog box appears with the name of the library selected
+in the tree pane and displayed in the right pane. For more information,
+see link:#_bookmark109["Use the Library Browser" (page 35)].
+4.  Click the [ Download ] button. The Browse For Folder dialog box
+appears.
+5.  In the Browse For Folder dialog box, select a target folder on the
+client workstation for downloading the JAR file.
+6.  Click [ OK ] to start downloading the library's underlying JAR file
+to the client workstation, or click [ Cancel ] to quit the Browse For
+Folder dialog box and return to the Browse Library dialog box.
+7.  When notified that the download completed successfully, click [ OK ]
+to return to the Browse Library dialog box.
+
+Related Topics
+
+link:#_bookmark109["Use the Library Browser" (page 35)]
+link:#_bookmark95["Create a Library" (page 29)]
+
+link:#_bookmark100["Alter a Library" (page 32)] link:#_bookmark105["Drop
+a Library" (page 33)]
+
+link:#_bookmark110["Display Libraries and Their Properties" (page 36)]
+
+[[use-the-library-browser]]
+== Use the Library Browser
+
+Depending on the context in which the Library Browser is launched, you
+can use it to view, create, or drop libraries in the database; to
+download a JAR file from a library in the database to the client
+workstation; or to select a Java method in a library when creating a
+stored procedure. The Library Browser consists of these main parts:
+
+image:media/image5.jpeg[image]
+
+Use these buttons to perform various library management tasks:
+
+Button Function
+
+[ Create ]
+
+Launches the Create Library dialog box so that you can create a library
+in the database. In the navigation tree pane, select a schema name or
+the Libraries folder to activate this button. For more information, see
+link:#_bookmark98["Use the Create Library Dialog Box" (page 31)].
+
+[ Drop ]
+
+Launches the Drop Library dialog box so that you can delete a library
+from the database. In the navigation tree pane, select the name of a
+library to activate this button. For more information, see
+link:#_bookmark105["Drop a Library" (page 33)].
+
+[ Download ]
+
+[ Refresh ]
+
+Launches the Browse For Folder dialog box so that you can select a
+folder on the client workstation for downloading a library's underlying
+JAR file. In the navigation tree pane, select the name of a library to
+activate this button. For more information, see
+link:#_bookmark107["Download] link:#_bookmark107[a JAR File From a
+Library" (page 34)].
+
+Refreshes the data grid with the latest metadata.
+
+[ OK ]
+
+[ Close ]
+
+Accepts your selected Java method for the stored procedure that you are
+creating, closes the Library Browser, and returns to the Create
+Procedure dialog box. This button appears only if you launched the
+Library Browser from the Create Procedure tool. It is activated after
+you select a Java class name in the navigation tree pane and then select
+a Java method name in the data grid. For more information, see
+link:#_bookmark116["Create a Procedure" (page 37)] or
+link:#_bookmark120["Use] link:#_bookmark120[the Create Procedure Dialog
+Box" (page 39)].
+
+Closes the Library Browser.
+
+[ Help ] Displays context-sensitive help for the Library Browser.
+
+Related Topics
+
+link:#_bookmark95["Create a Library" (page 29)]
+
+link:#_bookmark98["Use the Create Library Dialog Box" (page 31)]
+link:#_bookmark105["Drop a Library" (page 33)]
+
+link:#_bookmark107["Download a JAR File From a Library" (page 34)]
+link:#_bookmark116["Create a Procedure" (page 37)]
+
+link:#_bookmark120["Use the Create Procedure Dialog Box" (page 39)]
+
+[[display-libraries-and-their-properties]]
+== Display Libraries and Their Properties
+
+To display the libraries in a schema:
+
+1.  Start the HP Database Manager and log on using any user name.
+2.  Click the Database area.
+3.  In the navigation tree pane, select a Schema, and expand the schema
+so that you can see the object folders underneath it.
+4.  Expand the Libraries tab in the right pane and select a library
+name, or open the Libraries
+folder and select a library name in the tree. HPDM displays the
+libraries for this schema.
+
+image:media/image6.jpeg[image]
+
+For more information about the library properties displayed in HPDM, see
+the _HP Database Manager (HPDM) User Guide_ or the online help in HPDM.
+


[22/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED027
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED027 b/core/sql/regress/seabase/EXPECTED027
index 8c48546..2465664 100644
--- a/core/sql/regress/seabase/EXPECTED027
+++ b/core/sql/regress/seabase/EXPECTED027
@@ -12,11 +12,12 @@
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:16 2016
+-- Definition current  Sat Mar 12 02:58:49 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -39,11 +40,12 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:25 2016
+-- Definition current  Sat Mar 12 02:58:59 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -67,12 +69,13 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:30 2016
+-- Definition current  Sat Mar 12 02:59:05 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -98,13 +101,14 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:39 2016
+-- Definition current  Sat Mar 12 02:59:14 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   , CF3.C                            INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -127,13 +131,14 @@ CREATE TABLE TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:40 2016
+-- Definition current  Sat Mar 12 02:59:16 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   , CF3.C                            INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -191,7 +196,7 @@ A            B            C
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:46 2016
+-- Definition current  Sat Mar 12 02:59:22 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -199,6 +204,7 @@ A            B            C
   , CF3.C                            INT DEFAULT NULL
   , "cf2".D                          INT DEFAULT NULL /*added_col*/
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -228,7 +234,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:49 2016
+-- Definition current  Sat Mar 12 02:59:26 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -237,6 +243,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
   , "cf2".D                          INT DEFAULT NULL /*added_col*/
   , "cf4".E                          INT DEFAULT NULL /*added_col*/
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -267,7 +274,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:54 2016
+-- Definition current  Sat Mar 12 02:59:31 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -275,6 +282,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
   , CF3.C                            INT DEFAULT NULL
   , "cf4".E                          INT DEFAULT NULL /*added_col*/
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -304,7 +312,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t01;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T01
--- Definition current  Fri Feb 26 20:36:55 2016
+-- Definition current  Sat Mar 12 02:59:32 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -313,6 +321,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
   , "cf4".E                          INT DEFAULT NULL /*added_col*/
   , "cf2".D                          INT DEFAULT NULL /*added_col*/
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t01;
@@ -343,7 +352,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Fri Feb 26 20:37:02 2016
+-- Definition current  Sat Mar 12 02:59:40 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -352,6 +361,7 @@ CREATE INDEX T027T01I1 ON TRAFODION.SCH027.T027T01
   , "cf4".E                          INT DEFAULT NULL
   , "cf2".D                          INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t011;
@@ -387,7 +397,7 @@ A            B            C            E            D
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Fri Feb 26 20:37:06 2016
+-- Definition current  Sat Mar 12 02:59:43 2016
 
   (
     "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -396,6 +406,7 @@ A            B            C            E            D
   , "cf4".E                          INT DEFAULT NULL
   , "cf2".D                          INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t011;
@@ -426,10 +437,11 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Fri Feb 26 20:37:15 2016
+-- Definition current  Sat Mar 12 02:59:53 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                INT DEFAULT NULL
   , C                                INT DEFAULT NULL
   , E                                INT DEFAULT NULL
@@ -460,10 +472,11 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t011;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T011
--- Definition current  Fri Feb 26 20:37:19 2016
+-- Definition current  Sat Mar 12 02:59:57 2016
 
   (
-    "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "cf".A                           INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   , CF3.C                            INT DEFAULT NULL
   , "cf4".E                          INT DEFAULT NULL
@@ -491,13 +504,14 @@ CREATE TABLE TRAFODION.SCH027.T027T011
 >>invoke t027t03;
 
 -- Definition of Trafodion volatile table T027T03
--- Definition current  Fri Feb 26 20:37:25 2016
+-- Definition current  Sat Mar 12 03:00:03 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   , C                                INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t03;
@@ -522,13 +536,14 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t03;
 
 -- Definition of Trafodion volatile table T027T03
--- Definition current  Fri Feb 26 20:37:45 2016
+-- Definition current  Sat Mar 12 03:00:24 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
   , "cf2".B                          INT DEFAULT NULL
   , "cf".C                           INT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>showddl t027t03;
@@ -570,10 +585,11 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t02;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T02
--- Definition current  Fri Feb 26 20:38:04 2016
+-- Definition current  Sat Mar 12 03:00:45 2016
 
   (
-    "cf".A0A0                        INT DEFAULT NULL
+    "cf".SYSKEY                      LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "cf".A0A0                        INT DEFAULT NULL
   , "cf".A1A1                        INT DEFAULT NULL
   , "cf".A2A2                        INT DEFAULT NULL
   , "cf".A3A3                        INT DEFAULT NULL
@@ -621,7 +637,7 @@ CREATE VOLATILE TABLE T027T03
 >>invoke t027t03;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T03
--- Definition current  Fri Feb 26 20:38:26 2016
+-- Definition current  Sat Mar 12 03:01:07 2016
 
   (
     "cf1".A                          INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -629,6 +645,7 @@ CREATE VOLATILE TABLE T027T03
   , C                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (A ASC, B ASC)
 
 --- SQL operation complete.
 >>insert into t027t03 values (1,1,1,1);
@@ -657,7 +674,7 @@ A            B            C            D
 >>invoke t027t02;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T02
--- Definition current  Fri Feb 26 20:38:40 2016
+-- Definition current  Sat Mar 12 03:01:20 2016
 
   (
     OBJECT_UID                       LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -669,6 +686,7 @@ A            B            C            D
   , NONKEYCOL                        INT NO DEFAULT NOT NULL NOT DROPPABLE
   , FLAGS                            LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (OBJECT_UID ASC, KEYSEQ_NUMBER ASC)
 
 --- SQL operation complete.
 >>select * from t027t02;
@@ -769,7 +787,7 @@ create index t027t01i2 on t027t01("cf2".b);
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:39:06 2016
+-- Definition current  Sat Mar 12 03:01:46 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -778,7 +796,10 @@ create index t027t01i2 on t027t01("cf2".b);
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>insert into t027t7 values (1, 'ab', 'cd', 10);
@@ -798,7 +819,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:39:13 2016
+-- Definition current  Sat Mar 12 03:01:54 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -807,7 +828,10 @@ A            B   C                 Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column c varchar(5) character set utf8;
@@ -816,7 +840,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:39:35 2016
+-- Definition current  Sat Mar 12 03:02:19 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -825,7 +849,10 @@ A            B   C                 Z
   , C                                VARCHAR(5 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column c varchar(4) character set utf8;
@@ -834,7 +861,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:39:50 2016
+-- Definition current  Sat Mar 12 03:02:42 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -843,7 +870,10 @@ A            B   C                 Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>
@@ -853,7 +883,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:40:08 2016
+-- Definition current  Sat Mar 12 03:03:05 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -862,7 +892,10 @@ A            B   C                 Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column b varchar(4) character set utf8;
@@ -871,7 +904,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:40:26 2016
+-- Definition current  Sat Mar 12 03:03:25 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -880,7 +913,10 @@ A            B   C                 Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column c varchar(6);
@@ -889,7 +925,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:40:43 2016
+-- Definition current  Sat Mar 12 03:03:42 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -898,7 +934,10 @@ A            B   C                 Z
   , C                                VARCHAR(6) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column b varchar(2);
@@ -907,7 +946,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:40:58 2016
+-- Definition current  Sat Mar 12 03:04:05 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -916,7 +955,10 @@ A            B   C                 Z
   , C                                VARCHAR(6) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column a int;
@@ -925,7 +967,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:41:12 2016
+-- Definition current  Sat Mar 12 03:04:25 2016
 
   (
     A                                INT DEFAULT NULL /*altered_col*/
@@ -934,7 +976,10 @@ A            B   C                 Z
   , C                                VARCHAR(6) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>alter table t027t7 alter column a smallint default 0 not null;
@@ -943,7 +988,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:41:30 2016
+-- Definition current  Sat Mar 12 03:04:44 2016
 
   (
     A                                SMALLINT DEFAULT 0 NOT NULL NOT DROPPABLE
@@ -953,7 +998,10 @@ A            B   C                 Z
   , C                                VARCHAR(6) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL /*altered_col*/
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>select * from t027t7;
@@ -966,7 +1014,7 @@ A       B   C       Z
 --- 1 row(s) selected.
 >>
 >>-- aligned format
->>drop table if exists t027t7;
+>>drop table if exists t027t7 cascade;
 
 --- SQL operation complete.
 >>create table t027t7(a int not null, b varchar(2), 
@@ -977,7 +1025,7 @@ A       B   C       Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:41:52 2016
+-- Definition current  Sat Mar 12 03:05:07 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -986,7 +1034,10 @@ A       B   C       Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>insert into t027t7 values (1, 'ab', 'cd', 10);
@@ -1006,7 +1057,7 @@ A            B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:42:09 2016
+-- Definition current  Sat Mar 12 03:05:32 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
@@ -1015,7 +1066,10 @@ A            B   C                 Z
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>select * from t027t7;
@@ -1032,14 +1086,17 @@ A                     B   C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:42:35 2016
+-- Definition current  Sat Mar 12 03:05:57 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>select * from t027t7;
@@ -1056,16 +1113,19 @@ A                     C                 Z
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:42:38 2016
+-- Definition current  Sat Mar 12 03:06:00 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT _ISO88591'abc' NOT NULL NOT DROPPABLE /*added_col*/
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>select * from t027t7;
@@ -1082,14 +1142,17 @@ A                     C                 Z            B
 >>invoke t027t7;
 
 -- Definition of Trafodion table TRAFODION.SCH027.T027T7
--- Definition current  Fri Feb 26 20:43:02 2016
+-- Definition current  Sat Mar 12 03:06:25 2016
 
   (
     A                                LARGEINT DEFAULT NULL /*altered_col*/
   , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
 
 --- SQL operation complete.
 >>select * from t027t7;
@@ -1100,6 +1163,46 @@ A                     C                 Z
                    1  cd                         10
 
 --- 1 row(s) selected.
+>>create view t027v1 as select * from t027t7;
+
+--- SQL operation complete.
+>>get all views on table t027t7;
+
+Views on Table SCH027.T027T7
+============================
+
+SCH027.T027V1
+
+--- SQL operation complete.
+>>invoke t027v1;
+
+-- Definition of Trafodion view TRAFODION.SCH027.T027V1
+-- Definition current  Sat Mar 12 03:06:33 2016
+
+  (
+    A                                LARGEINT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
+>>alter table t027t7 alter column a smallint;
+
+--- SQL operation complete.
+>>invoke t027v1;
+
+-- Definition of Trafodion view TRAFODION.SCH027.T027V1
+-- Definition current  Sat Mar 12 03:07:06 2016
+
+  (
+    A                                SMALLINT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  )
+
+--- SQL operation complete.
 >>
 >>-- negative tests for alter/drop column
 >>alter table t027t7 alter column b int;
@@ -1116,8 +1219,6 @@ A                     C                 Z
 
 *** ERROR[8402] A string overflow occurred during the evaluation of a character expression. Conversion of Source Type:VARCHAR(REC_BYTE_V_ASCII,2 BYTES,ISO88591) Source Value:cd to Target Type:CHAR(REC_BYTE_F_ASCII,1 BYTES,ISO88591).
 
-*** ERROR[8839] Transaction was aborted.
-
 *** ERROR[1404] Column C cannot be altered. Reason: Old data could not be updated using the altered column definition.
 
 --- SQL operation failed with errors.
@@ -1126,9 +1227,327 @@ A                     C                 Z
 *** ERROR[1009] Column E does not exist in the specified table.
 
 --- SQL operation failed with errors.
+>>alter table t027t7 drop column a;
+
+*** ERROR[4003] Column TRAFODION.SCH027.T027T7.A is not a column in table TRAFODION.SCH027.T027T7, or, after a NATURAL JOIN or JOIN USING, is no longer allowed to be specified with a table correlation name.
+
+*** ERROR[1404] Column A cannot be altered. Reason: Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.
+
+--- SQL operation failed with errors.
+>>alter table t027v1 alter column a smallint;
+
+*** ERROR[1146] Object TRAFODION.SCH027.T027V1 could not be altered because it either does not exist or is not a table.
+
+--- SQL operation failed with errors.
+>>get all views on table t027t7;
+
+Views on Table SCH027.T027T7
+============================
+
+SCH027.T027V1
+
+--- SQL operation complete.
+>>
+>>-- tests for alter column rename
+>>drop table if exists t027t7 cascade;
+
+--- SQL operation complete.
+>>create table t027t7(a int not null, b varchar(2), 
++>   c varchar(4) character set utf8 not null, z int not null primary key)
++>salt using 2 partitions;
+
+--- SQL operation complete.
+>>create index t027t7i1 on t027t7(b);
+
+--- SQL operation complete.
+>>insert into t027t7 values (1, 'ab', 'cd', 10);
+
+--- 1 row(s) inserted.
+>>invoke t027t7;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T7
+-- Definition current  Sat Mar 12 03:09:01 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                VARCHAR(2) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
+  )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
+
+--- SQL operation complete.
+>>select * from t027t7;
+
+A            B   C                 Z          
+-----------  --  ----------------  -----------
+
+          1  ab  cd                         10
+
+--- 1 row(s) selected.
+>>alter table t027t7 alter column b rename to bb;
+
+--- SQL operation complete.
+>>invoke t027t7;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T7
+-- Definition current  Sat Mar 12 03:09:12 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , BB                               VARCHAR(2) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL /*altered_col*/
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  , Z                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
+  )
+  PRIMARY KEY ("_SALT_" ASC, Z ASC)
+
+--- SQL operation complete.
+>>select * from t027t7;
+
+A            BB  C                 Z          
+-----------  --  ----------------  -----------
+
+          1  ab  cd                         10
+
+--- 1 row(s) selected.
+>>alter table t027t7 alter column z rename to zz;
+
+--- SQL operation complete.
+>>invoke t027t7;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T7
+-- Definition current  Sat Mar 12 03:09:24 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , BB                               VARCHAR(2) CHARACTER SET ISO88591 COLLATE
+      DEFAULT DEFAULT NULL /*altered_col*/
+  , C                                VARCHAR(4 CHARS) CHARACTER SET UTF8
+      COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
+  , ZZ                               INT NO DEFAULT NOT NULL NOT DROPPABLE
+      /*altered_col*/
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
+  )
+  PRIMARY KEY ("_SALT_" ASC, ZZ ASC)
+
+--- SQL operation complete.
+>>select * from t027t7;
+
+A            BB  C                 ZZ         
+-----------  --  ----------------  -----------
+
+          1  ab  cd                         10
+
+--- 1 row(s) selected.
+>>create view t027v1(zz) as select zz from t027t7;
+
+--- SQL operation complete.
+>>alter table t027t7 alter column c rename to cc;
+
+--- SQL operation complete.
+>>create view t027v2(zz) as select zz from t027t7 where cc = 'a';
+
+--- SQL operation complete.
+>>showddl t027v2;
+
+CREATE VIEW TRAFODION.SCH027.T027V2 (ZZ) AS
+  SELECT TRAFODION.SCH027.T027T7.ZZ FROM TRAFODION.SCH027.T027T7 WHERE
+    TRAFODION.SCH027.T027T7.CC = 'a' ;
+
+--- SQL operation complete.
+>>
+>>-- negative tests for alter column rename
+>>alter table t027t7 alter column zz rename to a;
+
+*** ERROR[1404] Column ZZ cannot be altered. Reason: Renamed column A already exist in the table.
+
+--- SQL operation failed with errors.
+>>alter table t027t7 alter column "_SALT_" rename to nosalt;
+
+*** ERROR[1404] Column _SALT_ cannot be altered. Reason: Cannot rename system or computed column.
+
+--- SQL operation failed with errors.
+>>alter table t027t7 alter column cc rename to "_SALT_";
+
+*** ERROR[1404] Column CC cannot be altered. Reason: Renamed column _SALT_ is reserved for internal system usage.
+
+--- SQL operation failed with errors.
+>>alter table t027t7 alter column zz rename to zzz;
+
+*** ERROR[4003] Column TRAFODION.SCH027.T027T7.ZZ is not a column in table TRAFODION.SCH027.T027T7, or, after a NATURAL JOIN or JOIN USING, is no longer allowed to be specified with a table correlation name.
+
+*** ERROR[1404] Column ZZ cannot be altered. Reason: Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.
+
+--- SQL operation failed with errors.
+>>alter table t027t7 alter column cc rename to ccc;
+
+*** ERROR[4003] Column TRAFODION.SCH027.T027T7.CC is not a column in table TRAFODION.SCH027.T027T7, or, after a NATURAL JOIN or JOIN USING, is no longer allowed to be specified with a table correlation name.
+
+*** ERROR[1404] Column CC cannot be altered. Reason: Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.
+
+--- SQL operation failed with errors.
+>>
+>>-- alter col with views
+>>drop table if exists t027t7 cascade;
+
+--- SQL operation complete.
+>>create table t027t7 (a varchar(10), b int);
+
+--- SQL operation complete.
+>>create view t027v1 as select * from t027t7;
+
+--- SQL operation complete.
+>>create view t027v12 as select * from t027v1;
+
+--- SQL operation complete.
+>>create view t027v11 as select * from t027t7;
+
+--- SQL operation complete.
+>>create view t027v122 as select * from t027v12;
+
+--- SQL operation complete.
+>>create view t027v113 as select * from t027v11;
+
+--- SQL operation complete.
+>>get all views on table t027t7;
+
+Views on Table SCH027.T027T7
+============================
+
+SCH027.T027V1
+SCH027.T027V11
+SCH027.T027V113
+SCH027.T027V12
+SCH027.T027V122
+
+--- SQL operation complete.
+>>alter table t027t7 alter column a varchar(20);
+
+--- SQL operation complete.
+>>get all views on table t027t7;
+
+Views on Table SCH027.T027T7
+============================
+
+SCH027.T027V1
+SCH027.T027V11
+SCH027.T027V113
+SCH027.T027V12
+SCH027.T027V122
+
+--- SQL operation complete.
+>>
+>>-- some alter operations cannot be performed within a user xn
+>>cqd ddl_transactions 'ON';
+
+--- SQL operation complete.
+>>begin work;
+
+--- SQL operation complete.
+>>alter table t027t7 drop column b;
+
+*** ERROR[20123] A user-defined transaction has been started. ALTER cannot be performed.
+
+*** ERROR[8839] Transaction was aborted.
+
+--- SQL operation failed with errors.
+>>rollback work;
+
+*** ERROR[8609] Waited rollback performed without starting a transaction.
+
+--- SQL operation failed with errors.
+>>begin work;
+
+--- SQL operation complete.
+>>alter table t027t7 alter column b largeint;
+
+*** ERROR[20123] A user-defined transaction has been started. ALTER cannot be performed.
+
+*** ERROR[8839] Transaction was aborted.
+
+--- SQL operation failed with errors.
+>>rollback work;
+
+*** ERROR[8609] Waited rollback performed without starting a transaction.
+
+--- SQL operation failed with errors.
+>>
+>>-- reserved words cannot be used as colnames in create/add/alter stmts
+>>drop table if exists t027t7 cascade;
+
+--- SQL operation complete.
+>>create table t027t7 (syskey int);
+
+*** ERROR[1269] Column name SYSKEY is reserved for internal system usage. It cannot be specified as a user column.
+
+--- SQL operation failed with errors.
+>>create table t027t7 ("_SALT_" int);
+
+*** ERROR[1269] Column name _SALT_ is reserved for internal system usage. It cannot be specified as a user column.
+
+--- SQL operation failed with errors.
+>>create table t027t7 ("_DIVISION_2_" int);
+
+*** ERROR[1269] Column name _DIVISION_2_ is reserved for internal system usage. It cannot be specified as a user column.
+
+--- SQL operation failed with errors.
+>>create table t027t7 (a int not null primary key);
+
+--- SQL operation complete.
+>>alter table t027t7 add column "_SALT_" int;
+
+*** ERROR[1269] Column name _SALT_ is reserved for internal system usage. It cannot be specified as a user column.
+
+--- SQL operation failed with errors.
+>>alter table t027t7 alter column a rename to SYSKEY;
+
+*** ERROR[1404] Column A cannot be altered. Reason: Renamed column SYSKEY is reserved for internal system usage.
+
+--- SQL operation failed with errors.
+>>
+>>-- if cqd is specified, then reserved cols can be used. 
+>>-- Use this cqd carefully.
+>>cqd traf_allow_reserved_colnames 'ON';
+
+--- SQL operation complete.
+>>drop table if exists t027t7 cascade;
+
+--- SQL operation complete.
+>>create table t027t7 (syskey int not null primary key, b int);
+
+--- SQL operation complete.
+>>alter table t027t7 add column "_DIVISION_1" int;
+
+--- SQL operation complete.
+>>alter table t027t7 alter column b rename to "_SALT_";
+
+--- SQL operation complete.
+>>invoke t027t7;
+
+-- Definition of Trafodion table TRAFODION.SCH027.T027T7
+-- Definition current  Thu Mar 17 14:48:27 2016
+
+  (
+    SYSKEY                           INT NO DEFAULT NOT NULL NOT DROPPABLE 
+  , "_SALT_"                         INT DEFAULT NULL /*altered_col*/
+  , "_DIVISION_1"                    INT DEFAULT NULL /*added_col*/
+  )
+  PRIMARY KEY (SYSKEY ASC)
+
+--- SQL operation complete.
 >>
 >>-- cleanup
->>drop table if exists t027t7;
+>>?section clean_up
+>>drop table if exists t027t7 cascade;
 
 --- SQL operation complete.
 >>drop table if exists t027t01;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED030
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED030 b/core/sql/regress/seabase/EXPECTED030
new file mode 100644
index 0000000..3d85727
--- /dev/null
+++ b/core/sql/regress/seabase/EXPECTED030
@@ -0,0 +1,599 @@
+>>
+>>select to_date('2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('03/01/2016', 'MM/DD/YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('01.03.2016', 'DD.MM.YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('2016-03', 'YYYY-MM') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('2016/03/01', 'YYYY/MM/DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('20160301', 'YYYYMMDD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('16/03/01', 'YY/MM/DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+0016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('03/01/16', 'MM/DD/YY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+0016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('03-01-2016', 'MM-DD-YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('201603', 'YYYYMM') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('01-03-2016', 'DD-MM-YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('01-MAR-2016', 'DD-MON-YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('01MAR2016', 'DDMONYYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date('20160301101112', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:12.000000
+
+--- 1 row(s) selected.
+>>select to_date('01.03.2016:10:11:12', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:12.000000
+
+--- 1 row(s) selected.
+>>select to_date('2016-03-01 10:11:12', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:12.000000
+
+--- 1 row(s) selected.
+>>select to_date('03/01/2016 10:11:12', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:12.000000
+
+--- 1 row(s) selected.
+>>select to_date('01-MAR-2016 10:11:12', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:12.000000
+
+--- 1 row(s) selected.
+>>select to_date('March 01, 2016, 10:11', 'MONTH DD, YYYY, HH:MI') from (values(1)) x(a);
+
+(EXPR)                    
+--------------------------
+
+2016-03-01 10:11:00.000000
+
+--- 1 row(s) selected.
+>>select to_date ('10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>select to_date ('10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>select to_time ('10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>select to_time ('10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>
+>>select to_char(DATE '2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'MM/DD/YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+03/01/2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DD.MM.YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+01.03.2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYY-MM') from (values(1)) x(a);
+
+(EXPR) 
+-------
+
+2016-03
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYY/MM/DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016/03/01
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYYMMDD') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+20160301
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YY/MM/DD') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+16/03/01
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'MM/DD/YY') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+03/01/16
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'MM-DD-YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+03-01-2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYYMM') from (values(1)) x(a);
+
+(EXPR)
+------
+
+201603
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DD-MM-YYYY') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+01-03-2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DD-MON-YYYY') from (values(1)) x(a);
+
+(EXPR)     
+-----------
+
+01-MAR-2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DDMONYYYY') from (values(1)) x(a);
+
+(EXPR)   
+---------
+
+01MAR2016
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+
+(EXPR)        
+--------------
+
+2016030100:00:
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+01.03.2016:00:00:00
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+2016-03-01 00:00:00
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+03/01/2016 00:00:00
+
+--- 1 row(s) selected.
+>>select to_char(DATE '2016-03-01', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)              
+--------------------
+
+01-MAR-2016 00:00:00
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+
+(EXPR)        
+--------------
+
+20160301101112
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+01.03.2016:10:11:12
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+2016-03-01 10:11:12
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)             
+-------------------
+
+03/01/2016 10:11:12
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)              
+--------------------
+
+01-MAR-2016 10:11:12
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'MONTH DD, YYYY, HH:MI') from (values(1)) x(a);
+
+(EXPR)                   
+-------------------------
+
+March 01, 2016, 10:11:12 
+
+--- 1 row(s) selected.
+>>select to_char (time '10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>select to_char (time '10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:23:34
+
+--- 1 row(s) selected.
+>>
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYY-MM-DD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_char(TIMESTAMP '2016-03-01 10:11:12', 'HH:MI:SS') from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10:11:12
+
+--- 1 row(s) selected.
+>>
+>>select dateformat(time '10:11:12.1', default) from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+10:11:12.1
+
+--- 1 row(s) selected.
+>>select dateformat(time '10:11:12.123', usa) from (values(1)) x(a);
+
+(EXPR)         
+---------------
+
+10:11:12.123 AM
+
+--- 1 row(s) selected.
+>>select dateformat(time '10:11:12', european) from (values(1)) x(a);
+
+(EXPR)  
+--------
+
+10.11.12
+
+--- 1 row(s) selected.
+>>select dateformat(timestamp '2016-03-01 10:11:12.1', default) from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select dateformat(timestamp '2016-03-01 10:11:12', usa) from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+03/01/2016
+
+--- 1 row(s) selected.
+>>select dateformat(timestamp '2016-03-01 10:11:12.123', european) from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+01.03.2016
+
+--- 1 row(s) selected.
+>>
+>>drop table if exists t030t1;
+
+--- SQL operation complete.
+>>create table t030t1 (a date, b char(30), c varchar(30));
+
+--- SQL operation complete.
+>>insert into t030t1 values (date '2016-03-01', '2016-03-01', '2016-03-01');
+
+--- 1 row(s) inserted.
+>>
+>>select to_char(a, 'YYYYMMDD') from t030t1;
+
+(EXPR)  
+--------
+
+20160301
+
+--- 1 row(s) selected.
+>>select a (date, format 'YYYYMMDD') from t030t1;
+
+(EXPR)  
+--------
+
+20160301
+
+--- 1 row(s) selected.
+>>select to_date(b, 'YYYY-MM-DD') from t030t1;
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date(c, 'YYYY-MM-DD') from t030t1;
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>
+>>-- negative tests
+>>select to_date('2016-03-01', 'YYYYMM-DD') from (values(1)) x(a);
+
+*** ERROR[4065] The format, "YYYYMM-DD", specified in the TO_DATE function is not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select to_date(DATE '2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+
+*** ERROR[4043] The operand of function TO_DATE must be character.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select to_date('0103.2016', 'DD.MM.YYYY') from (values(1)) x(a);
+
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted.
+
+--- 0 row(s) selected.
+>>select to_char('2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+
+*** ERROR[4071] The first operand of function TO_CHAR must be a datetime.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select to_date(20160301, 'YYYYMMDD') from (values(1)) x(a);
+
+*** ERROR[4043] The operand of function TO_DATE must be character.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select to_char(date '2016-03-01', 'HH:MI:SS') from (values(1)) x(a);
+
+*** ERROR[4072] The operand of function TO_CHAR must be a datetime containing a time.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-- some formats only enabled in special mode. Not externalized.
+>>cqd mode_special_4 'ON';
+
+--- SQL operation complete.
+>>select to_date(20160301, 'YYYYMMDD') from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+2016-03-01
+
+--- 1 row(s) selected.
+>>select to_date(12345678, '99:99:99:99') from (values(1)) x(a);
+
+(EXPR)     
+-----------
+
+12:34:56:78
+
+--- 1 row(s) selected.
+>>select to_date(-12345678, '-99:99:99:99') from (values(1)) x(a);
+
+(EXPR)      
+------------
+
+-12:34:56:78
+
+--- 1 row(s) selected.
+>>
+>>-- ms4 error cases
+>>select to_date(123456789, '99:99:99:99') from (values(1)) x(a);
+
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted.
+
+*** ERROR[8001] An internal executor error occurred.
+
+--- 0 row(s) selected.
+>>select to_date(-12345678, '99:99:99:99') from (values(1)) x(a);
+
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted.
+
+*** ERROR[8001] An internal executor error occurred.
+
+--- 0 row(s) selected.
+>>select to_date(1e0, '99:99:99:99') from (values(1)) x(a);
+
+*** ERROR[4046] The operands of function TO_DATE must be exact numeric.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select to_date(1.2, '99:99:99:99') from (values(1)) x(a);
+
+*** ERROR[4047] The operands of function TO_DATE must have a scale of 0.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED031
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED031 b/core/sql/regress/seabase/EXPECTED031
new file mode 100644
index 0000000..5d0ea78
--- /dev/null
+++ b/core/sql/regress/seabase/EXPECTED031
@@ -0,0 +1,214 @@
+>>
+>>-- tests for PRIMARY KEY constraint usage
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (a int not null, b int not null, constraint ppk primary key(a));
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk primary key(b);
+
+*** ERROR[1043] Constraint TRAFODION.SCH.PPK already exists.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 add constraint ppk2 primary key(b);
+
+*** ERROR[1256] PRIMARY KEY constraint cannot be added since table TRAFODION.SCH.T031T1 already has a user specified clustering key.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 add constraint ppk unique(b);
+
+*** ERROR[1043] Constraint TRAFODION.SCH.PPK already exists.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 drop constraint ppk;
+
+*** ERROR[1255] Constraint TRAFODION.SCH.PPK is the clustering key constraint for table TRAFODION.SCH.T031T1 and cannot be dropped.
+
+--- SQL operation failed with errors.
+>>
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (a int not null, b int not null);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk primary key(a);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk primary key(b);
+
+*** ERROR[1043] Constraint TRAFODION.SCH.PPK already exists.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 add constraint ppk2 primary key(b);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk unique(b);
+
+*** ERROR[1043] Constraint TRAFODION.SCH.PPK already exists.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 drop constraint ppk;
+
+--- SQL operation complete.
+>>
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (a int not null, b int not null) store by (a);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk primary key(a);
+
+*** ERROR[1256] PRIMARY KEY constraint cannot be added since table TRAFODION.SCH.T031T1 already has a user specified clustering key.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 add constraint ppk unique(b);
+
+--- SQL operation complete.
+>>alter table t031t1 drop constraint ppk;
+
+--- SQL operation complete.
+>>
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (a int not null primary key, b int not null);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint ppk primary key(a);
+
+*** ERROR[1254] Duplicate unique constraints are not allowed with same set of columns.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 add constraint ppk primary key(b);
+
+*** ERROR[1256] PRIMARY KEY constraint cannot be added since table TRAFODION.SCH.T031T1 already has a user specified clustering key.
+
+--- SQL operation failed with errors.
+>>
+>>-- primary key update transformed into delete/insert incorrectly 
+>>-- deletes row after conflict
+>>create table if not exists t031t1 (a int not null primary key, b int not null);
+
+--- SQL operation complete.
+>>delete from t031t1;
+
+--- 0 row(s) deleted.
+>>insert into t031t1 values (1,1), (2,2), (3,3), (4,4);
+
+--- 4 row(s) inserted.
+>>update t031t1 set a = 4 where a = 2;
+
+*** ERROR[8102] The operation is prevented by a unique constraint.
+
+--- 0 row(s) updated.
+>>select * from t031t1;
+
+A            B          
+-----------  -----------
+
+          1            1
+          2            2
+          3            3
+          4            4
+
+--- 4 row(s) selected.
+>>
+>>-- incorrect ddl with salt clause should not crash
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (
++>T2C1 int not null not droppable,
++>T2C1 int not null not droppable,
++>T2C1 int)
++>salt using 2 partitions on (T2C1, T2C2)
++>store by (T2C1, T2C2);
+
+*** ERROR[1009] Column T2C2 does not exist in the specified table.
+
+--- SQL operation failed with errors.
+>>
+>>-- cannot rename table with check constraints.
+>>-- cascade option with rename not supported.
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1 (a int);
+
+--- SQL operation complete.
+>>alter table t031t1 add constraint t031t1_c1 check (a > 0);
+
+--- SQL operation complete.
+>>alter table t031t1 rename to t031t1_ren cascade;
+
+*** ERROR[1427] Table cannot be renamed. Reason: Cascade option not supported.
+
+--- SQL operation failed with errors.
+>>alter table t031t1 rename to t031t1_ren;
+
+*** ERROR[1427] Table cannot be renamed. Reason: Operation not allowed if check constraints are present. Drop the constraints and recreate them after rename.
+
+--- SQL operation failed with errors.
+>>
+>>-- time datatype conversion was returning incorrect results
+>>drop table if exists t031t1;
+
+--- SQL operation complete.
+>>create table t031t1
++>(id int not null,
++>time1 time default null,
++>time2 time default null,
++>type1 time default null,
++>type2 char(5) default null,
++>diff char(6) default null,
++>primary key (id));
+
+--- SQL operation complete.
+>>insert into t031t1 (id, time1, time2, diff) values (1, time '00:00:30.758788', time '00:00:29.615308', 'MATCH');
+
+--- 1 row(s) inserted.
+>>select * from t031t1 order by 1;
+
+ID           TIME1     TIME2     TYPE1     TYPE2  DIFF  
+-----------  --------  --------  --------  -----  ------
+
+          1  00:00:30  00:00:29  ?         ?      MATCH 
+
+--- 1 row(s) selected.
+>>update t031t1
++>set type1 =
++>case when (time1 + interval '1' second) < time2 then time1 else time2
++>end,
++>type2 =
++>case when (time1 + interval '1' second) < time2 then 'T1' else 'T2'
++>end
++>where id = 1;
+
+--- 1 row(s) updated.
+>>select
++>type2, diff, type1,
++>case
++>when diff = 'MATCH' then 'PASS' else 'FAIL'
++>end
++>from t031t1
++>where id = 1;
+
+TYPE2  DIFF    TYPE1     (EXPR)
+-----  ------  --------  ------
+
+T2     MATCH   00:00:29  PASS  
+
+--- 1 row(s) selected.
+>>select * from t031t1;
+
+ID           TIME1     TIME2     TYPE1     TYPE2  DIFF  
+-----------  --------  --------  --------  -----  ------
+
+          1  00:00:30  00:00:29  00:00:29  T2     MATCH 
+
+--- 1 row(s) selected.
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/TEST020
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST020 b/core/sql/regress/seabase/TEST020
index 64afa3c..a7ab1f4 100755
--- a/core/sql/regress/seabase/TEST020
+++ b/core/sql/regress/seabase/TEST020
@@ -90,6 +90,7 @@ drop table test020_t33 cascade;
 drop table test020t40 cascade;
 drop table test020t41 cascade;
 drop table test020t42 cascade;
+drop table test020t43 cascade;
 
 ?section tests
 create table  test020t1 (c1 int not null primary key,
@@ -136,11 +137,10 @@ create table test020t31 (g0 smallint default 32768 not null primary key);
 -- Test columns named SYSKEY
 --
 
--- Expecting error 1080 message: Duplicate references to column SYSKEY
---                               in the create request
--- when the following Create Table command is executed.
+-- Expecting error 1269 message: Col name SYSKEY is reserved.
 create table test020t5(syskey int);
 
+cqd traf_allow_reserved_colnames 'ON';
 create table test020t5(c int not null not droppable primary key not droppable,
                     syskey char(4));
 invoke test020t5;
@@ -151,6 +151,9 @@ alter table test020t5 add constraint test020t5c1 check (syskey >= 'aaaa');
 showddl test020t5;
 -- Expecting an error message when the following insert statement is executed.
 insert into test020t5 values (3, '1234');
+
+cqd traf_allow_reserved_colnames reset;
+
 --------------------------------------------
 -- test cases for solution 10-040607-6721 --
 --------------------------------------------
@@ -815,3 +818,9 @@ select * from table(index_table test020t42ix) ;
 -- check if the updated d column is reflected in the index
 upsert into test020t42 (a,b,e) values (1, 'c', 4);
 select * from table(index_table test020t42ix) ;
+
+create table test020t43(c1 int, c2 int ) attribute aligned format ;
+upsert into test020t43 values (1,1);
+upsert into test020t43 (c1) values(1);
+select * from test020t43 ; 
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/TEST027
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST027 b/core/sql/regress/seabase/TEST027
index d828640..b3d2710 100644
--- a/core/sql/regress/seabase/TEST027
+++ b/core/sql/regress/seabase/TEST027
@@ -21,14 +21,12 @@
 --
 -- tests for support of multiple column families
 -- tests for alter table alter column
+-- tests for reserved words usage in create/add/alter stmts
 
 create schema trafodion.sch027;
 set schema trafodion.sch027;
 
-drop table if exists t027t01;
-drop table if exists t027t011;
-drop table t027t02;
-drop table t027t03;
+obey TEST027(clean_up);
 
 log LOG027 clear;
 
@@ -210,7 +208,7 @@ invoke t027t7;
 select * from t027t7;
 
 -- aligned format
-drop table if exists t027t7;
+drop table if exists t027t7 cascade;
 create table t027t7(a int not null, b varchar(2), 
    c varchar(4) character set utf8 not null, z int not null primary key)
 salt using 2 partitions attribute aligned format;
@@ -229,15 +227,90 @@ select * from t027t7;
 alter table t027t7 drop column b;
 invoke t027t7;
 select * from t027t7;
+create view t027v1 as select * from t027t7;
+get all views on table t027t7;
+invoke t027v1;
+alter table t027t7 alter column a smallint;
+invoke t027v1;
 
 -- negative tests for alter/drop column
 alter table t027t7 alter column b int;
 alter table t027t7 alter column a char(10);
 alter table t027t7 alter column c char(1);
 alter table t027t7 drop column e;
+alter table t027t7 drop column a;
+alter table t027v1 alter column a smallint;
+get all views on table t027t7;
+
+-- tests for alter column rename
+drop table if exists t027t7 cascade;
+create table t027t7(a int not null, b varchar(2), 
+   c varchar(4) character set utf8 not null, z int not null primary key)
+salt using 2 partitions;
+create index t027t7i1 on t027t7(b);
+insert into t027t7 values (1, 'ab', 'cd', 10);
+invoke t027t7;
+select * from t027t7;
+alter table t027t7 alter column b rename to bb;
+invoke t027t7;
+select * from t027t7;
+alter table t027t7 alter column z rename to zz;
+invoke t027t7;
+select * from t027t7;
+create view t027v1(zz) as select zz from t027t7;
+alter table t027t7 alter column c rename to cc;
+create view t027v2(zz) as select zz from t027t7 where cc = 'a';
+showddl t027v2;
+
+-- negative tests for alter column rename
+alter table t027t7 alter column zz rename to a;
+alter table t027t7 alter column "_SALT_" rename to nosalt;
+alter table t027t7 alter column cc rename to "_SALT_";
+alter table t027t7 alter column zz rename to zzz;
+alter table t027t7 alter column cc rename to ccc;
+
+-- alter col with views
+drop table if exists t027t7 cascade;
+create table t027t7 (a varchar(10), b int);
+create view t027v1 as select * from t027t7;
+create view t027v12 as select * from t027v1;
+create view t027v11 as select * from t027t7;
+create view t027v122 as select * from t027v12;
+create view t027v113 as select * from t027v11;
+get all views on table t027t7;
+alter table t027t7 alter column a varchar(20);
+get all views on table t027t7;
+
+-- some alter operations cannot be performed within a user xn
+cqd ddl_transactions 'ON';
+begin work;
+alter table t027t7 drop column b;
+rollback work;
+begin work;
+alter table t027t7 alter column b largeint;
+rollback work;
+
+-- reserved words cannot be used as colnames in create/add/alter stmts
+drop table if exists t027t7 cascade;
+create table t027t7 (syskey int);
+create table t027t7 ("_SALT_" int);
+create table t027t7 ("_DIVISION_2_" int);
+create table t027t7 (a int not null primary key);
+alter table t027t7 add column "_SALT_" int;
+alter table t027t7 alter column a rename to SYSKEY;
+
+-- if cqd is specified, then reserved cols can be used. 
+-- Use this cqd carefully.
+cqd traf_allow_reserved_colnames 'ON';
+drop table if exists t027t7 cascade;
+create table t027t7 (syskey int not null primary key, b int);
+alter table t027t7 add column "_DIVISION_1" int;
+alter table t027t7 alter column b rename to "_SALT_";
+invoke t027t7;
 
 -- cleanup
-drop table if exists t027t7;
+?section clean_up
+drop table if exists t027t7 cascade;
 drop table if exists t027t01;
 drop table if exists t027t02;
 drop table if exists t027t011;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/TEST030
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST030 b/core/sql/regress/seabase/TEST030
new file mode 100644
index 0000000..62d5a0b
--- /dev/null
+++ b/core/sql/regress/seabase/TEST030
@@ -0,0 +1,117 @@
+-- @@@ 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 @@@
+--
+
+-- tests for TO_DATE, TO_CHAR, TO_TIMESTAMP, TO_NUMBER functions
+
+log LOG030 clear;
+
+select to_date('2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+select to_date('03/01/2016', 'MM/DD/YYYY') from (values(1)) x(a);
+select to_date('01.03.2016', 'DD.MM.YYYY') from (values(1)) x(a);
+select to_date('2016-03', 'YYYY-MM') from (values(1)) x(a);
+select to_date('2016/03/01', 'YYYY/MM/DD') from (values(1)) x(a);
+select to_date('20160301', 'YYYYMMDD') from (values(1)) x(a);
+select to_date('16/03/01', 'YY/MM/DD') from (values(1)) x(a);
+select to_date('03/01/16', 'MM/DD/YY') from (values(1)) x(a);
+select to_date('03-01-2016', 'MM-DD-YYYY') from (values(1)) x(a);
+select to_date('201603', 'YYYYMM') from (values(1)) x(a);
+select to_date('01-03-2016', 'DD-MM-YYYY') from (values(1)) x(a);
+select to_date('01-MAR-2016', 'DD-MON-YYYY') from (values(1)) x(a);
+select to_date('01MAR2016', 'DDMONYYYY') from (values(1)) x(a);
+select to_date('20160301101112', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+select to_date('01.03.2016:10:11:12', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+select to_date('2016-03-01 10:11:12', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+select to_date('03/01/2016 10:11:12', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+select to_date('01-MAR-2016 10:11:12', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+select to_date('March 01, 2016, 10:11', 'MONTH DD, YYYY, HH:MI') from (values(1)) x(a);
+select to_date ('10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+select to_date ('10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+select to_time ('10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+select to_time ('10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+
+select to_char(DATE '2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'MM/DD/YYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DD.MM.YYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYY-MM') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYY/MM/DD') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYYMMDD') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YY/MM/DD') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'MM/DD/YY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'MM-DD-YYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYYMM') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DD-MM-YYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DD-MON-YYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DDMONYYYY') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+select to_char(DATE '2016-03-01', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYYMMDDHH24MISS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYY-MM-DD HH24:MI:SS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'MM/DD/YYYY HH24:MI:SS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'DD-MON-YYYY HH:MI:SS') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'MONTH DD, YYYY, HH:MI') from (values(1)) x(a);
+select to_char (time '10:23:34', 'HH24:MI:SS') from (values(1)) x(a);
+select to_char (time '10:23:34', 'HH:MI:SS') from (values(1)) x(a);
+
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'YYYY-MM-DD') from (values(1)) x(a);
+select to_char(TIMESTAMP '2016-03-01 10:11:12', 'HH:MI:SS') from (values(1)) x(a);
+
+select dateformat(time '10:11:12.1', default) from (values(1)) x(a);
+select dateformat(time '10:11:12.123', usa) from (values(1)) x(a);
+select dateformat(time '10:11:12', european) from (values(1)) x(a);
+select dateformat(timestamp '2016-03-01 10:11:12.1', default) from (values(1)) x(a);
+select dateformat(timestamp '2016-03-01 10:11:12', usa) from (values(1)) x(a);
+select dateformat(timestamp '2016-03-01 10:11:12.123', european) from (values(1)) x(a);
+
+drop table if exists t030t1;
+create table t030t1 (a date, b char(30), c varchar(30));
+insert into t030t1 values (date '2016-03-01', '2016-03-01', '2016-03-01');
+
+select to_char(a, 'YYYYMMDD') from t030t1;
+select a (date, format 'YYYYMMDD') from t030t1;
+select to_date(b, 'YYYY-MM-DD') from t030t1;
+select to_date(c, 'YYYY-MM-DD') from t030t1;
+
+-- negative tests
+select to_date('2016-03-01', 'YYYYMM-DD') from (values(1)) x(a);
+select to_date(DATE '2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+select to_date('0103.2016', 'DD.MM.YYYY') from (values(1)) x(a);
+select to_char('2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
+select to_date(20160301, 'YYYYMMDD') from (values(1)) x(a);
+select to_char(date '2016-03-01', 'HH:MI:SS') from (values(1)) x(a);
+
+-- some formats only enabled in special mode. Not externalized.
+cqd mode_special_4 'ON';
+select to_date(20160301, 'YYYYMMDD') from (values(1)) x(a);
+select to_date(12345678, '99:99:99:99') from (values(1)) x(a);
+select to_date(-12345678, '-99:99:99:99') from (values(1)) x(a);
+
+-- ms4 error cases
+select to_date(123456789, '99:99:99:99') from (values(1)) x(a);
+select to_date(-12345678, '99:99:99:99') from (values(1)) x(a);
+select to_date(1e0, '99:99:99:99') from (values(1)) x(a);
+select to_date(1.2, '99:99:99:99') from (values(1)) x(a);
+
+log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/TEST031
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST031 b/core/sql/regress/seabase/TEST031
new file mode 100644
index 0000000..5265339
--- /dev/null
+++ b/core/sql/regress/seabase/TEST031
@@ -0,0 +1,108 @@
+-- @@@ 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 @@@
+--
+
+-- tests for various misc fixes
+
+log LOG031 clear;
+
+-- tests for PRIMARY KEY constraint usage
+drop table if exists t031t1;
+create table t031t1 (a int not null, b int not null, constraint ppk primary key(a));
+alter table t031t1 add constraint ppk primary key(b);
+alter table t031t1 add constraint ppk2 primary key(b);
+alter table t031t1 add constraint ppk unique(b);
+alter table t031t1 drop constraint ppk;
+
+drop table if exists t031t1;
+create table t031t1 (a int not null, b int not null);
+alter table t031t1 add constraint ppk primary key(a);
+alter table t031t1 add constraint ppk primary key(b);
+alter table t031t1 add constraint ppk2 primary key(b);
+alter table t031t1 add constraint ppk unique(b);
+alter table t031t1 drop constraint ppk;
+
+drop table if exists t031t1;
+create table t031t1 (a int not null, b int not null) store by (a);
+alter table t031t1 add constraint ppk primary key(a);
+alter table t031t1 add constraint ppk unique(b);
+alter table t031t1 drop constraint ppk;
+
+drop table if exists t031t1;
+create table t031t1 (a int not null primary key, b int not null);
+alter table t031t1 add constraint ppk primary key(a);
+alter table t031t1 add constraint ppk primary key(b);
+
+-- primary key update transformed into delete/insert incorrectly 
+-- deletes row after conflict
+create table if not exists t031t1 (a int not null primary key, b int not null);
+delete from t031t1;
+insert into t031t1 values (1,1), (2,2), (3,3), (4,4);
+update t031t1 set a = 4 where a = 2;
+select * from t031t1;
+
+-- incorrect ddl with salt clause should not crash
+drop table if exists t031t1;
+create table t031t1 (
+T2C1 int not null not droppable,
+T2C1 int not null not droppable,
+T2C1 int)
+salt using 2 partitions on (T2C1, T2C2)
+store by (T2C1, T2C2);
+
+-- cannot rename table with check constraints.
+-- cascade option with rename not supported.
+drop table if exists t031t1;
+create table t031t1 (a int);
+alter table t031t1 add constraint t031t1_c1 check (a > 0);
+alter table t031t1 rename to t031t1_ren cascade;
+alter table t031t1 rename to t031t1_ren;
+
+-- time datatype conversion was returning incorrect results
+drop table if exists t031t1;
+create table t031t1
+(id int not null,
+time1 time default null,
+time2 time default null,
+type1 time default null,
+type2 char(5) default null,
+diff char(6) default null,
+primary key (id));
+insert into t031t1 (id, time1, time2, diff) values (1, time '00:00:30.758788', time '00:00:29.615308', 'MATCH');
+select * from t031t1 order by 1;
+update t031t1
+set type1 =
+case when (time1 + interval '1' second) < time2 then time1 else time2
+end,
+type2 =
+case when (time1 + interval '1' second) < time2 then 'T1' else 'T2'
+end
+where id = 1;
+select
+type2, diff, type1,
+case
+when diff = 'MATCH' then 'PASS' else 'FAIL'
+end
+from t031t1
+where id = 1;
+select * from t031t1;
+
+log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/tools/dll-compile.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/dll-compile.ksh b/core/sql/regress/tools/dll-compile.ksh
index e4ae68f..cf6a522 100755
--- a/core/sql/regress/tools/dll-compile.ksh
+++ b/core/sql/regress/tools/dll-compile.ksh
@@ -66,12 +66,12 @@ TARGET=
     fi
   CC_OPTS="-g "
   CC_OPTS="$CC_OPTS -I$MY_SQROOT/sql/sqludr"
-  CC_OPTS="$CC_OPTS -I$MY_SQROOT/export/include/sql  -I$MY_SQROOT/export/include/nsk -I${TOOLSDIR}/${HADOOP_DIST}/${HADOOP_INC_DIR} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux"
+  CC_OPTS="$CC_OPTS -I$MY_SQROOT/export/include/sql  -I$MY_SQROOT/export/include/nsk -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux"
   CC_OPTS="$CC_OPTS -w -O0 -Wno-unknown-pragmas -fPIC -fshort-wchar -c -o $BASE.o $1"
   TARGET=$BASE.dll
   LD=$CC
   LD_OPTS=" -w -O0 -Wno-unknown-pragmas -fshort-wchar"
-  LD_OPTS="$LD_OPTS -shared -rdynamic -o $TARGET -lc -lhdfs -ljvm -L$MY_SQROOT/export/lib${SQ_MBTYPE} -ltdm_sqlcli -L${TOOLSDIR}/${HADOOP_DIST}/${HADOOP_LIB_DIR} -L${JAVA_HOME}/jre/lib/amd64/server $2 $BASE.o"
+  LD_OPTS="$LD_OPTS -shared -rdynamic -o $TARGET -lc -lhdfs -ljvm -L$MY_SQROOT/export/lib${SQ_MBTYPE} -ltdm_sqlcli -L${JAVA_HOME}/jre/lib/amd64/server $2 $BASE.o"
 
 LONGLINE=\
 ------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/tools/runregr_udr.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_udr.ksh b/core/sql/regress/tools/runregr_udr.ksh
index 45904a0..9fe4994 100755
--- a/core/sql/regress/tools/runregr_udr.ksh
+++ b/core/sql/regress/tools/runregr_udr.ksh
@@ -53,22 +53,6 @@ if [ $NSK -eq 1 -o $LINUX -eq 1 ]; then
   USE_NDCS=1
 fi
 
-#
-# getJavaCompFuncs contains functions to display vprocs for Java
-# components on NSK only. Here we simply load the shell functions that
-# do the work. The functions will be called later.
-#
-typeset -i DISPLAY_NSK_JAVA_COMPS=0
-if [ $NSK -ne 0 -a "$SKIP_JAVA_CHECKS" != "" ]; then
-  if [ -s $scriptsdir/tools/getJavaCompFuncs ]; then
-    . $scriptsdir/tools/getJavaCompFuncs
-    DISPLAY_NSK_JAVA_COMPS=1
-  else
-    echo "\n*** WARNING: Unable to locate $scriptsdir/tools/getJavaCompFuncs"
-    echo "*** Continuing"
-  fi
-fi
-
 function USAGE
 {
     cat <<EOF
@@ -183,25 +167,8 @@ function PRINT_SKIP_FILES
 
 function PRINT_JAVA_COMPONENTS
 {
-  if [ $DISPLAY_NSK_JAVA_COMPS -eq 1 ]; then
-
-    HEADER "Java components"
-
-    getJdbcMxJarComp v
-    getJavaComp T0083 v
-    getJavaComp T1225 v
-    getLMComp v
-    getMxServerComp MXUDR T0083 v
-    getMxServerComp MXUDR T1225 v
-    getMxServerComp MXUDR T1231 v
-
-    testJdbcInJavaAndUdrServer
-    testJdbcAndUdrServer
-    testJavaAndUdrServer
-    testJdbcInJarAndJava
-    testLMInJarAndUdrServer
-
-  fi
+  # empty for now
+  true
 }
 
 # TESTS that make a JDBC Connection. These tests need ODBC assoc server
@@ -366,8 +333,6 @@ typeset TESTFILES="$*"
 TESTFILES=`echo $TESTFILES | tr a-z A-Z`
 if [ "$TESTFILES" = "" ]; then
   TESTFILES="TEST???"
-else
-  DISPLAY_NSK_JAVA_COMPS=0
 fi
 PRETTY_FILES "$TESTFILES"
 TESTFILES="$PFILES"
@@ -481,7 +446,7 @@ done
 seabase="$SEABASE_REGRESS"
 # sbtestfiles contains the list of tests to be run in seabase mode
 if [ "$seabase" -ne 0 ]; then
-  TESTFILES="TEST001 TEST002 TEST100 TEST101 TEST107 TEST108 TEST163"
+  TESTFILES="TEST001 TEST002 TEST100 TEST101 TEST102 TEST107 TEST108 TEST163"
   SBPFILES=
   for i in $PFILES; do
     for j in $TESTFILES; do
@@ -613,7 +578,7 @@ function DO_DIFF
     if [ $OK -eq 0 ]; then
 	RESULT="### FAIL (missing files) ###"
 	printf "\n$RESULT\n"
-	printf "$(date '+%m/%d/%Y %R')    $T\t  $RESULT\n" >> $rgrlog
+	printf "$(date '+%m/%d/%Y %R')  $T  $RESULT\n" >> $rgrlog
 	return
     fi
 
@@ -744,7 +709,7 @@ function DO_DIFF
 #    printf "$RESULT\n"
 #    printf "$(date '+%m/%d/%Y %R')    $T\t  $RESULT\n" >> $rgrlog
     modtime=`stat --printf=%y $LOG | cut -d'.' -f1`
-    printf "$modtime    $T\t  $RESULT\n" >> $rgrlog
+    printf "$modtime  $T  $RESULT\n" >> $rgrlog
 }
 
 function DO_TEST
@@ -760,12 +725,6 @@ function DO_TEST
        fi
     fi
 
-    # On NSK and LINUX, set CLASSPATH. If tests use a JDBC application,
-    # CLASSPATH should have JDBC jar.
-    if [ $NSK -ne 0 ]; then
-      export CLASSPATH=$SQLMX_JAVA_EXTENSIONS:$CLASSPATH:.
-    fi
-
     # create a tempfile which is used as timestamp for deleting
     # saveabend files after the test completes
     touch TimestampFile
@@ -835,26 +794,10 @@ echo "schema=$TEST_SCHEMA" >schema.prop
 
 echo "$(date '+%m/%d/%Y %R')" >> $rgrlog
 
-# Following export is to workaround an MXCI problem where
-# mxci crashes when a command such as  set envvar X '$x:abc' used and
-# x is not defined.
-#
-# _RLD_LIB_PATH is not used on MIPS and 'set envvar' crashes mxci. Right now
-# there is no way to differentiate between MIPS and YOS from mxci prompt.
-# So we are adding this workaround in this shell script.
-#
-if [ $NSK -ne 0 -a `uname -r` != H06 ]; then
-  export _RLD_LIB_PATH=/G/system/system
-fi
-
-if [ $LINUX -ne 0 ]; then
-   export CLASSPATH=$MY_SQROOT/export/lib/hpt4jdbc.jar:$CLASSPATH:.
-fi
-
 export JDBC_T4_URL="jdbc:t4jdbc://localhost:23400/:"
-if [ -r $MY_SQROOT/sql/scripts/swenv.sh ]; then
+if [ -r $MY_SQROOT/sql/scripts/sw_env.sh ]; then
   # use a custom port for the JDBC Type 4 driver
-  . $MY_SQROOT/sql/scripts/swenv.sh
+  . $MY_SQROOT/sql/scripts/sw_env.sh
   export JDBC_T4_URL="jdbc:t4jdbc://localhost:${MY_DCS_MASTER_PORT}/:"
 fi
 
@@ -885,7 +828,7 @@ do
              TEST_CAN_BE_RUN=0
 	     RESULT="### FAIL (!! Test SKIPPED because NDCS SETUP is NOT RIGHT !! ) ###"
 	     printf "\n$RESULT\n"
-	     printf "$(date '+%m/%d/%Y %R')    $T\t  $RESULT\n" >> $rgrlog
+	     printf "$(date '+%m/%d/%Y %R')  $T  $RESULT\n" >> $rgrlog
 	     break;
            fi
         done


[30/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index 3fd854e..72fa71f 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -77,6 +77,9 @@
 #include "ItemFuncUDF.h"
 #include "CmpSeabaseDDL.h"
 #include "QCache.h"
+
+#include "exp_datetime.h"
+
 #include <stack>
 
 
@@ -1236,6 +1239,7 @@ Int32 ItemExpr::shouldPushTranslateDown(CharInfo::CharSet chrset) const
      case ITM_CAST:                  // a) output is of a specific charset
      case ITM_CAST_CONVERT:          // a) internal node, too late to do ICAT
      case ITM_CAST_TYPE:
+     case ITM_DATEFORMAT:
        return -1;
 
      case ITM_LEFT:                  // b) counts characters
@@ -3708,19 +3712,10 @@ ItemExpr * ExtractOdbc::bindNode(BindWA * bindWA)
   return ie ;
 }
 
-ItemExpr * Format::bindNode(BindWA * bindWA)
+ItemExpr * DateFormat::quickDateFormatOpt(BindWA * bindWA)
 {
-  //  if (nodeIsBound()) 
-  //    return this;
-
-  bindSelf(bindWA);
-  if (bindWA->errStatus()) 
-    return this;
-
   const NAType *naType0 = &child(0)->getValueId().getType();
-  const NumericType * nType0 = NULL;
 
-  // a quick optimization for the date format.
   if ((CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON) &&
       (child(0)->getOperatorType() == ITM_CONSTANT) &&
       (formatStr_ == "DD-MON-YYYY") &&
@@ -3801,188 +3796,29 @@ ItemExpr * Format::bindNode(BindWA * bindWA)
       bindWA->resetErrStatus();
     }
 
+  return NULL;
+}
+
+ItemExpr * Format::bindNode(BindWA * bindWA)
+{
+  bindChildren(bindWA);
+  if (bindWA->errStatus()) 
+    return this;
+
+  const NAType *naType0 = &child(0)->getValueId().getType();
+  const NumericType * nType0 = NULL;
 
-  Int32 dateFormat = DateFormat::DEFAULT;
-  NABoolean formatAsDate = FALSE;
   NABoolean formatX = FALSE;
   NABoolean format9 = FALSE;
   NABoolean formatExtract = FALSE;
   Lng32 dotPos = 0;
   NABoolean formatNumericAsX = FALSE;
   NABoolean formatStringAsX  = FALSE;
-  if ((formatStr_ == "YYYY-MM-DD") ||
-      (formatStr_ == "MM/DD/YYYY") ||
-      (formatStr_ == "YY/MM/DD") ||
-      (formatStr_ == "YYYY/MM/DD") ||
-      (formatStr_ == "MM/DD/YY") ||
-      (formatStr_ == "YYYYMMDD") ||
-      (formatStr_ == "DD.MM.YYYY") ||
-      (formatStr_ == "DD-MM-YYYY") ||
-      (formatStr_ == "DD-MMM-YYYY") ||
-      (formatStr_ == "DD-MON-YYYY") ||
-      (formatStr_ == "DDMONYYYY") ||
-      (formatStr_ == "YYYYMMDDHH24MISS") ||
-      (formatStr_ == "YYYYMMDD:HH24:MI:SS") ||
-      (formatStr_ == "DD.MM.YYYY:HH24:MI:SS") ||
-      (formatStr_ == "YYYY-MM-DD HH24:MI:SS") ||
-      (formatStr_ == "MMDDYYYY HH24:MI:SS") ||
-      (formatStr_ == "MM/DD/YYYY HH24:MI:SS") ||
-      (formatStr_ == "DD-MON-YYYY HH:MI:SS") ||
-      (formatStr_ == "HH24:MI:SS") ||
-      (formatStr_ == "YYYYMM") ||
-      (formatStr_ == "YYYY-MM") ||
-      (formatStr_ == "SYYYYMM") ||
-      (formatStr_ == "MM-DD-YYYY"))
-    {
-      if (formatType_ == FORMAT_TO_CHAR)
-	{
-	  if (naType0->getTypeQualifier() != NA_DATETIME_TYPE)
-	    {
-	      *CmpCommon::diags() << DgSqlCode(-4071) << DgString0("TO_CHAR");
-	      bindWA->setErrStatus();
-	      return this;
-	    }
-
-	  if ((formatStr_ == "HH24:MI:SS") &&
-	      (naType0->getPrecision() != SQLDTCODE_TIMESTAMP) &&
-	      (naType0->getPrecision() != SQLDTCODE_TIME))
-	    {
-	      *CmpCommon::diags() << DgSqlCode(-4072) << DgString0("TO_CHAR") << DgString1("time");;
-	      bindWA->setErrStatus();
-	      return this;
-	    }
-	}
-
-      if ((formatType_ == FORMAT_TO_DATE) &&
-	  ((naType0->getTypeQualifier() != NA_CHARACTER_TYPE) &&
-	   (naType0->getTypeQualifier() != NA_NUMERIC_TYPE)))
-	{
-	  *CmpCommon::diags() << DgSqlCode(-4043) << DgString0("TO_DATE");
-	  bindWA->setErrStatus();
-	  return this;
-	}
-      
-      if ((naType0->getTypeQualifier() == NA_CHARACTER_TYPE) &&
-          (formatCharToDate_ == FALSE))
-	{
-	  *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
-			      << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
-					   : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
-	  
-	  bindWA->setErrStatus();
-	  return this;
-	}
-      
-      if (((formatStr_ == "YYYYMMDDHH24MISS") ||
-	   (formatStr_ == "YYYYMMDD:HH24:MI:SS") ||
-	   (formatStr_ == "DD.MM.YYYY:HH24:MI:SS") ||
-	   (formatStr_ == "YYYY-MM-DD HH24:MI:SS") ||
-	   (formatStr_ == "MMDDYYYY HH24:MI:SS") ||
-	   (formatStr_ == "MM/DD/YYYY HH24:MI:SS") ||
-	   (formatStr_ == "HH24:MI:SS") ||
-	   (formatStr_ == "MM/DD/YY") ||
-	   (formatStr_ == "YYYYMM") ||
-	   (formatStr_ == "YYYY-MM") ||
-	   (formatStr_ == "SYYYYMM") ||
-	   (formatStr_ == "DDMONYYYY") ||
-	   (formatStr_ == "MM-DD-YYYY")) &&
-	  (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_OFF))
-	{
-	  *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
-			      << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
-					   : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
-	  bindWA->setErrStatus();
-	  return this;
-	}
-
-      if (formatStr_ == "SYYYYMM")
-	formatStr_ = "YYYYMM";
-
-      NAString newStr;
-      if (((formatStr_ == "YYYYMM") ||
-	   (formatStr_ == "YYYY-MM")) &&
-	  (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON) &&
-	  (formatCharToDate_) &&
-	  (naType0->getTypeQualifier() == NA_NUMERIC_TYPE))
-	{
-	  // currently only supports formatting of a numeric constant string literal
-	  // of the form '200906'. Missing day is filled with value '01' and
-	  // a new constant is added as child(0).
-	  ConstValue * cv = (ConstValue *)child(0)->castToItemExpr();
-	  if ((cv->getOperatorType() != ITM_CONSTANT) ||
-	      (NOT cv->canGetExactNumericValue()))
-	    {
-	      *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
-				  << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
-					       : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
-	      bindWA->setErrStatus();
-	      return this;
-	    }
-
-	  Lng32 val = (Lng32)cv->getExactNumericValue();
-	  char nBuf[40];
-	  sprintf(nBuf, "%d", val);
-	  newStr = nBuf;
-	  
-	  ConstValue *newChild = 
-	    new (bindWA->wHeap()) ConstValue(newStr, bindWA->wHeap());
-	  setChild(0, newChild->bindNode(bindWA));
-	  
-	  naType0 = &child(0)->getValueId().getType();
-	} // if YYYYMM
-
-      if (naType0->getTypeQualifier() == NA_NUMERIC_TYPE)
-	{
-	  if (formatCharToDate_ == FALSE)
-	    {
-	      *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
-				  << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
-					       : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
-	      bindWA->setErrStatus();
-	      return this;
-	    }
-	  
-	  // convert number to char before formatting.
-	  // Length of target char is equal to formatStr_.
-	  ItemExpr * newChild =
-	    new (bindWA->wHeap())
-	    Cast(child(0),
-		 new (bindWA->wHeap())
-		 SQLChar(formatStr_.length(),
-			 child(0)->castToItemExpr()->
-			 getValueId().getType().supportsSQLnull()));
-	  setChild(0, newChild->bindNode(bindWA));
-	  naType0 = &child(0)->getValueId().getType();
-	}
-      
-      if ((CmpCommon::getDefault(MODE_SPECIAL_2) == DF_OFF) &&
-	  (formatCharToDate_ == FALSE) &&
-	  (naType0->getTypeQualifier() != NA_DATETIME_TYPE)) 
-	{
-	  // 4071 The operand of a DATEFORMAT function must be a datetime.
-	  *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
-	  return NULL;
-	}
-
-      formatAsDate = TRUE;
-      if ((formatStr_ == "YYYYMMDDHH24MISS") ||
-	  (formatStr_ == "YYYYMMDD:HH24:MI:SS") ||
-	  (formatStr_ == "DD.MM.YYYY:HH24:MI:SS") ||
-	  (formatStr_ == "YYYY-MM-DD HH24:MI:SS") ||
-	  (formatStr_ == "MMDDYYYY HH24:MI:SS") ||
-	  (formatStr_ == "MM/DD/YYYY HH24:MI:SS") ||
-          (formatStr_ == "DD-MON-YYYY HH:MI:SS"))
-	dateFormat = DateFormat::TIMESTAMP_FORMAT_STR;
-      else if (formatStr_ == "HH24:MI:SS")
-	dateFormat = DateFormat::TIME_FORMAT_STR;
-      else
-	dateFormat = DateFormat::DATE_FORMAT_STR;
-    }
 
-  else if ((formatStr_ == "HH24") ||
-           (formatStr_ == "D") ||
-           (formatStr_ == "MM") ||
-           (formatStr_ == "YYYY"))
+  if ((formatStr_ == "HH24") ||
+      (formatStr_ == "D") ||
+      (formatStr_ == "MM") ||
+      (formatStr_ == "YYYY"))
     {
       if (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_OFF)
         {
@@ -4011,22 +3847,6 @@ ItemExpr * Format::bindNode(BindWA * bindWA)
       
       formatExtract = TRUE;
     }
-
-  else if ((formatStr_ == "99:99:99:99") ||
-	   (formatStr_ == "-99:99:99:99"))
-    {
-      if (naType0->getTypeQualifier() == NA_NUMERIC_TYPE)
-	{
-	  formatAsDate = TRUE;
-	  dateFormat = DateFormat::TIME_FORMAT_STR;
-	}
-      else
-	{
-	  *CmpCommon::diags() << DgSqlCode(-4045) << DgString0("FORMAT");
-	  bindWA->setErrStatus();
-	  return this;
-	}
-    }
   else
     {
       formatX = TRUE;
@@ -4073,88 +3893,7 @@ ItemExpr * Format::bindNode(BindWA * bindWA)
     }
 
   ItemExpr * newIE= NULL;
-  if (formatAsDate)
-    {
-      ConstValue * cv = new(bindWA->wHeap()) SystemLiteral(formatStr_);
-
-      if ((dateFormat == DateFormat::TIME_FORMAT_STR) &&
-	  (formatStr_ != "HH24:MI:SS"))
-	{
-	  if (naType0->getTypeName() != LiteralLargeInt)
-	    {
-	      // convert to largeint. We have already verified that
-	      // child is exact with scale of 0.
-	      ItemExpr * newChild =
-		new (bindWA->wHeap())
-		Cast(child(0),
-		     new (bindWA->wHeap())
-		     SQLLargeInt(TRUE,
-				 child(0)->castToItemExpr()->
-				 getValueId().getType().supportsSQLnull()));
-	      setChild(0, newChild->bindNode(bindWA));
-	    }
-	}
-
-      ItemExpr * newChild = NULL;
-	  
-      if ((CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON) &&
-	  (formatCharToDate_ == FALSE) &&
-	  (naType0->getPrecision() == SQLDTCODE_TIMESTAMP))
-	{
-	  if (formatStr_ == "HH24:MI:SS")
-	    {
-	      newChild =
-		new (bindWA->wHeap())
-		Cast(child(0),
-		     new (bindWA->wHeap())
-		     SQLTime(child(0)->castToItemExpr()->
-			     getValueId().getType().supportsSQLnull(),
-			     0));
-	    }
-	  else if ((formatStr_ == "YYYYMMDDHH24MISS") ||
-		   (formatStr_ == "YYYYMMDD:HH24:MI:SS") ||
-		   (formatStr_ == "DD.MM.YYYY:HH24:MI:SS") ||
-		   (formatStr_ == "YYYY-MM-DD HH24:MI:SS") ||
-		   (formatStr_ == "MMDDYYYY HH24:MI:SS") ||
-		   (formatStr_ == "MM/DD/YYYY HH24:MI:SS") ||
-                   (formatStr_ == "DD-MON-YYYY HH:MI:SS"))
-	    {
-	      // do nothing
-	    }
-	  else 
-	    {
-	      newChild =
-		new (bindWA->wHeap())
-		Cast(child(0),
-		     new (bindWA->wHeap())
-		     SQLDate(child(0)->castToItemExpr()->
-			     getValueId().getType().supportsSQLnull()));
-	    }
-	    
-	  if (newChild)
-	    setChild(0, newChild->bindNode(bindWA));
-	}
-
-      naType0 = &child(0)->getValueId().getType();
-      if (DFS2REC::isAnyVarChar(naType0->getFSDatatype()))
-	{
-	  // convert to fixed char.
-	  newChild =
-	    new (bindWA->wHeap())
-	    Cast(child(0),
-		 new (bindWA->wHeap())
-		 SQLChar(naType0->getNominalSize(),
-			 naType0->supportsSQLnull()));
-	  setChild(0, newChild->bindNode(bindWA));
-	}
-
-      newIE=
-	new (bindWA->wHeap()) DateFormat(child(0), cv, dateFormat);
-      newIE = newIE->bindNode(bindWA);
-      if (bindWA->errStatus())
-	return NULL;
-    }
-  else if ((formatX) || (format9) || (formatExtract))
+  if ((formatX) || (format9) || (formatExtract))
     {
       Parser parser(bindWA->currentCmpContext());
       char buf[200];
@@ -4240,21 +3979,277 @@ ItemExpr * Format::bindNode(BindWA * bindWA)
   else
     {
       if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_OFF)
-      {
-        *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
-			  << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
-				       : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
-        bindWA->setErrStatus();
-        return this;
-      }
-
+        {
+          *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
+                              << DgString1(formatType_ == FORMAT_GENERIC ? "FORMAT" 
+                                           : (formatType_ == FORMAT_TO_CHAR ? "TO_CHAR" : "TO_DATE"));
+          bindWA->setErrStatus();
+          return this;
+        }
+      
       // In mode_special_1, ignore this format and return the child pointer.
       newIE = child(0);
     }
-
+  
   return newIE;
 }
 
+///////////////////////////////////////////////////////
+// various error checks, details below.
+//////////////////////////////////////////////////////
+NABoolean DateFormat::errorChecks(Lng32 frmt, BindWA *bindWA, 
+                                  const NAType* opType)
+{
+  Lng32 error = 0;
+
+  NABoolean tc  = (formatType_ == FORMAT_TO_CHAR);
+  NABoolean td  = (formatType_ == FORMAT_TO_DATE);
+  NABoolean df  = ExpDatetime::isDateFormat(frmt);
+  NABoolean tf  = ExpDatetime::isTimeFormat(frmt);
+  NABoolean tsf = ExpDatetime::isTimestampFormat(frmt);
+  NABoolean nf  = ExpDatetime::isNumericFormat(frmt);
+  NABoolean ms4 = (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON);
+  
+  if (NOT (df || tf || tsf || nf))
+    {
+      // format must be date, time, timestamp or numeric
+      error = 1; // error 4065
+    }
+  else if ((NOT ms4) && nf)
+    {
+      // format can only be numeric in mode_special_4
+      error = 1; // error 4065
+    }
+
+  if (!error && tc)
+    {
+      // source must be datetime with to_char function
+      if (opType->getTypeQualifier() != NA_DATETIME_TYPE)
+        error = 2; // error 4071
+
+      // cannot convert date source to time format
+      else if (tf && (opType->getPrecision() == SQLDTCODE_DATE))
+        error = 3; // error 4072
+    }
+
+  if (!error && td)
+    {
+      // source must be char or numeric with to_date
+      if ((opType->getTypeQualifier() != NA_CHARACTER_TYPE) &&
+          (opType->getTypeQualifier() != NA_NUMERIC_TYPE))
+        error = 4; //error 4043
+
+      // source can only be numeric in mode_special_4
+      else if ((NOT ms4) && (opType->getTypeQualifier() != NA_CHARACTER_TYPE))
+        error = 4; // error 4043
+
+      // operand must be numeric with nf (numeric format)
+      else if (ms4 && nf && (opType->getTypeQualifier() != NA_NUMERIC_TYPE))
+        {
+          error = 7; // error 4045
+        }
+
+      // numeric must be exact with scale of 0
+      else if (ms4 && (opType->getTypeQualifier() == NA_NUMERIC_TYPE))
+        {
+          if (NOT ((NumericType*)opType)->isExact())
+            error = 5; // error 4046
+          else if (NOT ((NumericType*)opType)->getScale() == 0)
+            error = 6; // error 4047
+        }
+    }
+
+  if (error)
+    {
+      switch (error)
+        {
+        case 1: 
+          {
+            *CmpCommon::diags() << DgSqlCode(-4065) << DgString0(formatStr_)
+                                << DgString1((formatType_ == FORMAT_TO_CHAR
+                                              ? "TO_CHAR" : "TO_DATE"));
+            bindWA->setErrStatus();
+          }
+          break;
+
+        case 2:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4071) << DgString0("TO_CHAR");
+            bindWA->setErrStatus();
+          }
+          break;
+
+        case 3:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4072) << DgString0("TO_CHAR") << DgString1("time");;
+            bindWA->setErrStatus();
+          }
+          break;
+
+        case 4:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4043) << DgString0("TO_DATE");
+            bindWA->setErrStatus();
+          }
+          break;
+          
+        case 5:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4046) << DgString0("TO_DATE");
+            bindWA->setErrStatus();
+          }
+          break;
+          
+        case 6:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4047) << DgString0("TO_DATE");
+            bindWA->setErrStatus();
+          }
+          break;
+
+        case 7:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4045) << DgString0("TO_DATE");
+            bindWA->setErrStatus();
+          }
+          break;
+
+        } // switch
+
+      return TRUE;
+    }
+  
+  return FALSE;
+}
+
+// used for TO_DATE, TO_CHAR, TO_TIME, DATEFORMAT functions.
+DateFormat::DateFormat(ItemExpr *val1Ptr, const NAString &formatStr,
+                       Lng32 formatType, NABoolean wasDateformat)
+     : CacheableBuiltinFunction(ITM_DATEFORMAT,
+                                1, val1Ptr),
+       formatStr_(formatStr),
+       wasDateformat_(wasDateformat),
+       formatType_(formatType),
+       frmt_(-1),
+       dateFormat_(DATE_FORMAT_NONE)
+{ 
+  allowsSQLnullArg() = FALSE; 
+
+  if (formatStr_ == "SYYYYMM")
+    formatStr_ = "YYYYMM";
+  else if (formatStr_ == "HH:MI:SS")
+    formatStr_ = "HH24:MI:SS";
+
+  frmt_ = ExpDatetime::getDatetimeFormat(formatStr_.data());
+}
+
+ItemExpr * DateFormat::bindNode(BindWA * bindWA)
+{
+  if (checkForSQLnullChild(bindWA, this, allowsSQLnullArg(), FUNCTION_))
+    return this;
+
+  bindChildren(bindWA);
+  if (bindWA->errStatus()) 
+    return this;
+
+  const NAType *naType0 = &child(0)->getValueId().getType();
+  const NumericType * nType0 = NULL;
+
+  // a quick optimization for the date format.
+  ItemExpr *newNode = quickDateFormatOpt(bindWA);
+  if (newNode)
+    return newNode;
+
+  if (errorChecks(frmt_, bindWA, naType0))
+    {
+      return this;
+    }
+
+  dateFormat_ = DateFormat::DATE_FORMAT_NONE;
+
+  if (ExpDatetime::isDateTimeFormat(frmt_))
+    {
+      if (ExpDatetime::isTimestampFormat(frmt_))
+        dateFormat_ = DateFormat::TIMESTAMP_FORMAT_STR;
+      else if (ExpDatetime::isTimeFormat(frmt_))
+        dateFormat_ = DateFormat::TIME_FORMAT_STR;
+      else
+        dateFormat_ = DateFormat::DATE_FORMAT_STR;
+
+      if (naType0->getTypeQualifier() == NA_NUMERIC_TYPE)
+        {
+          // convert number to char before formatting.
+          // Length of target char is equal to formatStr_.
+          ItemExpr * newChild =
+            new (bindWA->wHeap())
+            Cast(child(0),
+                 new (bindWA->wHeap())
+                 SQLChar(formatStr_.length(),
+                         child(0)->castToItemExpr()->
+                         getValueId().getType().supportsSQLnull()));
+          setChild(0, newChild->bindNode(bindWA));
+          naType0 = &child(0)->getValueId().getType();
+        }
+    }
+  else if (ExpDatetime::isNumericFormat(frmt_))
+    {
+      dateFormat_ = DateFormat::TIME_FORMAT_STR;
+
+      if (naType0->getTypeName() != LiteralLargeInt)
+        {
+          // convert to largeint. We have already verified that
+          // child is exact with scale of 0.
+          ItemExpr * newChild =
+            new (bindWA->wHeap())
+            Cast(child(0),
+                 new (bindWA->wHeap())
+                 SQLLargeInt(TRUE,
+                             child(0)->castToItemExpr()->
+                             getValueId().getType().supportsSQLnull()));
+          setChild(0, newChild->bindNode(bindWA));
+        }
+    }
+  else
+    {
+      CMPASSERT(FALSE); // should not reach here
+    }
+
+  // if source is a timestamp and target is date or time, extract
+  // date or time part from source before formatting.
+  ItemExpr * newChild = NULL;
+  if (naType0->getPrecision() == SQLDTCODE_TIMESTAMP)
+    {
+      if (ExpDatetime::isTimeFormat(frmt_))
+        {
+          newChild =
+            new (bindWA->wHeap())
+            Cast(child(0),
+                 new (bindWA->wHeap())
+                 SQLTime(child(0)->castToItemExpr()->
+                         getValueId().getType().supportsSQLnull(),
+                         0));
+        }
+      else if (ExpDatetime::isDateFormat(frmt_))
+        {
+          newChild =
+            new (bindWA->wHeap())
+            Cast(child(0),
+                 new (bindWA->wHeap())
+                 SQLDate(child(0)->castToItemExpr()->
+                         getValueId().getType().supportsSQLnull()));
+        }
+      
+      if (newChild)
+        setChild(0, newChild->bindNode(bindWA));
+    }
+
+  BuiltinFunction::bindNode(bindWA);
+  if (bindWA->errStatus()) 
+    return this;
+
+  return getValueId().getItemExpr();  
+}
+
 ItemExpr *Trim::bindNode(BindWA *bindWA)
 {
   if (nodeIsBound())
@@ -11829,27 +11824,6 @@ ItemExpr *ZZZBinderFunction::bindNode(BindWA *bindWA)
       }
     
     break;
-    case ITM_DATEFMT:
-      {
-    Lng32 datefmt;
-	ItemExpr *secondOpExpr = child(1)->castToItemExpr(); 
-	secondOpExpr->bindNode(bindWA);
-	if (bindWA->errStatus()) 
-	      return this;
-	    
-	datefmt = (Lng32)((ConstValue*)secondOpExpr)->getExactNumericValue();
-
-	strcpy(buf, "TRANSLATE(DATEFMT_INTN");
-        if (datefmt == DateFormat::USA)
-	  strcat(buf, "(@A1,USA)");
-
-        else if (datefmt == DateFormat::EUROPEAN)
-	  strcat(buf, "(@A1,EUROPEAN)");
-        else
-	  strcat(buf, "(@A1,DEFAULT)");
-	strcat(buf, " USING ISO88591ToUCS2);");
-      }
-    break;
     case ITM_CURRNT_USER:
       {
 	strcpy(buf, "TRANSLATE(CURRNT_USR_INTN USING ISO88591ToUCS2);");

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/BindRI.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRI.cpp b/core/sql/optimizer/BindRI.cpp
index 4792460..1b3d138 100644
--- a/core/sql/optimizer/BindRI.cpp
+++ b/core/sql/optimizer/BindRI.cpp
@@ -408,6 +408,43 @@ void RefConstraint::getMatchOptionPredicateText(NAString &text,
   text += ")";
 }
 
+//helper function to check if the given column name is reserved hidden coloum
+//NOTE:
+//  this function hardcode the special name string for SALT, DIVSION columns
+//  if the naming convension of SALT/DIVISION column is changed,
+//  this function MUST be changed as well
+static NABoolean isHiddenColumn(const char *colname)
+{
+  int len = strlen(colname);
+  if(strcmp(colname , "_SALT_") ==0) 
+    return TRUE;
+  //check for DIVISION column
+  //pattern _DIVISION_%d_
+  //must longer than 12
+  if(len >= 12) {
+    //must end with _
+    if(colname[len-1] == '_')
+    {
+      //if begin with _DIVISION_?
+      if(strncmp(colname,"_DIVISION_",10) == 0) 
+      {
+        //middle part are number
+        int allDigit = 1;
+        for(int i = 0; i< len-11; i++)
+        {
+          if(isdigit(colname[i+10]) == 0)
+          {
+            allDigit = 0;
+            break; //not digit
+          }
+        } 
+        if(allDigit == 1)
+          return TRUE; 
+      }
+    }
+  }
+  return FALSE;
+}
 
 // Writes a row-value-constructor consisting of fully qualified column names
 // in Ansi (external) format
@@ -417,12 +454,18 @@ void RefConstraint::getPredicateText(NAString &text,
 				     NAString *corrName) const
 {
   NAString tblText = ( (corrName == NULL) ? tblName.getQualifiedNameAsAnsiString() : *corrName);
+  int pos= 0;
   text += "(";
   for (CollIndex i = 0; i < keyColumns.entries(); i++)
     {
-      if (i)
+      if(isHiddenColumn(keyColumns[i]->getColName()) )
+        continue;
+      if (pos > 0)
+      {
         text += ",";
+      }
       text += tblText + "." + ToAnsiIdentifier(keyColumns[i]->getColName());
+      pos++; //move the pos
     }
   text += ")";
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index ab347a7..cbb460e 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -9888,7 +9888,7 @@ RelExpr *Insert::bindNode(BindWA *bindWA)
                    (nacol->getDefaultClass() == COM_IDENTITY_GENERATED_BY_DEFAULT)) {
             setSystemGeneratesIdentityValue(TRUE);
           }
-          else 
+          else if (nacol->getDefaultClass() != COM_NO_DEFAULT)
             omittedDefaultCols = TRUE;
 
           // Bind the default value, make an Assign, etc, as above
@@ -10112,15 +10112,8 @@ RelExpr *Insert::bindNode(BindWA *bindWA)
          *CmpCommon::diags() << DgSqlCode(-4490);
     }
   }
-  if (isUpsert() && (!getIsTrafLoadPrep()) && 
-        (((!isAlignedRowFormat) && omittedCurrentDefaultClassCols) || 
-             (isAlignedRowFormat && omittedDefaultCols)) 
-              && (CmpCommon::getDefault(TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS) == DF_OFF)) {
-    boundExpr = xformUpsertToMerge(bindWA);
-    return boundExpr;
-  }
-  else 
-  if (isUpsertThatNeedsMerge()) {
+
+  if (isUpsertThatNeedsMerge(isAlignedRowFormat, omittedDefaultCols, omittedCurrentDefaultClassCols)) {
     boundExpr = xformUpsertToMerge(bindWA);
     return boundExpr;
   }
@@ -10171,17 +10164,26 @@ matched clause of merge). If the upsert caused a row to be updated in the
 base table then the old version of the row will have to be deleted from 
 indexes, and a new version inserted. Upsert is being transformed to merge
 so that we can delete the old version of an updated row from the index.
+
+Upsert is also converted into merge when there are omitted cols with default values and 
+TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS is set to  OFF in case of aligned format table or 
+omitted current timestamp cols in case of non-aligned row format
 */
-NABoolean Insert::isUpsertThatNeedsMerge() const
+NABoolean Insert::isUpsertThatNeedsMerge(NABoolean isAlignedRowFormat, NABoolean omittedDefaultCols,
+                                   NABoolean omittedCurrentDefaultClassCols) const
 {
-  if (!isUpsert() || getIsTrafLoadPrep() || 
-      (getTableDesc()->isIdentityColumnGeneratedAlways() && 
-       getTableDesc()->hasIdentityColumnInClusteringKey()) ||
-      getTableDesc()->getClusteringIndex()->getNAFileSet()->hasSyskey() || 
-      !(getTableDesc()->hasSecondaryIndexes()))
-    return FALSE;
-
-  return TRUE;
+  if (isUpsert() && 
+      (NOT getIsTrafLoadPrep()) && 
+      (NOT (getTableDesc()->isIdentityColumnGeneratedAlways() && getTableDesc()->hasIdentityColumnInClusteringKey())) && 
+      (NOT (getTableDesc()->getClusteringIndex()->getNAFileSet()->hasSyskey())) && 
+       ((getTableDesc()->hasSecondaryIndexes()) ||
+         (( NOT isAlignedRowFormat) && omittedCurrentDefaultClassCols) ||
+             ((isAlignedRowFormat && omittedDefaultCols
+              && (CmpCommon::getDefault(TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS) == DF_OFF)))
+       ))
+     return TRUE;
+  else
+     return FALSE;
 }
 
 RelExpr* Insert::xformUpsertToMerge(BindWA *bindWA) 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/ItemCache.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemCache.cpp b/core/sql/optimizer/ItemCache.cpp
index 9bdd830..703f9f8 100644
--- a/core/sql/optimizer/ItemCache.cpp
+++ b/core/sql/optimizer/ItemCache.cpp
@@ -714,7 +714,10 @@ void DateFormat::generateCacheKey(CacheWA& cwa) const
 {
   BuiltinFunction::generateCacheKey(cwa); 
   cwa += " fmt:";
-  char dFmt[20]; str_itoa(dateFormat_, dFmt); 
+  char dFmt[20]; 
+  str_itoa(dateFormat_, dFmt); 
+  cwa += dFmt;
+  str_itoa(frmt_, dFmt);
   cwa += dFmt;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index d68768e..a76ddb4 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -49,7 +49,7 @@
 #include "exp_function.h" // for calling ExHDPHash::hash(data, len)
 #include "ItemFuncUDF.h"
 #include "CmpStatement.h"
-//#include "ItmFlowControlFunction.h"
+#include "exp_datetime.h"
 
 #include "OptRange.h"
 
@@ -8241,12 +8241,16 @@ DateFormat::~DateFormat() {}
 ItemExpr * DateFormat::copyTopNode(ItemExpr *derivedNode,
 				   CollHeap* outHeap)
 {
-  ItemExpr *result;
+  DateFormat *result;
 
   if (derivedNode == NULL)
-    result = new (outHeap) DateFormat(child(0), child(1), getDateFormat());
+    result = new (outHeap) DateFormat(child(0), 
+                                      formatStr_, formatType_, 
+                                      wasDateformat_);
   else
-    result = derivedNode;
+    result = (DateFormat*)derivedNode;
+
+  frmt_ = result->frmt_;
 
   return BuiltinFunction::copyTopNode(result,outHeap);
 
@@ -8265,6 +8269,46 @@ NABoolean DateFormat::hasEquivalentProperties(ItemExpr * other)
   return 
       (this->dateFormat_ == df->dateFormat_);
 }
+
+void DateFormat::unparse(NAString &result,
+		      PhaseEnum phase,
+                      UnparseFormatEnum form,
+		      TableDesc * tabId) const
+{
+  if (wasDateformat_)
+    result += "DATEFORMAT(";
+  else if (formatType_ == FORMAT_TO_DATE)
+    result += "TO_DATE(";
+  else if (formatType_ == FORMAT_TO_CHAR)
+    result += "TO_CHAR(";
+  else
+    result += "unknown(";
+
+  child(0)->unparse(result, phase, form, tabId);
+
+  result += ", ";
+
+  if (wasDateformat_)
+    {
+      if (frmt_ == ExpDatetime::DATETIME_FORMAT_DEFAULT)
+        result += "DEFAULT";
+      else if (frmt_ == ExpDatetime::DATETIME_FORMAT_USA)
+        result += "USA";
+      else if (frmt_ == ExpDatetime::DATETIME_FORMAT_EUROPEAN)
+        result += "EUROPEAN";
+      else
+        result += "unknown";
+    }
+  else
+    {
+      result += "'";
+      result += formatStr_;
+      result += "'";
+    }
+
+  result += ")";  
+}
+
 // -----------------------------------------------------------------------
 // member functions for class DayOfWeek
 // -----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/ItemFunc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemFunc.h b/core/sql/optimizer/ItemFunc.h
index d794a3d..0728521 100644
--- a/core/sql/optimizer/ItemFunc.h
+++ b/core/sql/optimizer/ItemFunc.h
@@ -1703,22 +1703,23 @@ public:
 class DateFormat : public CacheableBuiltinFunction
 {
 public:
+  enum FormatType
+  {
+    FORMAT_GENERIC = 0,
+    FORMAT_TO_DATE,
+    FORMAT_TO_CHAR
+  };
+
   enum 
   { 
-    DEFAULT,  // YYYY-MM-DD
-    USA,      // MM/DD/YYYY AM|PM
-    EUROPEAN, // DD.MM.YYYY
-    DATE_FORMAT_STR, // formatStr_ contains date format    
-    TIME_FORMAT_STR, // formatStr_ contains time format
-    TIMESTAMP_FORMAT_STR  // formatStr_ contains time format
+    DATE_FORMAT_NONE = 0,
+    DATE_FORMAT_STR,       // formatStr_ contains date format    
+    TIME_FORMAT_STR,       // formatStr_ contains time format
+    TIMESTAMP_FORMAT_STR   // formatStr_ contains timestamp format
   };
 
-  DateFormat(ItemExpr *val1Ptr, ItemExpr *formatStrPtr,
-	     Int32 dateFormat)
-	: CacheableBuiltinFunction(ITM_DATEFORMAT,
-			  2, val1Ptr, formatStrPtr),
-	  dateFormat_(dateFormat)
-	{ allowsSQLnullArg() = FALSE; }
+  DateFormat(ItemExpr *val1Ptr, const NAString &formatStr,
+             Lng32 formatType, NABoolean wasDateformat = FALSE);
 
   // virtual destructor
   virtual ~DateFormat();
@@ -1726,6 +1727,8 @@ public:
   // accessor functions
   Int32 getDateFormat() const { return dateFormat_; }
 
+  Int32 getExpDatetimeFormat() const { return frmt_; }
+
   // do not change format literals of DateFormat into constant parameters
   virtual ItemExpr* normalizeForCache(CacheWA& cwa, BindWA& bindWA)
     { return this; } 
@@ -1733,6 +1736,12 @@ public:
   // append an ascii-version of ItemExpr into cachewa.qryText_
   virtual void generateCacheKey(CacheWA& cwa) const;
 
+  NABoolean errorChecks(Lng32 frmt, BindWA *bindWA, const NAType* opType);
+
+  ItemExpr * quickDateFormatOpt(BindWA * bindWA);
+
+  ItemExpr * bindNode(BindWA * bindWA);
+
   // a virtual function for type propagating the node
   virtual const NAType * synthesizeType();
 
@@ -1742,7 +1751,11 @@ public:
   virtual ItemExpr * copyTopNode(ItemExpr *derivedNode = NULL,
 				 CollHeap* outHeap = 0);
   
-  
+  void unparse(NAString &result,
+               PhaseEnum phase,
+               UnparseFormatEnum form,
+               TableDesc * tabId) const;
+    
   virtual NABoolean hasEquivalentProperties(ItemExpr * other);
 
   virtual QR::ExprElement getQRExprElem() const
@@ -1751,8 +1764,20 @@ public:
   }
 
 private:
+  // string contains user specified format string
+  NAString formatStr_;
+
+  // TO_DATE or TO_CHAR
+  Lng32 formatType_;
 
+  // DATE, TIME or TIMESTAMP
   Int32 dateFormat_;
+
+  // original function was DATEFORMAT
+  NABoolean wasDateformat_; 
+
+  // actual datetime format (defined in class ExpDatetime in exp_datetime.h)
+  Lng32 frmt_;
 }; // class DateFormat
 
 class DayOfWeek : public CacheableBuiltinFunction
@@ -2664,6 +2689,8 @@ public:
   virtual ItemExpr * copyTopNode(ItemExpr *derivedNode = NULL,
 				 CollHeap* outHeap = 0);
 
+  ItemExpr * quickDateFormatOpt(BindWA * bindWA);
+
   const NAString& getFormatStr() const
   {
     return formatStr_;
@@ -2709,8 +2736,12 @@ public:
    lobNum_(-1),
    lobStorageType_(Lob_Invalid_Storage),
    lobMaxSize_(CmpCommon::getDefaultNumeric(LOB_MAX_SIZE)),
-   lobMaxChunkMemSize_(CmpCommon::getDefaultNumeric(LOB_MAX_CHUNK_MEM_SIZE))
-   {}
+     lobMaxChunkMemSize_(CmpCommon::getDefaultNumeric(LOB_MAX_CHUNK_MEM_SIZE)),
+     lobGCLimit_(CmpCommon::getDefaultNumeric(LOB_GC_LIMIT_SIZE)),
+     hdfsPort_((Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT)),
+     hdfsServer_( CmpCommon::getDefaultString(LOB_HDFS_SERVER))
+   {
+   }
 
  // copyTopNode method
   virtual ItemExpr * copyTopNode(ItemExpr *derivedNode = NULL,
@@ -2737,8 +2768,10 @@ public:
   LobsStorage &lobStorageType() { return lobStorageType_; }
   NAString &lobStorageLocation() { return lobStorageLocation_; }
   Int64 getLobMaxSize() {return lobMaxSize_*1024*1024; }
-  Int64 getLobMaxChunkMemSize() { return lobMaxChunkMemSize_;}
-  
+  Int64 getLobMaxChunkMemSize() { return lobMaxChunkMemSize_*1024*1024;}
+  Int64 getLobGCLimit() { return lobGCLimit_*1025*1024;}
+  Int32 getLobHdfsPort() { return hdfsPort_;}
+  NAString &getLobHdfsServer(){return hdfsServer_;}
  protected:
   ObjectType obj_;
 
@@ -2747,6 +2780,9 @@ public:
   NAString lobStorageLocation_;
   Int32 lobMaxSize_; // In MB units
   Int32 lobMaxChunkMemSize_; //In MB Units
+  Int32 lobGCLimit_ ;//In MB Units
+  Int32 hdfsPort_;
+  NAString hdfsServer_;
   
 }; // LOBoper
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/NAFileSet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.cpp b/core/sql/optimizer/NAFileSet.cpp
index 83d34a8..ea6b840 100644
--- a/core/sql/optimizer/NAFileSet.cpp
+++ b/core/sql/optimizer/NAFileSet.cpp
@@ -75,6 +75,7 @@ NAFileSet::NAFileSet(const QualifiedName & fileSetName,
                      Lng32 fileCode,
 		     NABoolean isVolatile,
 		     NABoolean inMemObjectDefn,
+                     Int64 indexUID,
                      desc_struct *keysDesc,
                      HHDFSTableStats *hHDFSTableStats,
                      Lng32 numSaltPartns,
@@ -113,6 +114,7 @@ NAFileSet::NAFileSet(const QualifiedName & fileSetName,
            thisRemoteIndexGone_(FALSE),
            isDecoupledRangePartitioned_(isDecoupledRangePartitioned),
            fileCode_(fileCode),
+           indexUID_(indexUID),
            keysDesc_(keysDesc),
            hHDFSTableStats_(hHDFSTableStats),
            numSaltPartns_(numSaltPartns),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/NAFileSet.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.h b/core/sql/optimizer/NAFileSet.h
index 04b4c0e..f8ca7ed 100644
--- a/core/sql/optimizer/NAFileSet.h
+++ b/core/sql/optimizer/NAFileSet.h
@@ -115,6 +115,7 @@ public:
             Lng32 fileCode,
 	    NABoolean isVolatile,
 	    NABoolean inMemObjectDefn,
+            Int64 indexUID,
             desc_struct *keysDesc,
             HHDFSTableStats *hHDFSTableStats,
             Lng32 numSaltPartns,
@@ -170,6 +171,9 @@ public:
 
   Lng32 getFileCode() const { return fileCode_; }
 
+  const Int64 &getIndexUID() const { return indexUID_; }
+  Int64 &getIndexUID() { return indexUID_; }
+
   const HHDFSTableStats *getHHDFSTableStats() const { return hHDFSTableStats_; }
   HHDFSTableStats *getHHDFSTableStats()             { return hHDFSTableStats_; }
 
@@ -382,6 +386,9 @@ private:
   // ---------------------------------------------------------------------
   NAColumnArray indexKeyColumns_;
 
+  // uid for index
+  Int64 indexUID_;
+
   desc_struct *keysDesc_;  // needed for parallel label operations.
 
   // ---------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index ef095ce..c01998c 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -4300,6 +4300,7 @@ NABoolean createNAFileSets(desc_struct * table_desc       /*IN*/,
                   files_desc ? files_desc->body.files_desc.fileCode : 0,
 		  (indexes_desc->body.indexes_desc.isVolatile != 0),
 		  (indexes_desc->body.indexes_desc.isInMemoryObjectDefn != 0),
+                  indexes_desc->body.indexes_desc.indexUID,
                   indexes_desc->body.indexes_desc.keys_desc,
                   NULL, // no Hive stats
                   indexes_desc->body.indexes_desc.numSaltPartns,
@@ -4635,6 +4636,7 @@ NABoolean createNAFileSets(hive_tbl_desc* hvt_desc        /*IN*/,
                   0, // file code
 		  0, // not a volatile
 		  0, // inMemObjectDefn
+                  0,
                   NULL, // indexes_desc->body.indexes_desc.keys_desc,
                   hiveHDFSTableStats,
                   0, // saltPartns
@@ -5516,7 +5518,8 @@ NATable::NATable(BindWA *bindWA,
 
   if(postCreateNATableWarnings != preCreateNATableWarnings)
     tableConstructionHadWarnings_=TRUE;
-
+  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   if (hasLobColumn())
     {
       // read lob related information from lob metadata
@@ -5556,7 +5559,7 @@ NATable::NATable(BindWA *bindWA,
 	 LOB_CLI_SELECT_CURSOR,
 	 lobNumList,
 	 lobTypList,
-	 lobLocList,0);
+	 lobLocList,(char *)lobHdfsServer,lobHdfsPort,0);
       
       if (cliRC == 0)
 	{
@@ -7537,12 +7540,30 @@ ExtendedQualName::SpecialTableType NATable::getTableType()
   return qualifiedName_.getSpecialType();
 }
 
-NABoolean NATable::hasSaltedColumn()
+NABoolean NATable::hasSaltedColumn(Lng32 * saltColPos)
 {
   for (CollIndex i=0; i<colArray_.entries(); i++ )
   {
     if ( colArray_[i]->isSaltColumn() ) 
-      return TRUE;
+      {
+        if (saltColPos)
+          *saltColPos = i;
+        return TRUE;
+      }
+  }
+  return FALSE;
+}
+
+NABoolean NATable::hasDivisioningColumn(Lng32 * divColPos)
+{
+  for (CollIndex i=0; i<colArray_.entries(); i++ )
+  {
+    if ( colArray_[i]->isDivisioningColumn() ) 
+      {
+        if (divColPos)
+          *divColPos = i;
+        return TRUE;
+      }
   }
   return FALSE;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/NATable.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.h b/core/sql/optimizer/NATable.h
index 3f58406..e496242 100644
--- a/core/sql/optimizer/NATable.h
+++ b/core/sql/optimizer/NATable.h
@@ -561,7 +561,8 @@ public:
 
   const char *getViewCheck() const              { return viewCheck_; }
 
-  NABoolean hasSaltedColumn();
+  NABoolean hasSaltedColumn(Lng32 * saltColPos = NULL);
+  NABoolean hasDivisioningColumn(Lng32 * divColPos = NULL);
 
   void setUpdatable( NABoolean value )
   {  value ? flags_ |= IS_UPDATABLE : flags_ &= ~IS_UPDATABLE; }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/QRDescGenerator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/QRDescGenerator.cpp b/core/sql/optimizer/QRDescGenerator.cpp
index 2a412a3..f8bb9f6 100644
--- a/core/sql/optimizer/QRDescGenerator.cpp
+++ b/core/sql/optimizer/QRDescGenerator.cpp
@@ -543,22 +543,11 @@ static void addFunctionParameters(ItemExpr* ie,
 
       case ITM_DATEFORMAT:
         {
-          // Only include the parameter if it is one of the predefined values
-          // DEFAULT, USA, or EUROPEAN. The other possible values indicate that
-          // a format string is used to determine the format, and this takes
-          // the form of an explicit operand in the ItemExpr tree.
           DateFormat* dateFormatFn = static_cast<DateFormat*>(ie);
-          Int32 dateFormat = dateFormatFn->getDateFormat();
-          if (dateFormat == DateFormat::DEFAULT ||
-              dateFormat == DateFormat::USA     ||
-              dateFormat == DateFormat::EUROPEAN)
-            {
-              param->setName("dateFormat");
-              param->setValue(dateFormat);
-              function->addHiddenParam(param);
-            }
-          else
-            deletePtr(param);
+          Int32 dateFormat = dateFormatFn->getExpDatetimeFormat();
+          param->setName("dateFormat");
+          param->setValue(dateFormat);
+          function->addHiddenParam(param);
         }
         break;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index e3401b5..e1b28ca 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -3794,6 +3794,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
   NABoolean alterRenameTable = FALSE;
   NABoolean alterIdentityCol = FALSE;
   NABoolean alterColDatatype = FALSE;
+  NABoolean alterColRename = FALSE;
   NABoolean externalTable = FALSE;
   
   returnStatus_ = FALSE;
@@ -3819,6 +3820,11 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
     isHbase_ = TRUE;
     hbaseDDLNoUserXn_ = TRUE;
   }
+  else if (createLibmgr() || dropLibmgr() || upgradeLibmgr())
+    {
+      isHbase_ = TRUE;
+      hbaseDDLNoUserXn_ = TRUE;
+    }
   else if (createRepos() || dropRepos() || upgradeRepos())
     {
       isHbase_ = TRUE;
@@ -4012,7 +4018,9 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
          alterIdentityCol = TRUE;
       else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableAlterColumnDatatype())
          alterColDatatype = TRUE;
-      else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableHBaseOptions())
+       else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableAlterColumnRename())
+         alterColRename = TRUE;
+       else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableHBaseOptions())
          alterHBaseOptions = TRUE;
        else
         otherAlters = TRUE;
@@ -4210,7 +4218,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
          (isCreate_ || isDrop_ || purgedataHbase_ ||
           (isAlter_ && (alterAddCol || alterDropCol || alterDisableIndex || alterEnableIndex || 
 			alterAddConstr || alterDropConstr || alterRenameTable ||
-                        alterIdentityCol || alterColDatatype ||
+                        alterIdentityCol || alterColDatatype || alterColRename ||
                         alterHBaseOptions || otherAlters)))))
       {
 	if (NOT isNative_)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/RelExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.h b/core/sql/optimizer/RelExeUtil.h
index 21a771e..a2ab73d 100644
--- a/core/sql/optimizer/RelExeUtil.h
+++ b/core/sql/optimizer/RelExeUtil.h
@@ -405,6 +405,18 @@ public:
   {(v ? flags_ |= GET_MD_VERSION : flags_ &= ~GET_MD_VERSION); }
   NABoolean getMDVersion() { return (flags_ & GET_MD_VERSION) != 0;}
 
+  void setCreateLibmgr(NABoolean v)
+  {(v ? flags_ |= CREATE_LIBMGR : flags_ &= ~CREATE_LIBMGR); }
+  NABoolean createLibmgr() { return (flags_ & CREATE_LIBMGR) != 0;}
+
+  void setDropLibmgr(NABoolean v)
+  {(v ? flags_ |= DROP_LIBMGR : flags_ &= ~DROP_LIBMGR); }
+  NABoolean dropLibmgr() { return (flags_ & DROP_LIBMGR) != 0;}
+
+  void setUpgradeLibmgr(NABoolean v)
+  {(v ? flags_ |= UPGRADE_LIBMGR : flags_ &= ~UPGRADE_LIBMGR); }
+  NABoolean upgradeLibmgr() { return (flags_ & UPGRADE_LIBMGR) != 0;}
+
   void setCreateRepos(NABoolean v)
   {(v ? flags_ |= CREATE_REPOS : flags_ &= ~CREATE_REPOS); }
   NABoolean createRepos() { return (flags_ & CREATE_REPOS) != 0;}
@@ -432,7 +444,10 @@ public:
     CREATE_REPOS            = 0x0008,
     DROP_REPOS              = 0x0010,
     UPGRADE_REPOS           = 0x0020,
-    CLEANUP_AUTH            = 0X0040  
+    CLEANUP_AUTH            = 0X0040,
+    CREATE_LIBMGR           = 0x0080,
+    DROP_LIBMGR             = 0x0100,
+    UPGRADE_LIBMGR          = 0x0200
   };
 
   // see method processSpecialDDL in sqlcomp/parser.cpp

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/RelFastTransport.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelFastTransport.cpp b/core/sql/optimizer/RelFastTransport.cpp
index 182ff65..5049d76 100644
--- a/core/sql/optimizer/RelFastTransport.cpp
+++ b/core/sql/optimizer/RelFastTransport.cpp
@@ -203,7 +203,7 @@ short FastExtract::setOptions(NAList<UnloadOption*> *
 
   for (CollIndex i = 0; i < fastExtractOptionList->entries(); i++)
   {
-    UnloadOption::UnloadOption * feo = (*fastExtractOptionList)[i];
+    UnloadOption * feo = (*fastExtractOptionList)[i];
     switch (feo->option_)
     {
       case UnloadOption::DELIMITER_:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/RelUpdate.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelUpdate.h b/core/sql/optimizer/RelUpdate.h
index dbd8a06..d949781 100644
--- a/core/sql/optimizer/RelUpdate.h
+++ b/core/sql/optimizer/RelUpdate.h
@@ -1149,7 +1149,8 @@ public:
     baseColRefs_ = val;
   }
 
-  NABoolean isUpsertThatNeedsMerge() const;
+  NABoolean isUpsertThatNeedsMerge(NABoolean isAlignedRowFormat, NABoolean omittedDefaultCols,
+                                   NABoolean omittedCurrentDefaultCols) const;
   RelExpr* xformUpsertToMerge(BindWA *bindWA) ;
 
 protected:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/Stats.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/Stats.h b/core/sql/optimizer/Stats.h
index e2ae0c0..faa8bc7 100644
--- a/core/sql/optimizer/Stats.h
+++ b/core/sql/optimizer/Stats.h
@@ -965,7 +965,7 @@ public:
   // NB: no need for a dtor
   //
   Interval () :
-      loIndex_(NULL_COLL_INDEX), hist_(NULL)
+      loIndex_(NULL_COLL_INDEX), hist_(0)
   {}
 
   Interval (CollIndex startIndex, const HistogramSharedPtr& hist) :
@@ -1137,10 +1137,10 @@ public:
   inline NABoolean isNull() const { return (hiBound().isNullValue()) ; }
 
   // make sure we don't use Intervals that have been compromised
-  inline void setInvalid() { hist_ = NULL ; }
+  inline void setInvalid() { hist_ = 0; }
   inline NABoolean isValid() const
   {
-    return ( (hist_ != NULL) &&
+    return ( (hist_ != 0) &&
              ((loIndex_+2) <= hist_->entries()) ) ;
   }
   // was loIndex_ <= hist_->entries()-2, but we hate underflow!
@@ -1446,7 +1446,7 @@ public:
   ColStats (ComUID & histid, CostScalar uec = 0, CostScalar rowcount = 0,
             CostScalar baseRowCount = -1,
 	    NABoolean unique = FALSE, NABoolean shapeChanged = FALSE,
-	    const HistogramSharedPtr& desc = NULL, NABoolean modified = FALSE,
+	    const HistogramSharedPtr& desc = 0, NABoolean modified = FALSE,
 	    CostScalar rowRedFactor = 1.0, CostScalar uecRedFactor = 1.0,
                  Int32 avgVarcharSize = 0,  
 	    NAMemory* heap=0, NABoolean allowMinusOne=FALSE);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index fc0f12d..16880e1 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -43,6 +43,7 @@
 #include "CmpErrors.h"
 #include "ComSqlId.h"
 #include "OptimizerSimulator.h"
+#include "exp_datetime.h"
 
 // For TRIGGERS_STATUS_VECTOR_SIZE and SIZEOF_UNIQUE_EXECUTE_ID
 #include "Triggers.h"
@@ -2782,8 +2783,6 @@ const NAType *CurrentTimestampRunning::synthesizeType()
 // -----------------------------------------------------------------------
 // member functions for class DateFormat
 // -----------------------------------------------------------------------
-
-#pragma nowarn(1506)   // warning elimination
 const NAType *DateFormat::synthesizeType()
 {
   //
@@ -2797,17 +2796,6 @@ const NAType *DateFormat::synthesizeType()
   //
   if (!vid.getType().isSupportedType()) {
     // 4071 The operand of a DATEFORMAT function must be a datetime.
-// LCOV_EXCL_START - mp
-    *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
-    return NULL;
-// LCOV_EXCL_STOP
-  }
-
-  if (((getDateFormat() == DEFAULT) ||
-       (getDateFormat() == USA) ||
-       (getDateFormat() == EUROPEAN)) &&
-      (vid.getType().getTypeQualifier() != NA_DATETIME_TYPE)) {
-    // 4071 The operand of a DATEFORMAT function must be a datetime.
     *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
     return NULL;
   }
@@ -2837,154 +2825,43 @@ const NAType *DateFormat::synthesizeType()
   NABoolean formatAsDate = FALSE;
   NABoolean formatAsTimestamp = FALSE;
   NABoolean formatAsTime = FALSE;
+
   if (vid.getType().getTypeQualifier() == NA_DATETIME_TYPE)
     {
-      // This code is now identical for all DatetimeTypes
       const DatetimeType& operand = (DatetimeType &)vid.getType();
-      //
-      // Return the result.
-      //
-      if (getDateFormat() == DATE_FORMAT_STR)
-	{
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-	    }
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
-	}
-      else if (getDateFormat() == TIMESTAMP_FORMAT_STR)
-	{
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-
-	      if ((NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		   == "YYYYMMDDHH24MISS") ||
-		  (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		   == "YYYYMMDD:HH24:MI:SS") ||
-		  (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		   == "DD.MM.YYYY:HH24:MI:SS") ||
-		  (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		   == "YYYY-MM-DD HH24:MI:SS"))
-		{
-		  // length includes 2 extra bytes for "24" that was specified
-		  // in the format.
-		  length -= 2;
-		}
-	    }
-	  else if (getDateFormat() == TIME_FORMAT_STR)
-	    {
-	      if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-		{
-		  ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-		  length = cv->getStorageSize();
-		  
-		  if (NAString((char*)(cv->getConstValue()), cv->getStorageSize())
-		      == "HH24:MI:SS")
-		    {
-		      // length includes 2 extra bytes for "24" that was specified
-		      // in the format.
-		      length -= 2;
-		    }
-		}
-	    }  
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
-	}
-      else
-	{
+      Lng32 frmt = ExpDatetime::getDatetimeFormat(formatStr_.data());
+
+      if (wasDateformat_)
+        {
 	  length = operand.getDisplayLength();
-	  if(operand.containsField(REC_DATE_HOUR) && (getDateFormat() == USA))
+	  if(operand.containsField(REC_DATE_HOUR) && 
+             (frmt == ExpDatetime::DATETIME_FORMAT_USA))
 	    length += 3; // add 3 for a blank and "am" or "pm"
-	}
+        }
+      else
+        {
+          length = ExpDatetime::getDatetimeFormatMaxLen(frmt);
+        }
     }
   else if (vid.getType().getTypeQualifier() == NA_CHARACTER_TYPE)
     {
-      //
-      // Return the result.
-      //
+      length = formatStr_.length();
       if (getDateFormat() == DATE_FORMAT_STR)
 	{
 	  formatAsDate = TRUE;
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-	    }
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
 	}
       else if (getDateFormat() == TIMESTAMP_FORMAT_STR)
 	{
 	  formatAsTimestamp = TRUE;
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-	    }
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
 	}
       else if (getDateFormat() == TIME_FORMAT_STR)
 	{
 	  formatAsTime = TRUE;
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-	    }
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
 	}
     }
   else if (vid.getType().getTypeQualifier() == NA_NUMERIC_TYPE)
     {
-      const NumericType &numeric  = (NumericType&)vid.getType();
-      if ((numeric.isExact()) &&
-	  (NOT numeric.isBigNum()) &&
-	  (numeric.getScale() == 0))
-	{
-	  if (child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT)
-	    {
-	      ConstValue * cv = (ConstValue*)(child(1)->castToItemExpr());
-	      length = cv->getStorageSize();
-	    }
-	  else
-	    {
-	      // must be a const for now.
-	      CMPASSERT(child(1)->castToItemExpr()->getOperatorType() == ITM_CONSTANT);
-	    }
-	}
-      else
-	{
-	  // 4047 Arguments of USER function must have a scale of 0.
-	  *CmpCommon::diags() << DgSqlCode(-4047) << DgString0(getTextUpper());
-	  return NULL;
-	}
-    }
-  else
-    {
-      // 4071 The operand of a DATEFORMAT function must be a datetime.
-      *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
-      return NULL;
+      length = formatStr_.length();
     }
 
   if (formatAsDate)
@@ -2996,7 +2873,6 @@ const NAType *DateFormat::synthesizeType()
   else
     return new HEAP SQLChar(length, vid.getType().supportsSQLnullLogical());
 }
-#pragma warn(1506)  // warning elimination
 
 // -----------------------------------------------------------------------
 // member functions for class DayOfWeek

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/ValueDesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ValueDesc.cpp b/core/sql/optimizer/ValueDesc.cpp
index 891ba15..95246aa 100644
--- a/core/sql/optimizer/ValueDesc.cpp
+++ b/core/sql/optimizer/ValueDesc.cpp
@@ -514,7 +514,7 @@ ValueId::getNAColumn(NABoolean okIfNotColumn) const
 }
 
 
-NABoolean ValueId::isAddedColumnWithNonNullDefault() const{
+NABoolean ValueId::isColumnWithNonNullNonCurrentDefault() const{
   NAColumn * nac = NULL;
   ItemExpr *ck = getItemExpr();
   if ( ck == NULL )
@@ -529,14 +529,13 @@ NABoolean ValueId::isAddedColumnWithNonNullDefault() const{
   default:
       break;
   }
-  if (nac && nac->isAddedColumn() && nac->getDefaultValue())
+  if (nac &&  nac->getDefaultValue() && nac->getDefaultClass()!=COM_NULL_DEFAULT && nac->getDefaultClass()!=COM_CURRENT_DEFAULT)
       return TRUE;
   else
       return FALSE;
 }
 
 
-
 // Since we *can* have an INSTANTIATE_NULL inside a VEG_REFERENCE, a loop
 // was required for the function below.
 //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/optimizer/ValueDesc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ValueDesc.h b/core/sql/optimizer/ValueDesc.h
index 559588b..b0e7300 100644
--- a/core/sql/optimizer/ValueDesc.h
+++ b/core/sql/optimizer/ValueDesc.h
@@ -194,9 +194,9 @@ public:
   NABoolean isSaltColumn() const;
 
   // return TRUE if I am a ValueId associated with an Index Column, or
-  // a base column , and I am an added column with a default value that is not
-  // null.
-  NABoolean isAddedColumnWithNonNullDefault() const;
+  // a base column , and I am a column with a default value that is not
+  // null or not Current.
+  NABoolean isColumnWithNonNullNonCurrentDefault() const;
 
   // ---------------------------------------------------------------------
   // change the ValueId's type to the given type

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/ElemDDLNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.cpp b/core/sql/parser/ElemDDLNode.cpp
index 3e9b21b..ebb56e0 100644
--- a/core/sql/parser/ElemDDLNode.cpp
+++ b/core/sql/parser/ElemDDLNode.cpp
@@ -1403,6 +1403,12 @@ ElemDDLNode::castToStmtDDLAlterTableAlterColumnDatatype()
   return NULL;
 }
 
+StmtDDLAlterTableAlterColumnRename *
+ElemDDLNode::castToStmtDDLAlterTableAlterColumnRename()
+{
+  return NULL;
+}
+
 StmtDDLAlterTableAlterColumnSetSGOption *
 ElemDDLNode::castToStmtDDLAlterTableAlterColumnSetSGOption()
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/ElemDDLNode.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.h b/core/sql/parser/ElemDDLNode.h
index e1d540a..e873a11 100644
--- a/core/sql/parser/ElemDDLNode.h
+++ b/core/sql/parser/ElemDDLNode.h
@@ -275,6 +275,7 @@ class StmtDDLAlterTablePartition;
 class StmtDDLAlterTableRename;
 class StmtDDLAlterTableNamespace;
 class StmtDDLAlterTableAlterColumnDatatype;
+class StmtDDLAlterTableAlterColumnRename;
 class StmtDDLAlterTableAlterColumnDefaultValue;
 class StmtDDLAlterTableAlterColumnSetSGOption;
 class StmtDDLAlterTableSetConstraint;
@@ -606,6 +607,8 @@ public:
                 castToStmtDDLAlterTableAlterColumnDefaultValue();
   virtual StmtDDLAlterTableAlterColumnDatatype* 
                 castToStmtDDLAlterTableAlterColumnDatatype();
+  virtual StmtDDLAlterTableAlterColumnRename* 
+                castToStmtDDLAlterTableAlterColumnRename();
   virtual StmtDDLAlterTableSetConstraint*
                 castToStmtDDLAlterTableSetConstraint();
   virtual StmtDDLAlterTableToggleConstraint*

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/ParKeyWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp
index b46660e..9e52923 100644
--- a/core/sql/parser/ParKeyWords.cpp
+++ b/core/sql/parser/ParKeyWords.cpp
@@ -302,7 +302,6 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("DATE_TRUNC",         TOK_DATE_TRUNC,  NONRESTOKEN_),
   ParKeyWord("DATEDIFF",           TOK_DATEDIFF,    NONRESTOKEN_),
   ParKeyWord("DATE_SUB",           TOK_DATE_SUB,    NONRESTOKEN_),
-  ParKeyWord("DATEFMT_INTN",       TOK_DATEFMT_INTN, NONRESTOKEN_),
   ParKeyWord("DATEFORMAT",         TOK_DATEFORMAT,  NONRESTOKEN_),
   ParKeyWord("DATETIME",           TOK_DATETIME,    COMPAQ_|RESWORD_|MPWORD_),
   ParKeyWord("DATETIME_CODE",      TOK_DATETIME_CODE, NONRESTOKEN_),
@@ -620,6 +619,7 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("LZO",                TOK_LZO,         NONRESTOKEN_),
   ParKeyWord("M",                  TOK_M,           NONRESTOKEN_),
   ParKeyWord("MAINTAIN",           TOK_MAINTAIN,    SECOND_|COMPAQ_|RESWORD_),
+  ParKeyWord("MANAGEMENT",         TOK_MANAGEMENT,  NONRESTOKEN_),
   ParKeyWord("MANUAL",             TOK_MANUAL,      FLAGSNONE_),
   ParKeyWord("MAP",                TOK_MAP,         COMPAQ_|RESWORD_),
   ParKeyWord("MASTER",             TOK_MASTER,      NONRESTOKEN_),
@@ -1089,9 +1089,10 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("TO_CHAR",            TOK_TO_CHAR,     NONRESTOKEN_),
   ParKeyWord("TO_DATE",            TOK_TO_DATE,     NONRESTOKEN_),
   ParKeyWord("TO_NUMBER",          TOK_TO_NUMBER,   NONRESTOKEN_),
-  ParKeyWord("TO_TIMESTAMP",          TOK_TO_TIMESTAMP,   NONRESTOKEN_),
+  ParKeyWord("TO_TIME",            TOK_TO_TIME,   NONRESTOKEN_),
+  ParKeyWord("TO_TIMESTAMP",       TOK_TO_TIMESTAMP,   NONRESTOKEN_),
   ParKeyWord("TOKENSTR",           TOK_TOKENSTR,    NONRESTOKEN_),
-  ParKeyWord("TRAFODION",             TOK_TRAFODION,    NONRESTOKEN_),
+  ParKeyWord("TRAFODION",          TOK_TRAFODION,    NONRESTOKEN_),
   ParKeyWord("TRAILING",           TOK_TRAILING,    ANS_|RESWORD_|MPWORD_),
   ParKeyWord("TRANSACTION",        TOK_TRANSACTION, ANS_|RESWORD_),
   ParKeyWord("TRANSFORM",          TOK_TRANSFORM,   NONRESTOKEN_),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/StmtDDLAlterTableAlterColumn.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLAlterTableAlterColumn.cpp b/core/sql/parser/StmtDDLAlterTableAlterColumn.cpp
index b2c1f9c..cb68092 100644
--- a/core/sql/parser/StmtDDLAlterTableAlterColumn.cpp
+++ b/core/sql/parser/StmtDDLAlterTableAlterColumn.cpp
@@ -51,7 +51,6 @@ StmtDDLAlterTableAlterColumn::getText() const
 }
 	
 
-
 //----------------------------------------------------------------------------
 // CLASS StmtDDLAlterTableAlterColumnDatatype
 //----------------------------------------------------------------------------
@@ -96,6 +95,44 @@ StmtDDLAlterTableAlterColumnDatatype::getText() const
   return "StmtDDLAlterTableAlterColumnDatatype" ;
 }
 	
+//----------------------------------------------------------------------------
+// CLASS StmtDDLAlterTableAlterColumnRename
+//----------------------------------------------------------------------------
+StmtDDLAlterTableAlterColumnRename::StmtDDLAlterTableAlterColumnRename( 
+     const NAString &columnName,
+     const NAString &renamedColumnName,
+     CollHeap *heap)
+    : StmtDDLAlterTableAlterColumn(DDL_ALTER_TABLE_ALTER_COLUMN_RENAME, 
+                                   columnName,
+                                   NULL,
+                                   heap),
+      renamedColumnName_(renamedColumnName)
+{
+}
+
+//
+// Virtual destructor
+//
+
+StmtDDLAlterTableAlterColumnRename::~StmtDDLAlterTableAlterColumnRename()
+{}
+
+//
+// Cast function: to provide the safe castdown to the current object
+//
+
+StmtDDLAlterTableAlterColumnRename *
+StmtDDLAlterTableAlterColumnRename::castToStmtDDLAlterTableAlterColumnRename()
+{
+  return this;
+}
+
+const NAString
+StmtDDLAlterTableAlterColumnRename::getText() const
+{
+  return "StmtDDLAlterTableAlterColumnRename" ;
+}
+	
 
 //----------------------------------------------------------------------------
 // CLASS StmtDDLAlterTableAlterColumnDefaultValue

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/StmtDDLAlterTableAlterColumn.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLAlterTableAlterColumn.h b/core/sql/parser/StmtDDLAlterTableAlterColumn.h
index 7ad20de..ecb2178 100644
--- a/core/sql/parser/StmtDDLAlterTableAlterColumn.h
+++ b/core/sql/parser/StmtDDLAlterTableAlterColumn.h
@@ -135,7 +135,6 @@ private:
 
 }; // class StmtDDLAlterTableAlterColumnDefaultValue
 
-
 // -----------------------------------------------------------------------
 // definition of class StmtDDLAlterTableAlterColumnDatatype
 // -----------------------------------------------------------------------
@@ -178,4 +177,43 @@ private:
 
 }; // class StmtDDLAlterTableAlterColumnDatatype
 
+// -----------------------------------------------------------------------
+// definition of class StmtDDLAlterTableAlterColumnRename
+// -----------------------------------------------------------------------
+class StmtDDLAlterTableAlterColumnRename : public StmtDDLAlterTableAlterColumn
+{
+public:
+  
+  // constructor
+  StmtDDLAlterTableAlterColumnRename( const NAString &columnName,
+                                      const NAString &renamedColumnName,
+                                      CollHeap    * heap = PARSERHEAP());
+  
+  // virtual destructor
+  virtual ~StmtDDLAlterTableAlterColumnRename();
+  
+  // cast
+  virtual StmtDDLAlterTableAlterColumnRename * castToStmtDDLAlterTableAlterColumnRename();
+  
+  // accessors
+  NAString getRenamedColumnName() { return renamedColumnName_; }
+  const NAString getRenamedColumnName() const { return renamedColumnName_; }
+  
+  // method for tracing
+  virtual const NAString getText() const;
+  
+private: 
+  // column name
+  NAString renamedColumnName_;
+  
+  //
+  // please do not use the following methods
+  //
+  
+  StmtDDLAlterTableAlterColumnRename();   // DO NOT USE
+  StmtDDLAlterTableAlterColumnRename(const StmtDDLAlterTableAlterColumnRename &);   // DO NOT USE
+  StmtDDLAlterTableAlterColumnRename & operator=(const StmtDDLAlterTableAlterColumnRename &);  // DO NOT USE
+  
+}; // class StmtDDLAlterTableAlterColumnRename
+
 #endif //STMTDDLALTERTABLEALTERCOLUMN_H

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index e565f14..dc1a323a 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -182,6 +182,7 @@ using namespace std;
 
 #include "exp_expr.h"
 #include "exp_clause_derived.h"
+#include "exp_datetime.h"
 #include "Analyzer.h"
 
 
@@ -589,7 +590,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_DATE_TRUNC
 %token <tokval> TOK_DATEDIFF
 %token <tokval> TOK_DATEFORMAT          /* Tandem extension */
-%token <tokval> TOK_DATEFMT_INTN        /* Tandem extension */
 %token <tokval> TOK_DATETIME            /* Tandem extension non-reserved word */
 %token <tokval> TOK_DAY
 %token <tokval> TOK_DAYNAME
@@ -818,6 +818,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_LSDECIMAL
 %token <tokval> TOK_LTRIM               /*  ODBC extension  */
 %token <tokval> TOK_MAINTAIN
+%token <tokval> TOK_MANAGEMENT
 %token <tokval> TOK_MANUAL				// MV
 %token <tokval> TOK_MASTER
 %token <tokval> TOK_MATCH
@@ -1113,6 +1114,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_TO_CHAR
 %token <tokval> TOK_TO_DATE
 %token <tokval> TOK_TO_NUMBER
+%token <tokval> TOK_TO_TIME
 %token <tokval> TOK_TO_TIMESTAMP
 %token <tokval> TOK_TOKENSTR
 %token <tokval> TOK_TRAILING
@@ -2007,7 +2009,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <item>                    insert_obj_to_lob_function
 %type <item>                    update_obj_to_lob_function
 %type <item>                    select_lob_to_obj_function
-%type <tokval>    		date_format
+%type <stringval>    		date_format
 %type <tokval>    		trim_spec
 %type <na_type>   		proc_arg_data_type
 %type <na_type>   		data_type
@@ -2492,6 +2494,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <pStmtDDL>  		alter_table_alter_column_default_value 
 %type <pStmtDDL>  		alter_table_alter_column_datatype
 %type <pStmtDDL>  		alter_table_alter_column_set_sg_option 
+%type <pStmtDDL>  		alter_table_alter_column_rename
 %type <boolean>   		alter_column_type //++ MV
 %type <pStmtDDL>  		alter_table_set_constraint_clause
 %type <pStmtDDL>                alter_table_disable_constraint_clause
@@ -3217,7 +3220,7 @@ literal :       numeric_literal
                       $$ = new (PARSERHEAP()) ConstValue
                         (*$1, getStringCharSet(&$1));
                       SqlParser_CurrentParser->collectItem4HQC($$);	
-		      $$ = new (PARSERHEAP()) Format($$, *$6, TRUE);
+                      $$ = new (PARSERHEAP()) DateFormat($$, *$6, DateFormat::FORMAT_TO_DATE);
 		    }
 		  else
 		    {
@@ -3225,7 +3228,7 @@ literal :       numeric_literal
 		      if (! $$) YYERROR;
                       SqlParser_CurrentParser->collectItem4HQC($$);
 		      restoreInferCharsetState();
-		      $$ = new (PARSERHEAP()) Format($$, *$6, FALSE);
+                      $$ = new (PARSERHEAP()) DateFormat($$, *$6, DateFormat::FORMAT_TO_CHAR);
 		    }
 
                 }
@@ -7912,7 +7915,7 @@ primary :     '(' value_expression ')'
 	      | dml_column_reference TOK_LPAREN_BEFORE_DATE_COMMA_AND_FORMAT TOK_DATE ',' TOK_FORMAT character_string_literal ')'
                 {
                   // DEFAULT_CHARSET has no effect on character_string_literal in this context
-		  $$ = new (PARSERHEAP()) Format($1, *$6, FALSE);
+                  $$ = new (PARSERHEAP()) DateFormat($1, *$6, DateFormat::FORMAT_TO_CHAR);
 		}
 
               | hostvar_expression
@@ -8460,23 +8463,11 @@ datetime_misc_function : TOK_CONVERTTIMESTAMP '(' value_expression ')'
 				}
      | TOK_DATEFORMAT '(' value_expression ',' date_format  ')'
                                 {
-                                  if ( (SqlParser_DEFAULT_CHARSET == CharInfo::ISO88591) ||
-                                       (CmpCommon::getDefault(ALLOW_IMPLICIT_CHAR_CASTING) == DF_ON) )
-                                  {
-                                    $$ = new (PARSERHEAP())
-                                      DateFormat($3, NULL, $5);
-                                  }
-                                  else
-                                  {
-                                      $$ = new (PARSERHEAP()) ZZZBinderFunction( ITM_DATEFMT,
-                                           $3, new (PARSERHEAP()) ConstValue($5) );
-                                  }
+                                  $$ = new (PARSERHEAP()) 
+                                    DateFormat($3, *$5, 
+                                               DateFormat::FORMAT_TO_CHAR,
+                                               TRUE);
                                 }
-     | TOK_DATEFMT_INTN '(' value_expression ',' date_format  ')'
-				{
-				  $$ = new (PARSERHEAP())
-				    DateFormat($3, NULL, $5);
-				}
 				    
      | TOK_DAYOFWEEK '(' value_expression ')'
 				{
@@ -8583,29 +8574,24 @@ datetime_misc_function : TOK_CONVERTTIMESTAMP '(' value_expression ')'
                                 }
     | TOK_TO_CHAR '(' value_expression ',' character_string_literal ')'
                                {
-				 CheckModeSpecial3;
-
 				 $$ = new (PARSERHEAP()) 
-				   Format($3, *$5, FALSE, Format::FORMAT_TO_CHAR);
+                                   DateFormat($3, *$5, DateFormat::FORMAT_TO_CHAR);
 			       }
     | TOK_TO_CHAR '(' value_expression ')'
                                {
-				 CheckModeSpecial4;
-                                 $$ = $3;
+                                 $$ = new (PARSERHEAP()) DateFormat
+                                   ($3, "YYYY-MM-DD", DateFormat::FORMAT_TO_CHAR);
+
 			       }
     | TOK_TO_DATE '(' value_expression ',' character_string_literal ')'
                                {
-				 CheckModeSpecial3;
-
-				 $$ = new (PARSERHEAP()) 
-				   Format($3, *$5, TRUE, Format::FORMAT_TO_DATE);
+                                 $$ = new (PARSERHEAP()) 
+                                   DateFormat($3, *$5, DateFormat::FORMAT_TO_DATE);
 			       }
    | TOK_TO_DATE '(' value_expression  ')'
                                {
-				 CheckModeSpecial4;
-
 				 $$ = new (PARSERHEAP()) 
-				   Format($3, "YYYY-MM-DD", TRUE, Format::FORMAT_TO_DATE);
+				   DateFormat($3, "YYYY-MM-DD", DateFormat::FORMAT_TO_DATE);
 			       }
     | TOK_TO_NUMBER '(' value_expression ')'
                                {
@@ -8614,6 +8600,11 @@ datetime_misc_function : TOK_CONVERTTIMESTAMP '(' value_expression ')'
 				 $$ = new (PARSERHEAP()) 
 				   ZZZBinderFunction(ITM_TO_NUMBER, $3);
 			       }
+    | TOK_TO_TIME '(' value_expression ',' character_string_literal ')'
+                               {
+                                 $$ = new (PARSERHEAP()) 
+                                   DateFormat($3, *$5, DateFormat::FORMAT_TO_DATE);
+			       }
     | TOK_TO_TIMESTAMP '(' value_expression ')'
                                {
 				 CheckModeSpecial4;
@@ -10321,10 +10312,19 @@ trim_spec : TOK_LEADING     {  $$ = (Int32) Trim::LEADING;  }
 
 
 
-/* type uint */
-date_format : TOK_DEFAULT   {  $$ = (Int32) DateFormat::DEFAULT;  }
-	| TOK_EUROPEAN      {  $$ = (Int32) DateFormat::EUROPEAN; }
-	| TOK_USA           {  $$ = (Int32) DateFormat::USA;      }
+/* type stringval */
+date_format : TOK_DEFAULT   
+    {  
+      $$ = new (PARSERHEAP()) NAString(ExpDatetime::getDatetimeFormatStr(ExpDatetime::DATETIME_FORMAT_DEFAULT));
+    }
+	| TOK_EUROPEAN      
+    {  
+      $$ = new (PARSERHEAP()) NAString(ExpDatetime::getDatetimeFormatStr(ExpDatetime::DATETIME_FORMAT_EUROPEAN));
+    }
+	| TOK_USA           
+    {  
+      $$ = new (PARSERHEAP()) NAString(ExpDatetime::getDatetimeFormatStr(ExpDatetime::DATETIME_FORMAT_USA));
+    }
 
 
 /* type item */
@@ -16127,6 +16127,57 @@ exe_util_init_hbase : TOK_INITIALIZE TOK_TRAFODION
 
                }
 
+             | TOK_INITIALIZE TOK_TRAFODION ',' TOK_CREATE TOK_LIBRARY TOK_MANAGEMENT
+               {
+		 CharInfo::CharSet stmtCharSet = CharInfo::UnknownCharSet;
+		 NAString * stmt = getSqlStmtStr ( stmtCharSet  // out - CharInfo::CharSet &
+					         , PARSERHEAP() 
+	                                         );
+
+		 DDLExpr * de = new(PARSERHEAP()) DDLExpr(NULL,
+                                                          (char*)stmt->data(),
+                                                           stmtCharSet);
+
+                 de->setCreateLibmgr(TRUE);
+
+                 $$ = de;
+
+               }
+
+             | TOK_INITIALIZE TOK_TRAFODION ',' TOK_DROP TOK_LIBRARY TOK_MANAGEMENT
+               {
+                 CharInfo::CharSet stmtCharSet = CharInfo::UnknownCharSet;
+                 NAString * stmt = getSqlStmtStr ( stmtCharSet  // out - CharInfo::CharSet &
+                                                 , PARSERHEAP()
+                                                 );
+
+                 DDLExpr * de = new(PARSERHEAP()) DDLExpr(NULL,
+                                                          (char*)stmt->data(),
+                                                          stmtCharSet);
+
+                 de->setDropLibmgr(TRUE);
+
+                 $$ = de;
+
+               }
+
+             | TOK_INITIALIZE TOK_TRAFODION ',' TOK_UPGRADE TOK_LIBRARY TOK_MANAGEMENT
+               {
+                 CharInfo::CharSet stmtCharSet = CharInfo::UnknownCharSet;
+                 NAString * stmt = getSqlStmtStr ( stmtCharSet  // out - CharInfo::CharSet &
+                                                 , PARSERHEAP()
+                                                 );
+
+                 DDLExpr * de = new(PARSERHEAP()) DDLExpr(NULL,
+                                                          (char*)stmt->data(),
+                                                          stmtCharSet);
+
+                 de->setUpgradeLibmgr(TRUE);
+
+                 $$ = de;
+
+               }
+
             | TOK_INITIALIZE TOK_TRAFODION ',' TOK_CREATE TOK_REPOSITORY
                {
 		 CharInfo::CharSet stmtCharSet = CharInfo::UnknownCharSet;
@@ -28693,6 +28744,8 @@ before_trigger_prefix: create_trigger_keywords ddl_qualified_name
              TOK_BEFORE iud_event optional_update_column_list TOK_ON
              ddl_qualified_name referencing_clause before_action_orientation
              {
+               *SqlParser_Diags << DgSqlCode(-3131);
+               YYERROR;
 
 		InsideTriggerDefinition = TRUE;
 
@@ -28767,6 +28820,9 @@ after_trigger_prefix: create_trigger_keywords ddl_qualified_name
              TOK_AFTER iud_event optional_update_column_list TOK_ON
              ddl_qualified_name referencing_clause after_action_orientation
              {
+               *SqlParser_Diags << DgSqlCode(-3131);
+               YYERROR;
+
 		InsideTriggerDefinition = TRUE;
 
 	     //  if (NonISO88591LiteralEncountered) {
@@ -29047,6 +29103,9 @@ mv_definition: create_mv_keywords ddl_qualified_name
                 optional_in_memory_clause
                 as_token query_expression
     {
+      *SqlParser_Diags << DgSqlCode(-3131);
+      YYERROR;
+
       RelRoot *top = finalize($11);
       ForUpdateSpec spec(FALSE);
       spec.finalizeUpdatability(top);
@@ -29176,6 +29235,9 @@ create_mv_keywords: TOK_CREATE optional_ghost mv_token
 // type pStmtDDL 
 create_mvrgroup_statement : TOK_CREATE TOK_MVGROUP ddl_qualified_name
 {
+  *SqlParser_Diags << DgSqlCode(-3131);
+  YYERROR;
+
   $$ = new (PARSERHEAP())StmtDDLCreateMvRGroup(*$3);
   delete $3;
 }
@@ -30590,10 +30652,13 @@ alter_view_statement : TOK_ALTER TOK_VIEW ddl_qualified_name
 // type pStmtDDL
 alter_mv_statement : TOK_ALTER optional_ghost mv_token alter_mv_body
 					 {
-						 $4->castToStmtDDLAlterMV()->synthesize();
-						 $$ = $4 /*alter_mv_body*/;
-                                                 if ($2) /*optional_ghost*/
-                                                   $$->setIsGhostObject(TRUE);
+                                           *SqlParser_Diags << DgSqlCode(-3131);
+                                           YYERROR;
+                                           
+                                           $4->castToStmtDDLAlterMV()->synthesize();
+                                           $$ = $4 /*alter_mv_body*/;
+                                           if ($2) /*optional_ghost*/
+                                             $$->setIsGhostObject(TRUE);
 					 }
 
 
@@ -31167,9 +31232,11 @@ alter_table_action : add_table_constraint_definition
 		      | alter_table_alter_column_datatype
 			{
       				$$ = $1;
-
 			}
-			
+		      | alter_table_alter_column_rename
+			{
+      				$$ = $1;
+			}
 		      | alter_table_alter_column_default_value 
 			{
       				$$ = $1;
@@ -31248,6 +31315,18 @@ alter_table_alter_column_default_value : TOK_ALTER TOK_COLUMN column_name TOK_DE
                 		       delete $3;
 			       	       restoreInferCharsetState();
 				}
+
+// type pStmtDDL
+alter_table_alter_column_rename : TOK_ALTER TOK_COLUMN column_name TOK_RENAME TOK_TO column_name
+				{
+				  $$ = new (PARSERHEAP())
+                                    StmtDDLAlterTableAlterColumnRename(
+                                         *$3,  // column name
+                                         *$6); // renamed column name
+                                  delete $3;
+                                  delete $6;
+                                  restoreInferCharsetState();
+				}
 				
 // type pStmtDDL
 alter_table_alter_column_set_sg_option : TOK_ALTER TOK_COLUMN column_name TOK_SET sequence_generator_options
@@ -31795,6 +31874,9 @@ drop_table_start_tokens : TOK_DROP TOK_TABLE
 // MV - RG
 drop_mvrgroup_statement : TOK_DROP TOK_MVGROUP ddl_qualified_name
 {
+  *SqlParser_Diags << DgSqlCode(-3131);
+  YYERROR;
+
   $$ = new (PARSERHEAP())StmtDDLDropMvRGroup(*$3);
   delete $3;
 }
@@ -31803,6 +31885,9 @@ drop_mvrgroup_statement : TOK_DROP TOK_MVGROUP ddl_qualified_name
 drop_trigger_statement : TOK_DROP TOK_TRIGGER ddl_qualified_name 
                          optional_cleanup optional_validate optional_logfile
                 {
+                  *SqlParser_Diags << DgSqlCode(-3131);
+                  YYERROR;
+
                   /* If VALIDATE, or LOG option specified, */
                   /* ALLOW_SPECIALTABLETYPE must also be specified  */
                   if (($5 || $6) &&
@@ -31831,6 +31916,9 @@ drop_trigger_statement : TOK_DROP TOK_TRIGGER ddl_qualified_name
 drop_mv_statement : TOK_DROP optional_ghost mv_token ddl_qualified_name optional_cleanup
                     optional_drop_behavior optional_validate optional_logfile
                 {
+                  *SqlParser_Diags << DgSqlCode(-3131);
+                  YYERROR;
+
                   /* If VALIDATE, or LOG option specified, */
                   /* ALLOW_SPECIALTABLETYPE must also be specified  */
                   if (($7 || $8) &&
@@ -33147,6 +33235,7 @@ nonreserved_word :      TOK_ABORT
                       | TOK_SEQUENCES
                       | TOK_SINCE
 //		      | TOK_MAINTAIN
+                      | TOK_MANAGEMENT
 		      | TOK_MANUAL
 		      | TOK_MIXED
 		      | TOK_MVS  // MV
@@ -33209,7 +33298,6 @@ nonreserved_func_word:  TOK_ABS
                       | TOK_D_RANK 
                       | TOK_DATABASE
                       | TOK_DATEFORMAT
-                      | TOK_DATEFMT_INTN
                       | TOK_DAYNAME
                       | TOK_DAYOFMONTH
                       | TOK_DAYOFWEEK
@@ -33305,6 +33393,7 @@ nonreserved_func_word:  TOK_ABS
                       | TOK_TO_CHAR
                       | TOK_TO_DATE
                       | TOK_TO_NUMBER
+                      | TOK_TO_TIME
                       | TOK_TO_TIMESTAMP
                       | TOK_TRUNC
                       | TOK_TRUNCATE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/DIFF012.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/DIFF012.KNOWN.SB b/core/sql/regress/charsets/DIFF012.KNOWN.SB
index 72130ac..7dadfad 100644
--- a/core/sql/regress/charsets/DIFF012.KNOWN.SB
+++ b/core/sql/regress/charsets/DIFF012.KNOWN.SB
@@ -1,2 +1,2 @@
-125d124
+126d125
 < good day_suffix

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED002
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED002 b/core/sql/regress/charsets/EXPECTED002
index 3d40878..18f1eed 100755
--- a/core/sql/regress/charsets/EXPECTED002
+++ b/core/sql/regress/charsets/EXPECTED002
@@ -92,7 +92,7 @@
 >>--no UCS2 strings in a view text
 >>create view nt006v1 as select * from t013 where c > _UCS2'aaaa';
 
-*** ERROR[4082] Object CAT.SCH.T013 does not exist or is inaccessible.
+*** ERROR[4082] Object TRAFODION.SCH.T013 does not exist or is inaccessible.
 
 --- SQL operation failed with errors.
 >>
@@ -108,7 +108,7 @@
 >>create trigger t013t1 after insert on nt008
 +>	update nt008 set i = 7 where i = 9;
 
-*** ERROR[4222] The DDL feature is not supported in this software version.
+*** ERROR[3131] The statement just entered is currently not supported.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -116,7 +116,7 @@
 >>create trigger t013t2 after insert on nt008
 +>	update nt007 set d = _UCS2'qwer' where d = _UCS2'aaaa';
 
-*** ERROR[4222] The DDL feature is not supported in this software version.
+*** ERROR[3131] The statement just entered is currently not supported.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -143,11 +143,12 @@
 --- SQL operation complete.
 >>invoke t013;
 
--- Definition of table CAT.SCH.T013
--- Definition current  Fri Jul 23 16:05:50 2010
+-- Definition of Trafodion table TRAFODION.SCH.T013
+-- Definition current  Sun Mar 20 15:28:28 2016
 
   (
-    A                                CHAR(10) CHARACTER SET UCS2 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                CHAR(10) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT _UCS2'aa'
   )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED003
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED003 b/core/sql/regress/charsets/EXPECTED003
index af07866..4aad76f 100755
--- a/core/sql/regress/charsets/EXPECTED003
+++ b/core/sql/regress/charsets/EXPECTED003
@@ -11,18 +11,19 @@
 >>--INVOKE and SHOWDDL work for tables with columns associated with UCS2.
 >>invoke t002;
 
--- Definition of table CAT.SCH.T002
--- Definition current  Fri Apr 23 14:40:12 2010
+-- Definition of Trafodion table TRAFODION.SCH.T002
+-- Definition current  Thu Feb 25 10:23:15 2016
 
   (
-    C                                CHAR(10) CHARACTER SET UCS2 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                CHAR(10) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT NULL
   )
 
 --- SQL operation complete.
 >>showddl t002;
 
-CREATE TABLE CAT.SCH.T002
+CREATE TABLE TRAFODION.SCH.T002
   (
     C                                CHAR(10) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT NULL
@@ -71,7 +72,7 @@ ucs2      iso88591  xxxx
 
 *** ERROR[15001] A syntax error occurred at or before: 
 insert into t002 values(_UNICODE'asdf');
-                        ^ (25 characters from start of SQL statement)
+                              ^ (31 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 


[27/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED312
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED312 b/core/sql/regress/charsets/EXPECTED312
index 29f1911..50ece35 100644
--- a/core/sql/regress/charsets/EXPECTED312
+++ b/core/sql/regress/charsets/EXPECTED312
@@ -5615,7 +5615,10 @@ u1u1      u1u1
 >>create TRIGGER TRG1_cs312t90   before UPDATE on cs312t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UTF8_col2 = _ISO88591'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs312t90 values('Test1','Test1','Test1','Test1'), ('test111','test1111','test111','test1111');
 
@@ -5628,7 +5631,7 @@ u1u1      u1u1
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                 abc                                   Test1                                 Iso1                                
+Test1                                 Test1                                 Test1                                 Iso1                                
 test111                               test1111                              test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5641,7 +5644,7 @@ test111                               test1111                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                 abc                                   Test1                                 Iso1                                
+Test1                                 Test1                                 Test1                                 Iso1                                
 test111                               test1111                              test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5657,8 +5660,8 @@ test111                               test1111                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 
@@ -5672,8 +5675,8 @@ test222                               test2222                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 
@@ -5690,9 +5693,9 @@ test222                               test2222                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5707,9 +5710,9 @@ test333                               test3333                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5718,11 +5721,17 @@ test333                               test3333                              test
 >>--
 >>DROP TRIGGER TRG1_cs312t90;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs312t90   before UPDATE on cs312t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _utf8'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs312t90 values('Test4','Test4','Test4','Test4'), ('test444','test4444','test444','test4444');
 
@@ -5735,10 +5744,10 @@ test333                               test3333                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5754,10 +5763,10 @@ test444                               test4444                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5776,11 +5785,11 @@ test444                               test4444                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
-Test5                                 Test5                                 UCS5                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
+Test5                                 Test5                                 UCS5                                  Test5                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5797,11 +5806,11 @@ test555                               test5555                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
-Test5                                 Test5                                 UCS5                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
+Test5                                 Test5                                 UCS5                                  Test5                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5821,12 +5830,12 @@ test555                               test5555                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Iso6                                  Test6                                 Test6                                 abc                                 
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
-Test5                                 Test5                                 UCS5                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Iso6                                  Test6                                 Test6                                 Test6                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
+Test5                                 Test5                                 UCS5                                  Test5                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5844,12 +5853,12 @@ test666                               test6666                              test
 UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                  abc                                   Test3                                 Test3                               
-Iso6                                  Test6                                 Test6                                 abc                                 
-Test1                                 abc                                   Test1                                 Iso1                                
-Test2                                 abc                                   Test2                                 UTF8                                
-Test4                                 Test4                                 Iso4                                  abc                                 
-Test5                                 Test5                                 UCS5                                  abc                                 
+Iso3                                  Test3                                 Test3                                 Test3                               
+Iso6                                  Test6                                 Test6                                 Test6                               
+Test1                                 Test1                                 Test1                                 Iso1                                
+Test2                                 Test2                                 Test2                                 UTF8                                
+Test4                                 Test4                                 Iso4                                  Test4                               
+Test5                                 Test5                                 UCS5                                  Test5                               
 test111                               test1111                              test111                               test1111                            
 test222                               test2222                              test222                               test2222                            
 test333                               test3333                              test333                               test3333                            
@@ -5875,7 +5884,10 @@ test666                               test6666                              test
 >>create TRIGGER TRG1_cs312t91   before UPDATE on cs312t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UTF8_col2 = _ISO88591'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs312t91 values(1,'Test1','Test1','Test1','Test1'), (2,'test111','test1111','test111','test1111');
 
@@ -5888,7 +5900,7 @@ test666                               test6666                              test
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5901,7 +5913,7 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5917,9 +5929,9 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -5932,9 +5944,9 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -5950,11 +5962,11 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
 
 --- 6 row(s) selected.
@@ -5967,22 +5979,28 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
 
 --- 6 row(s) selected.
 >>--
 >>DROP TRIGGER TRG1_cs312t91;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs312t91   before UPDATE on cs312t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _utf8'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs312t91 values(7,'Test4','Test4','Test4','Test4'), (8,'test444','test4444','test444','test4444');
 
@@ -5995,13 +6013,13 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -6014,13 +6032,13 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -6036,15 +6054,15 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
-          9  Test5                                 Test5                                 UCS5                                  abc                                 
+          9  Test5                                 Test5                                 UCS5                                  Test5                               
          10  test555                               test5555                              test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -6057,15 +6075,15 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
-          9  Test5                                 Test5                                 UCS5                                  abc                                 
+          9  Test5                                 Test5                                 UCS5                                  Test5                               
          10  test555                               test5555                              test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -6081,17 +6099,17 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
-          9  Test5                                 Test5                                 UCS5                                  abc                                 
+          9  Test5                                 Test5                                 UCS5                                  Test5                               
          10  test555                               test5555                              test555                               test5555                            
-         11  Iso6                                  Test6                                 Test6                                 abc                                 
+         11  Iso6                                  Test6                                 Test6                                 Test6                               
          12  test666                               test6666                              test666                               test6666                            
 
 --- 12 row(s) selected.
@@ -6104,17 +6122,17 @@ PRKY         UTF8_COL1                             UTF8_COL2
 PRKY         UTF8_COL1                             UTF8_COL2                             ISO_COL1                              ISO_COL2
 -----------  ------------------------------------  ------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                 abc                                   Test1                                 Iso1                                
+          1  Test1                                 Test1                                 Test1                                 Iso1                                
           2  test111                               test1111                              test111                               test1111                            
-          3  Test2                                 abc                                   Test2                                 UTF8                                
+          3  Test2                                 Test2                                 Test2                                 UTF8                                
           4  test222                               test2222                              test222                               test2222                            
-          5  Iso3                                  abc                                   Test3                                 Test3                               
+          5  Iso3                                  Test3                                 Test3                                 Test3                               
           6  test333                               test3333                              test333                               test3333                            
-          7  Test4                                 Test4                                 Iso4                                  abc                                 
+          7  Test4                                 Test4                                 Iso4                                  Test4                               
           8  test444                               test4444                              test444                               test4444                            
-          9  Test5                                 Test5                                 UCS5                                  abc                                 
+          9  Test5                                 Test5                                 UCS5                                  Test5                               
          10  test555                               test5555                              test555                               test5555                            
-         11  Iso6                                  Test6                                 Test6                                 abc                                 
+         11  Iso6                                  Test6                                 Test6                                 Test6                               
          12  test666                               test6666                              test666                               test6666                            
 
 --- 12 row(s) selected.


[13/50] [abbrv] incubator-trafodion git commit: fix classpath

Posted by db...@apache.org.
fix classpath


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

Branch: refs/heads/master
Commit: f9f37487146fc398912e562501767330adb2727b
Parents: accd157
Author: mashengchen <ma...@gmail.com>
Authored: Wed Mar 16 14:13:20 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Wed Mar 16 14:13:20 2016 +0000

----------------------------------------------------------------------
 core/sqf/sqenvcom.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f9f37487/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index a640793..4364d2e 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -154,26 +154,23 @@ export HBASE_TRX_ID_HDP=hbase-trx-hdp2_3
 # general Hadoop & TRX dependencies - not distro specific, choose one to build against
 export HBASE_TRXDIR=$MY_SQROOT/export/lib
 export HBASE_TRX_JAR=${HBASE_TRX_ID_CDH}-${TRAFODION_VER}.jar
-if [[ "$HBASE_DISTRO" = "HDP" ]]; then
-    export HBASE_TRX_JAR=${HBASE_TRX_ID_HDP}-${TRAFODION_VER}.jar
-fi
-if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
-    export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
-fi
 export DTM_COMMON_JAR=trafodion-dtm-${TRAFODION_VER}.jar
 export SQL_JAR=trafodion-sql-${TRAFODION_VER}.jar
+export UTIL_JAR=trafodion-utility-${TRAFODION_VER}.jar
+
 HBVER=""
 if [[ "$HBASE_DISTRO" = "HDP" ]]; then
+    export HBASE_TRX_JAR=${HBASE_TRX_ID_HDP}-${TRAFODION_VER}.jar
     HBVER="hdp2_3"
     export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
     export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
 if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
+    export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
     HBVER="apache1_0_2"
     export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
     export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
-export UTIL_JAR=trafodion-utility-${TRAFODION_VER}.jar
 
 # check for workstation env
 # want to make sure SQ_VIRTUAL_NODES is set in the shell running sqstart
@@ -381,6 +378,10 @@ elif [[ -n "$(ls /etc/init.d/ambari* 2>/dev/null)" ]]; then
   export HIVE_JAR_FILES="/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core*.jar"
 
   export HBASE_TRX_JAR=${HBASE_TRX_ID_HDP}-${TRAFODION_VER}.jar
+  HBVER="hdp2_3"
+  export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
+  export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
+  
   # Configuration directories
 
   export HADOOP_CNF_DIR=/etc/hadoop/conf
@@ -573,6 +574,9 @@ EOF
 
     # end of code for Apache Hadoop/HBase installation w/o distro
     export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
+    HBVER="apache1_0_2"
+    export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
+    export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
   else
     # print usage information, not enough information about Hadoop/HBase
     vanilla_apache_usage


[46/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
update


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

Branch: refs/heads/master
Commit: c86d23852d44e7982b4ddcb303a0148d33da8d1c
Parents: fcc02bc
Author: mashengchen <ma...@gmail.com>
Authored: Mon Mar 28 08:38:19 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Mon Mar 28 08:38:19 2016 +0000

----------------------------------------------------------------------
 .../java/org/trafodion/jdbc/t2/BaseRow.java     |   67 -
 .../java/org/trafodion/jdbc/t2/InsertRow.java   |   89 -
 .../main/java/org/trafodion/jdbc/t2/Row.java    |  275 --
 core/sqf/sqenvcom.sh                            |    4 +-
 core/sqf/sql/scripts/ilh_cleanhb                |  106 +
 core/sqf/sql/scripts/ilh_hbase_repair           |   65 +
 core/sqf/sql/scripts/ilh_hbcheck                |   72 +
 core/sqf/sql/scripts/ilh_traf_restart           |  117 +
 core/sqf/sql/scripts/ilh_trafinit               |  108 +
 .../sql/scripts/install_hadoop_regr_test_env    |    4 +-
 core/sqf/sql/scripts/install_local_hadoop       |    8 +-
 core/sqf/sql/scripts/trafnodestatus             |  105 +
 core/sqf/sql/scripts/trafnodestatus.awk         |   76 +
 core/sqf/tools/sqtools.sh                       |   56 +
 core/sql/bin/SqlciErrors.txt                    |    2 +-
 core/sql/comexe/ComTdbHbaseAccess.h             |   27 +-
 core/sql/executor/ExHbaseSelect.cpp             |   19 +-
 core/sql/generator/GenRelScan.cpp               |    2 +-
 core/sql/generator/Generator.cpp                |    8 +-
 core/sql/optimizer/NATable.cpp                  |    4 +-
 core/sql/parser/ElemDDLCol.cpp                  |  542 ++--
 core/sql/parser/ElemDDLColDef.h                 |   14 +-
 core/sql/parser/StmtDDLCreate.cpp               |    7 +-
 core/sql/parser/sqlparser.y                     |   17 +-
 core/sql/regress/core/EXPECTED131               |   89 +-
 core/sql/regress/core/TEST131                   |   40 +
 core/sql/regress/privs1/EXPECTED133             |  Bin 22984 -> 26383 bytes
 core/sql/regress/privs1/TEST133                 |   97 +-
 core/sql/regress/seabase/EXPECTED010            |    2 +-
 core/sql/regress/seabase/EXPECTED027            |  157 +-
 core/sql/regress/seabase/TEST010                |    2 +-
 core/sql/regress/seabase/TEST027                |   16 +
 core/sql/sqlcomp/CmpSeabaseDDL.h                |    1 +
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |   11 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |  101 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |    8 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |    1 -
 core/sql/ustat/hs_globals.cpp                   |   24 +-
 .../src/asciidoc/_chapters/SQuirrel.adoc        |    8 +-
 .../src/asciidoc/_chapters/about.adoc           |   11 +-
 .../src/asciidoc/_chapters/dbviz.adoc           |   17 +-
 .../src/asciidoc/_chapters/introduction.adoc    |  130 +-
 .../src/asciidoc/_chapters/jdbct4.adoc          |  353 ++-
 .../src/asciidoc/_chapters/odb.adoc             |   49 +-
 .../src/asciidoc/_chapters/odbc_linux.adoc      |   82 +-
 .../src/asciidoc/_chapters/odbc_windows.adoc    |  175 +-
 .../src/asciidoc/_chapters/sample_prog.adoc     |    6 +-
 .../src/asciidoc/_chapters/trafci.adoc          |  323 ++-
 docs/client_install/src/asciidoc/index.adoc     |   11 +-
 .../src/images/win10_edit_path.jpg              |  Bin 0 -> 65094 bytes
 .../src/images/win10_select_java.jpg            |  Bin 0 -> 22758 bytes
 .../src/asciidoc/_chapters/about.adoc           |    4 +-
 .../src/asciidoc/_chapters/commands.adoc        |    8 +-
 .../src/asciidoc/_chapters/install.adoc         |   70 +-
 .../src/asciidoc/_chapters/interactive.adoc     |   56 +-
 .../src/asciidoc/_chapters/introduction.adoc    |   10 +-
 .../src/asciidoc/_chapters/launch.adoc          |  148 +-
 .../src/asciidoc/_chapters/perlpython.adoc      |   72 +-
 .../src/asciidoc/_chapters/scripts.adoc         |   24 +-
 docs/command_interface/src/asciidoc/index.adoc  |    4 +
 .../src/resources/source/sample.pl              |   19 +
 .../src/resources/source/sample.py              |   29 +
 docs/spj_guide/pom.xml                          |  289 +++
 .../spj_guide/src/asciidoc/_chapters/about.adoc |  200 ++
 .../src/asciidoc/_chapters/create_spjs.adoc     |  508 ++++
 .../src/asciidoc/_chapters/deploy_spjs.adoc     |  557 ++++
 .../src/asciidoc/_chapters/develop_spjs.adoc    |  899 +++++++
 .../src/asciidoc/_chapters/execute_spjs.adoc    |  730 ++++++
 .../src/asciidoc/_chapters/get_started.adoc     |  121 +
 .../asciidoc/_chapters/grant_privileges.adoc    |  312 +++
 .../src/asciidoc/_chapters/introduction.adoc    |  255 ++
 .../_chapters/performance_troubleshooting.adoc  |  416 +++
 .../src/asciidoc/_chapters/sample_database.adoc |  816 ++++++
 .../src/asciidoc/_chapters/sample_spjs.adoc     | 2386 ++++++++++++++++++
 docs/spj_guide/src/asciidoc/index.adoc          |  113 +
 docs/src/site/markdown/documentation.md         |    4 +
 docs/src/site/markdown/download.md              |    2 +-
 install/installer/rest_installer                |   11 +-
 install/installer/traf_cloudera_mods98          |   64 +-
 install/installer/traf_createPasswordLessSSH    |    6 +-
 install/installer/traf_getHadoopNodes           |  105 +-
 install/installer/traf_hortonworks_mods98       |  101 +-
 .../installer/trafodion_apache_hadoop_install   |   12 +-
 install/installer/trafodion_install             |   12 -
 install/installer/trafodion_uninstaller         |   10 +-
 pom.xml                                         |    4 +-
 86 files changed, 10151 insertions(+), 1734 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/BaseRow.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/BaseRow.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/BaseRow.java
deleted file mode 100644
index 2eed427..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/BaseRow.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// @@@ 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 @@@
-
-// Source File Name:   BaseRow.java
-
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.trafodion.jdbc.t2;
-
-import java.io.Serializable;
-import java.sql.SQLException;
-
-abstract class BaseRow
-    implements Serializable, Cloneable {
-
-    protected Object origVals[];
-
-    BaseRow() {
-    }
-
-    protected abstract Object getColumnObject(int i) throws SQLException;
-
-    protected Object[] getOrigRow() {
-        return origVals;
-    }
-
-    protected abstract void setColumnObject(int i, Object obj) throws SQLException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/InsertRow.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/InsertRow.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/InsertRow.java
deleted file mode 100644
index 54bb150..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/InsertRow.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// @@@ 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 @@@
-
-package org.trafodion.jdbc.t2;
-
-import java.io.Serializable;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.PreparedStatement;
-import java.util.BitSet;
-
-
-class InsertRow extends BaseRow
-    implements Serializable, Cloneable {
-
-    private BitSet colsInserted;
-    private int cols;
-
-    InsertRow(int i) {
-        origVals = new Object[i];
-        colsInserted = new BitSet(i);
-        cols = i;
-    }
-
-    protected Object getColumnObject(int i) throws SQLException {
-        if(!colsInserted.get(i - 1))
-            throw new SQLException("No value has been inserted");
-        else
-            return origVals[i - 1];
-    }
-
-    protected void initInsertRow() {
-        for(int i = 0; i < cols; i++)
-            colsInserted.clear(i);
-
-    }
-
-	/*
-    protected boolean isCompleteRow(RowSetMetaData rowsetmetadata) throws SQLException {
-        for(int i = 0; i < cols; i++)
-            if(!colsInserted.get(i) && rowsetmetadata.isNullable(i + 1) == 0)
-                return false;
-
-        return true;
-    }
-	*/
-
-    protected void markColInserted(int i) {
-        colsInserted.set(i);
-    }
-
-    protected void setColumnObject(int i, Object obj) {
-        origVals[i - 1] = obj;
-        markColInserted(i - 1);
-    }
-
-	protected void insertRow(PreparedStatement insertStmt, BitSet paramCols) throws SQLException
-	{
-		int i;
-		int j;
-
-		for (i = 0, j= 1; i < cols ; i++)
-		{
-			if (paramCols.get(i))
-				insertStmt.setObject(j++, origVals[i]);
-		}
-		insertStmt.execute();
-		initInsertRow();
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Row.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Row.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Row.java
deleted file mode 100644
index b8104aa..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Row.java
+++ /dev/null
@@ -1,275 +0,0 @@
-// @@@ 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 @@@
-
-/*
-* Filename    : Row.java
-* Description :
-*
-*/
-
-package org.trafodion.jdbc.t2;
-
-import java.io.Serializable;
-import java.sql.*;
-import java.util.BitSet;
-import java.util.Locale;
-
-// Referenced classes of package sun.jdbc.rowset:
-//            BaseRow
-
-class Row extends BaseRow
-    implements Serializable, Cloneable {
-
-    private Object currentVals[];
-    private BitSet colsChanged;
-    private boolean deleted;
-    private boolean updated;
-    private boolean inserted;
-    private int numCols;
-
-    Row(int i) {
-        origVals = new Object[i];
-        currentVals = new Object[i];
-        colsChanged = new BitSet(i);
-        numCols = i;
-    }
-
-    Row(int i, Object aobj[]) {
-        origVals = new Object[i];
-        for(int j = 0; j < i; j++)
-            origVals[j] = aobj[j];
-
-        currentVals = new Object[i];
-        colsChanged = new BitSet(i);
-        numCols = i;
-    }
-
-    protected void clearDeleted() {
-        deleted = false;
-    }
-
-    protected void clearInserted() {
-        inserted = false;
-    }
-
-    protected void clearUpdated() {
-        updated = false;
-        for(int i = 0; i < numCols; i++) {
-            currentVals[i] = null;
-            colsChanged.clear(i);
-        }
-
-    }
-
-    protected boolean getColUpdated(int i) {
-        return colsChanged.get(i);
-    }
-
-    protected Object getColumnObject(int i) throws SQLException {
-        if(getColUpdated(i - 1))
-            return currentVals[i - 1];
-        else
-            return origVals[i - 1];
-    }
-
-    protected boolean getDeleted() {
-        return deleted;
-    }
-
-    protected boolean getInserted() {
-        return inserted;
-    }
-
-    protected boolean getUpdated() {
-        return updated;
-    }
-
-    protected void initColumnObject(int i, Object obj) {
-        origVals[i - 1] = obj;
-    }
-
-    protected void moveCurrentToOrig() {
-        for(int i = 0; i < numCols; i++)
-            if(getColUpdated(i)) {
-                origVals[i] = currentVals[i];
-                currentVals[i] = null;
-                colsChanged.clear(i);
-            }
-	}
-
-    private void setColUpdated(int i) {
-        colsChanged.set(i);
-    }
-
-    protected void setColumnObject(int i, Object obj) {
-        currentVals[i - 1] = obj;
-        setColUpdated(i - 1);
-    }
-
-	protected void setLobObject(int i, Object obj) {
-        currentVals[i - 1] = obj;
-		origVals[i-1] = obj;
-    }
-
-
-    protected void setDeleted() {
-        deleted = true;
-    }
-
-    protected void setInserted() {
-        inserted = true;
-    }
-
-    protected void setUpdated() {
-        updated = true;
-    }
-	
-	protected void deleteRow(Locale locale, PreparedStatement deleteStmt, BitSet paramCols) throws SQLException
-	{
-		int i;
-		int j;
-		int count;
-
-		for (i = 0, j = 1; i < numCols ; i++)
-		{
-			if (paramCols.get(i))
-				deleteStmt.setObject(j++, origVals[i]);
-		}
-		count =	deleteStmt.executeUpdate();
-		if (count == 0)
-			throw SQLMXMessages.createSQLException(locale, "row_modified", null);
-	}
-
-	protected void updateRow(Locale locale, PreparedStatement updateStmt, BitSet paramCols, BitSet keyCols) throws SQLException
-	{
-		int i;
-		int j;
-		int count;
-		Object obj;
-        int numPKey=0;        
-        int loc=0;           
-        int pKeyCounter=1;    
-
-        for (i = 0; i < numCols; i++ )  
-        {                                
-            if(keyCols.get(i))           
-                numPKey++;               
-        }                               
-        
-        loc = numCols - numPKey;         
-
-		for (i = 0, j = 1; i < numCols ; i++)
-		{
-			if (keyCols.get(i))
-			{
-				if (getColUpdated(i))
-					throw SQLMXMessages.createSQLException(locale, "primary_key_not_updateable", null);
-                updateStmt.setObject((loc+pKeyCounter),getColumnObject(i+1)); 
-                pKeyCounter++;  
-			}
-			else
-			{
-				{
-					obj = getColumnObject((i+1));
-					if (obj instanceof SQLMXLob)
-					{
-						if (obj == origVals[i])	// New and old Lob objects are same
-						{
-							updateStmt.setObject(j++, new DataWrapper((int) ((SQLMXLob)obj).dataLocator_));
-							continue;
-						}
-					}
-					updateStmt.setObject(j++, obj);
-				}
-			}
-		}
-		
-
-        /* 
-		for (i = 0 ;  i < numCols ; i++)
-		{
-			if (paramCols.get(i))
-			{
-				obj = origVals[i];
-				if (obj instanceof SQLMXLob)
-				{
-					updateStmt.setObject(j++, new DataWrapper(((SQLMXLob)obj).dataLocator_));
-					continue;
-				}
-				updateStmt.setObject(j++, origVals[i]);
-			}
-        } */
-		count = updateStmt.executeUpdate();
-		if (count == 0)
-			throw SQLMXMessages.createSQLException(locale, "row_modified", null);
-		moveCurrentToOrig();
-		setUpdated();
-	}
-	
-	protected void refreshRow(Locale locale, PreparedStatement selectStmt, BitSet selectCols, BitSet keyCols) throws SQLException
-	{
-		int i;
-		int j;
-		ResultSet rs;
-		ResultSetMetaData rsmd;
-		int columnCount;
-		
-		clearUpdated();	
-	
-		for (i = 0, j = 1; i < numCols ; i++)
-		{
-			if (keyCols.get(i))
-				selectStmt.setObject(j++, origVals[i]);
-		}
-		rs = selectStmt.executeQuery();
-		if (rs != null)
-		{
-			try {
-				rsmd = rs.getMetaData();
-
-				columnCount = rsmd.getColumnCount();
-				for (i = 0, j = 1 ; i < numCols ; i++)
-				{
-					if (selectCols.get(i))
-						origVals[i] = rs.getObject(j++);
-				}
-			} finally {
-				rs.close();
-			}
-		}
-	}
-
-	protected void closeLobObjects() 
-	{
-		int i;
-		SQLMXLob lob;
-
-		for (i = 0; i < numCols ; i++)
-		{
-			if (currentVals[i] instanceof SQLMXLob)
-			{
-				lob = (SQLMXLob)currentVals[i];
-				lob.close();
-			}
-				
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index bfec256..3295b30 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -146,14 +146,13 @@ export HBASE_DEP_VER_HDP=1.1.2.2.3.2.0-2950
 export HIVE_DEP_VER_HDP=1.2.1.2.3.2.0-2950
 export HBASE_DEP_VER_APACHE=1.0.2
 export HIVE_DEP_VER_APACHE=1.1.0
-export THRIFT_DEP_VER=0.9.0
 export HBASE_TRX_ID_CDH=hbase-trx-cdh5_4
 export HBASE_TRX_ID_APACHE=hbase-trx-apache1_0_2
 export HBASE_TRX_ID_HDP=hbase-trx-hdp2_3
+export THRIFT_DEP_VER=0.9.0
 export HIVE_DEP_VER=0.13.1
 export HADOOP_DEP_VER=2.6.0
 
-
 # staged build-time dependencies
 export HADOOP_BLD_LIB=${TOOLSDIR}/hadoop-${HADOOP_DEP_VER}/lib/native
 export HADOOP_BLD_INC=${TOOLSDIR}/hadoop-${HADOOP_DEP_VER}/include
@@ -179,7 +178,6 @@ if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
     export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
 
-
 # check for workstation env
 # want to make sure SQ_VIRTUAL_NODES is set in the shell running sqstart
 # so we can determine if we are on a workstation or not

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/ilh_cleanhb
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ilh_cleanhb b/core/sqf/sql/scripts/ilh_cleanhb
new file mode 100755
index 0000000..0b1076b
--- /dev/null
+++ b/core/sqf/sql/scripts/ilh_cleanhb
@@ -0,0 +1,106 @@
+#!/bin/bash
+#
+# @@@ 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 @@@
+#
+
+#
+# This script cleans up the HBase env 
+# that was setup by install_local_hadoop.
+# It requires Hadoop to be up.
+#
+# - kills the HBase Master process (if it exists)
+# - deletes the HBase log files
+# - deletes the HDFS directory /hbase
+#
+# After running this script:
+# - swstarthbase
+# - sqstart
+# - initialize trafodion
+#
+
+function getMyNameNode {
+    jps | grep -w NameNode | cut -d' ' -f1
+}
+
+function getMyDataNode {
+    jps | grep -w DataNode | cut -d' ' -f1
+}
+
+function getMyHMaster {
+    jps | grep HMaster | cut -d' ' -f1
+}
+
+function killMyHMaster {
+
+    lv_hbpid=`getMyHMaster`
+    if [ ! -z ${lv_hbpid} ]; then
+	echo "Killing HMaster pid: ${lv_hbpid}"
+	kill -9 ${lv_hbpid}
+    else
+	echo "There's no HMaster process to kill"
+    fi
+
+}
+
+lv_clean_hb_data=0
+if [[ ! -z "$1" ]]; then
+    lv_clean_hb_data=$1
+fi
+
+lv_nnpid=`getMyNameNode`
+if [[ -z ${lv_nnpid} ]]; then
+    echo "NameNode is not up - please run swstarthadoop to start it or check the Hadoop logs - exitting..."
+    exit 1
+fi
+echo "NameNode pid: ${lv_nnpid}"
+
+lv_dnpid=`getMyDataNode`
+if [[ -z ${lv_dnpid} ]]; then
+    echo "DataNode is not up - please run swstarthadoop to start it or check the Hadoop logs - exitting..."
+    exit 1
+fi
+echo "DataNode pid: ${lv_dnpid}"
+
+# stop / kill the HMaster process
+killMyHMaster
+
+# delete the zookeeper info
+if [[ ${lv_clean_hb_data} -gt 0 ]]; then
+    lv_zk_dir="${MY_SW_ROOT}/hdfs:"
+    echo "Deleting the zookeeper directory: ${lv_zk_dir}"
+    rm -rf ${lv_zk_dir}
+fi
+
+#delete the logs
+echo "Deleting HBase logs in: ${MY_SQROOT}/sql/local_hadoop/hbase/logs"
+if [ ! -z ${MY_SQROOT} ]; then
+    rm -rf ${MY_SQROOT}/sql/local_hadoop/hbase/logs/*.log
+    rm -rf ${MY_SQROOT}/sql/local_hadoop/hbase/logs/*log.[0-9]*
+    rm -rf ${MY_SQROOT}/sql/local_hadoop/hbase/logs/*.out
+    rm -rf ${MY_SQROOT}/sql/local_hadoop/hbase/logs/*.out.[0-9]*
+fi
+
+if [[ ${lv_clean_hb_data} -gt 1 ]]; then
+# delete the HBase table data from HDFS
+    echo "Deleting the HBase data directory (hdfs) /hbase"
+    swhdfs dfs -rm -f -r -skipTrash /hbase
+fi

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/ilh_hbase_repair
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ilh_hbase_repair b/core/sqf/sql/scripts/ilh_hbase_repair
new file mode 100755
index 0000000..547a539
--- /dev/null
+++ b/core/sqf/sql/scripts/ilh_hbase_repair
@@ -0,0 +1,65 @@
+#!/bin/bash
+# @@@ 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 @@@
+
+####################################################
+#
+# Executes the following:
+#
+# - Executes: hbase hbck -repair
+#
+####################################################
+
+if [ ! -z $MY_SQROOT ]; then
+    cd $MY_SQROOT/sql/scripts
+else
+    echo "The environment variable MY_SQROOT does not exist."
+    echo "Please ensure sqenv.sh has been sourced."
+    echo
+    exit 1;
+fi
+
+echo 'This script will execute: hbase hbck -repair'
+
+if [[ -z $1 ]]; then
+    read -p 'Do you want to proceed? y/n : ' lv_ans
+else 
+    lv_ans=$1
+fi
+
+if [ "$lv_ans" != "y" ]; then
+    echo "Not proceeding. Exitting..."
+    exit 0
+else
+    echo "Ok...going ahead..."
+fi
+
+lv_starttime=`date`
+
+lv_stderr_file="$MY_SQROOT/logs/hbase_hbck_repair.log"
+echo "Stderr being written to the file: ${lv_stderr_file}"
+${HBASE_HOME}/bin/hbase hbck -repair > ${lv_stderr_file} 2>${lv_stderr_file}
+
+echo "done with hbase hbck. return code: $?"
+lv_endtime=`date`
+echo "Start time: ${lv_starttime}"
+echo "End   time: ${lv_endtime}"
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/ilh_hbcheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ilh_hbcheck b/core/sqf/sql/scripts/ilh_hbcheck
new file mode 100755
index 0000000..2c6149c
--- /dev/null
+++ b/core/sqf/sql/scripts/ilh_hbcheck
@@ -0,0 +1,72 @@
+#!/bin/bash
+#
+# @@@ 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 @@@
+#
+
+if [ -z $JAVA_HOME ]; then
+    echo "The environment variable \$JAVA_HOME has not been set"
+    echo "Please ensure \$MY_SQROOT/sqenv.sh has been sourced."
+    echo
+    exit 1;
+fi
+
+cd $MY_SQROOT/tools/check_hbase_available
+echo "Building some utility Java programs."
+. ./build 2>/dev/null
+$JAVA_HOME/bin/java CheckHBase | grep -v "Checking" | grep "HBase is available"
+lv_status=$?
+if [[ $lv_status == 0 ]]; then
+   echo "HBase Master is available."
+else
+   echo "HBase Master is not accessible. Please check the HBase logs" 
+   exit 1
+fi
+
+echo
+echo "Checking if HBase is functional..."
+echo
+
+swhbase <<EOF > hbase_status_detailed.out
+status 'detailed'
+EOF
+
+declare -i lv_num_live_rs 
+lv_num_live_rs=`cat hbase_status_detailed.out | grep live | cut -d' ' -f1`
+echo "Number of live region servers: ${lv_num_live_rs}"
+if [ ${lv_num_live_rs} '>' '0' ] ; then
+   echo
+   echo "Checking if regions are online" 
+else
+   echo "There does not seem to be any live region server available"
+   echo "Please check the HBase logs or the management interfaces"
+   exit 1
+fi
+
+declare -i lv_num_online_regions
+lv_num_online_regions=`cat hbase_status_detailed.out | grep -o "numberOfOnlineRegions=[0-9]*" | cut -d= -f2`
+echo "The number of online regions: ${lv_num_online_regions}"
+if [ ${lv_num_online_regions} -lt 2 ]; then
+    echo "Error: There does not seem to be enough online region. Exitting..."
+    exit 1
+fi
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/ilh_traf_restart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ilh_traf_restart b/core/sqf/sql/scripts/ilh_traf_restart
new file mode 100755
index 0000000..ed5141c
--- /dev/null
+++ b/core/sqf/sql/scripts/ilh_traf_restart
@@ -0,0 +1,117 @@
+#!/bin/bash
+# @@@ 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 @@@
+
+####################################################
+#
+# Executes the following:
+#
+# - Kills the Trafodion Env
+# - Kills the HBase Master process and the zookeeper data
+#   (uses ilh_cleanhb 1)
+# - Restarts HBase
+# - Repairs HBase (ilh_hbase_repair)
+# - Checks whether HBase is ready (uses ilh_hbcheck)
+# - Deletes the Trafodion env file: $MY_SQROOT/etc/ms.env
+# - Regenerates Config (sqgen)
+# - Starts up Trafodion (sqstart)
+#
+####################################################
+
+if [ ! -z $MY_SQROOT ]; then
+    cd $MY_SQROOT/sql/scripts
+else
+    echo "The environment variable MY_SQROOT does not exist."
+    echo "Please ensure sqenv.sh has been sourced."
+    echo
+    exit 1;
+fi
+
+lv_ilh_cleanhb_mode=1
+
+echo 'This script will do the following:'
+echo ' - Kill the Trafodion env (pkillall)'
+echo " - Kill the HBase env and delete the zookeeper data directory (ilh_cleanhb ${lv_ilh_cleanhb_mode})"
+echo ' - Restart HBase (swstarthbase)'
+echo ' - Delete the env file: $MY_SQROOT/etc/ms.env'
+echo ' - sqgen'
+echo ' - sqstart'
+
+if [[ -z $1 ]]; then
+    read -p 'Do you want to proceed? y/n : ' lv_ans
+else 
+    lv_ans=$1
+fi
+
+if [ "$lv_ans" != "y" ]; then
+    echo "Not proceeding. Exitting..."
+    exit 0
+else
+    echo "Ok...going ahead..."
+fi
+
+lv_starttime=`date`
+
+run_util pkillall
+sleep 5
+run_util pkillall
+
+echo "Stopping HBase"
+swstophbase &
+sleep 45
+kill %1
+
+run_util 'ilh_cleanhb 1'
+
+run_util swstarthbase
+
+echo "Sleeping for 15 seconds before checking the status of HBase"
+sleep 15
+
+echo "--------------------------------------"
+if [ -e $MY_SQROOT/sql/scripts/hbcheck ]; then
+    run_util hbcheck 4 10
+else
+    run_util ilh_hbcheck
+fi
+echo "--------------------------------------"
+
+echo "Repairing HBase (hbase hbck -repair)"
+ilh_hbase_repair y
+
+echo "--------------------------------------"
+echo "deleting $MY_SQROOT/etc/ms.env"
+rm $MY_SQROOT/etc/ms.env
+
+run_util sqgen
+
+run_util sqstart
+
+echo "executing: sqlci -> get schemas"
+sqlci <<EOF
+get schemas;
+EOF
+
+echo "done"
+lv_endtime=`date`
+echo "Start time: ${lv_starttime}"
+echo "End   time: ${lv_endtime}"
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/ilh_trafinit
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ilh_trafinit b/core/sqf/sql/scripts/ilh_trafinit
new file mode 100755
index 0000000..77669c1
--- /dev/null
+++ b/core/sqf/sql/scripts/ilh_trafinit
@@ -0,0 +1,108 @@
+#!/bin/bash
+# @@@ 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 @@@
+
+####################################################
+#
+# Executes the following:
+#
+# - Kills the Trafodion Env
+# - Kills the HBase env and the HDFS data directory associated with HBase
+#   (uses ilh_cleanhb)
+# - Restarts HBase
+# - Checks whether HBase is ready (uses ilh_hbcheck)
+# - Deletes the Trafodion env file: $MY_SQROOT/etc/ms.env
+# - Regenerates Config (sqgen)
+# - Starts up Trafodion (sqstart)
+# - Initializes Trafodion (sqlci -> initialize trafodion)
+#
+####################################################
+
+if [ ! -z $MY_SQROOT ]; then
+    cd $MY_SQROOT/sql/scripts
+else
+    echo "The environment variable MY_SQROOT does not exist."
+    echo "Please ensure sqenv.sh has been sourced."
+    echo
+    exit 1;
+fi
+
+echo 'This script will do the following:'
+echo ' - Kill the Trafodion env (pkillall)'
+echo ' - Kill the HBase env and Delete the HDFS data directory associated with HBase (ilh_cleanhb 2)'
+echo ' - Restart HBase (swstarthbase)'
+echo ' - Delete the env file: $MY_SQROOT/etc/ms.env'
+echo ' - sqgen'
+echo ' - sqstart'
+echo ' - sqlci -> initialize trafodion'
+
+if [[ -z $1 ]]; then
+    read -p 'Do you want to proceed? y/n : ' lv_ans
+else 
+    lv_ans=$1
+fi
+
+if [ "$lv_ans" != "y" ]; then
+    echo "Not proceeding. Exitting..."
+    exit 0
+else
+    echo "Ok...going ahead..."
+fi
+
+lv_starttime=`date`
+run_util pkillall
+sleep 5
+run_util pkillall
+
+run_util 'ilh_cleanhb 2'
+
+run_util swstarthbase
+
+echo "Sleeping for 10 seconds before checking the status of HBase"
+sleep 10
+if [ -e $MY_SQROOT/sql/scripts/hbcheck ]; then
+    run_util hbcheck 4 10
+else
+    run_util ilh_hbcheck
+fi
+
+echo "deleting $MY_SQROOT/etc/ms.env"
+rm $MY_SQROOT/etc/ms.env
+
+run_util sqgen
+
+run_util sqstart
+
+echo "executing: sqlci -> initialize trafodion"
+sqlci <<EOF
+initialize trafodion;
+EOF
+
+echo "executing: sqlci -> get schemas"
+sqlci <<EOF
+get schemas;
+EOF
+
+echo "done"
+lv_endtime=`date`
+echo "Start time: ${lv_starttime}"
+echo "End   time: ${lv_endtime}"
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/install_hadoop_regr_test_env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_hadoop_regr_test_env b/core/sqf/sql/scripts/install_hadoop_regr_test_env
index 17da726..5fea8be 100755
--- a/core/sqf/sql/scripts/install_hadoop_regr_test_env
+++ b/core/sqf/sql/scripts/install_hadoop_regr_test_env
@@ -155,7 +155,7 @@ if [ -z "$MY_TPCDS_UNPACK_DIR" ]; then
   MY_TPCDS_UNPACK_DIR=.
   cd -P .
 else
-  mkdir $MY_TPCDS_UNPACK_DIR
+  mkdir -p $MY_TPCDS_UNPACK_DIR
   cd $MY_TPCDS_UNPACK_DIR
 fi
 
@@ -183,7 +183,7 @@ fi
   make >>${MY_LOG_FILE} 2>&1 
 
   echo "Generating the data..." | tee -a ${MY_LOG_FILE}
-  mkdir $MY_TPCDS_DATA_DIR
+  mkdir -p $MY_TPCDS_DATA_DIR
   SCALE=1
   FORCE=Y
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_local_hadoop b/core/sqf/sql/scripts/install_local_hadoop
index 4cc74c4..84643e2 100755
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@ -745,10 +745,15 @@ EOF
   cat <<EOF >$MY_SW_SCRIPTS_DIR/sw_env.sh
 # Basic environment variables for Trafodion/Hadoop/Hive/HBase/MySQL setup
 export JAVA_HOME=${JAVA_HOME}
+export JAVA_LIBRARY_PATH=${LD_LIBRARY_PATH}
+export MY_SW_SCRIPTS_DIR=${MY_SW_SCRIPTS_DIR}
+export MY_SW_ROOT=${MY_SW_ROOT}
 export MYSQL_HOME=${MYSQL_HOME}
 export YARN_HOME=${YARN_HOME}
 export HIVE_HOME=${HIVE_HOME}
 export HBASE_HOME=${HBASE_HOME}
+export HADOOP_PID_DIR=${MY_SW_ROOT}/tmp
+export HBASE_PID_DIR=${MY_SW_ROOT}/tmp
 export MY_HADOOP_HDFS_PORT_NUM=${MY_HADOOP_HDFS_PORT_NUM}
 export MY_HBASE_ZOOKEEPER_PEERPORT_NUM=${MY_HBASE_ZOOKEEPER_PEERPORT_NUM}
 export MY_HBASE_ZOOKEEPER_LEADERPORT_NUM=${MY_HBASE_ZOOKEEPER_LEADERPORT_NUM}
@@ -1597,8 +1602,7 @@ echo "$MY_LOCAL_SW_DIST/${HBASE_TAR}"
       <value>
            org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionObserver,
            org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionEndpoint,
-           org.apache.hadoop.hbase.coprocessor.transactional.SsccRegionEndpoint,
-           org.apache.hadoop.hbase.coprocessor.AggregateImplementation ${VISIBILITY_COPROC}
+           org.apache.hadoop.hbase.coprocessor.AggregateImplementation
       </value>
    </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/trafnodestatus
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/trafnodestatus b/core/sqf/sql/scripts/trafnodestatus
new file mode 100755
index 0000000..f417471
--- /dev/null
+++ b/core/sqf/sql/scripts/trafnodestatus
@@ -0,0 +1,105 @@
+ #!/bin/bash
+#
+# @@@ 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 @@@
+#
+# Script to check the trafodion-status of the nodes
+# of a trafodion cluster.
+#
+# Switch "-j" prints the output in JSON format.
+#
+
+function traf_echo {
+    if [[ ${lv_jason_output} == "1" ]]; then
+	if [[ ${lv_first} == "1" ]]; then
+	    lv_first=0
+	    echo -n "["
+	else
+	    echo -n ","
+	fi
+	echo -n "{\"ERROR\":\"$*\"}"
+    else
+	echo $*
+    fi
+	
+}
+
+function traf_exit {
+    if [[ ${lv_jason_output} == "1" ]]; then
+	if [[ ${lv_first} == "0" ]]; then
+	    echo "]"
+	fi
+    fi
+    exit $1
+}
+
+lv_first=1
+lv_jason_output=0
+if [[ ! -z $1 ]]; then
+    if [[ $1 == "-j" ]]; then
+	lv_jason_output=1
+    fi
+fi
+
+if [[ -z $MY_SQROOT ]]; then
+    traf_echo "Looks like the Trafodion environment has not been configured. Exitting..."
+    traf_exit 5;
+fi
+
+if [[ -z $SQSCRIPTS_DIR ]]; then
+    SQSCRIPTS_DIR=$MY_SQROOT/sql/scripts
+fi
+SQCONFIGDB_FILE="$SQSCRIPTS_DIR/sqconfig.db"
+if [[ ! -e ${SQCONFIGDB_FILE} ]]; then
+    traf_echo "Cannot find the Trafodion configuration DB file ${SQCONFIGDB_FILE}"
+    traf_echo "Please execute sqgen to generate this file."
+    traf_exit 5;
+fi
+
+grep_out=`pstat | grep "monitor COLD" | grep -v mpirun`
+if [[ $? == '0' ]]; then
+   sqshell -c node info | awk -v jason_output=${lv_jason_output} -f $MY_SQROOT/sql/scripts/trafnodestatus.awk
+   traf_exit $?
+else
+   traf_echo "Trafodion is not running on the current node: `hostname`"
+   lv_monitor_not_running_on_curr_node=1
+fi
+
+if [[ ! -z ${SQ_VIRTUAL_NODES} ]]; then
+    # Running in a single node environment
+    traf_echo "Trafodion has been configured to run on a single virtual node environment."
+    traf_exit 1
+fi
+
+grep_out_mon=`$SQ_ROOT/sql/scripts/cstat | grep "monitor COLD" `
+lv_ret=$?
+if [[ $lv_ret == 0 ]]; then
+    grep_out=`cstat | grep "monitor COLD" | grep -v mpirun | sort | cut -d: -f1`
+    for lv_node in $grep_out; do
+	ssh $lv_node sqshell -c node info | awk -v jason_output=${lv_jason_output} -f $MY_SQROOT/sql/scripts/trafnodestatus.awk
+        lv_sqcheck_retcode=$?
+        traf_exit ${lv_exit_code}
+    done
+else
+    traf_echo "None of the Trafodion nodes have a Trafodion monitor running on them."
+    traf_echo "Trafodion is currently down."
+    traf_exit 255;
+fi

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/sql/scripts/trafnodestatus.awk
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/trafnodestatus.awk b/core/sqf/sql/scripts/trafnodestatus.awk
new file mode 100644
index 0000000..a1849a7
--- /dev/null
+++ b/core/sqf/sql/scripts/trafnodestatus.awk
@@ -0,0 +1,76 @@
+#
+# @@@ 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 @@@
+#
+# awk script used by the trafnodestatus shell-script
+# to check the trafodion-status of the nodes 
+# of a trafodion cluster.
+#
+BEGIN {
+    lv_header_line_number = 0;
+    lv_lines_since_header = 0;
+    lv_first = 1;
+    lv_got_data = 0;
+} 
+
+{
+    if (lv_header_line_number > 0) {
+	lv_lines_since_header = FNR - lv_header_line_number;
+	if (lv_lines_since_header >= 3) {
+	    if ( ((lv_lines_since_header - 1) % 2) == 0) {
+		lv_node_status = toupper($3);
+		if (lv_node_status ~ "UP") {
+		    lv_node_name = $8;
+		}
+		else {
+		    lv_node_name = $4;
+		}
+		if (jason_output == 1) {
+		    if (lv_first == 1) { 
+			lv_first = 0;
+			printf("[");
+			lv_got_data = 1;
+		    }
+		    else {
+			printf(",");
+		    }
+		    printf("{\"NODE\":\"%s\",\"STATUS\":\"%s\"}",
+			   lv_node_name,
+			   lv_node_status);
+		}
+		else {
+		    printf ("%s [ %s ]\n",
+			    lv_node_name,
+			    lv_node_status);
+		}
+	    }
+	}
+    }
+}
+
+/MemFree SwapFree/ {lv_header_line_number = FNR;} 
+
+END {
+    if ((jason_output == 1) && 
+	(lv_got_data == 1)) {
+	printf("]\n");
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sqf/tools/sqtools.sh
----------------------------------------------------------------------
diff --git a/core/sqf/tools/sqtools.sh b/core/sqf/tools/sqtools.sh
index 0c7767c..d369959 100644
--- a/core/sqf/tools/sqtools.sh
+++ b/core/sqf/tools/sqtools.sh
@@ -266,6 +266,58 @@ function ndbm {
     eval '$SQPDSHA "df -h | grep database" 2>/dev/null | wc -l'
 }
 
+function chkReturnCodeExit {
+    if [[ $1 != 0 ]]; then
+	echo "$2 returned error $1, exitting..."
+	exit $1;
+    else
+	echo "$2 executed successfully."
+    fi
+}
+
+function chkReturnCode {
+    if [[ $1 != 0 ]]; then
+	echo "$2 returned error $1..."
+	return $1;
+    else
+	echo "$2 executed successfully."
+	return 0
+    fi
+}
+
+# $1: program/utility/script to run
+# $2: (optional): retry count (default 0)
+# $3: (optional): sleep for this many seconds
+# 
+function run_util {
+    echo "--------------------------------------"
+    lv_cmd=$*
+    echo "executing: $1"
+    $1
+    lv_stat=$?
+    if [ ! -z $3 ]; then
+	declare -i lv_retries=0
+	while [ $lv_retries -lt $2 ]; do
+	    let lv_retries=($lv_retries+1)
+	    chkReturnCode ${lv_stat} $1
+	    if [ $? != 0 ]; then
+		if [ $lv_retries -lt $2 ]; then
+		    echo "retrying in $3 seconds"
+		    sleep $3
+		    $1
+		    lv_stat=$?
+		else
+		    exit ${lv_stat}
+		fi
+	    else
+		return 0
+	    fi
+	done
+    else 
+	chkReturnCodeExit ${lv_stat} $1
+    fi
+    echo "--------------------------------------"
+}
 # check the startup log and sort the interesting even chronologically
 function sqchksl {
     setup_sqpdsh
@@ -906,6 +958,10 @@ export -f sqpostsem
 export -f sqgdb_doit
 export -f sq_gdb_main
 
+export -f chkReturnCodeExit
+export -f chkReturnCode
+export -f run_util
+
 # A front end to sq_gdb_main (as sq_gdb_main is a function, this function executes sq_gdb_main in a fresh 
 # bash context and that allows background tasks spawned by sq_gdb_main to be managed).
 function sq_gdb {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 0e1b24b..045b1f1 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -801,7 +801,7 @@ $1~String1 --------------------------------
 3049 42000 99999 BEGINNER MAJOR DBADMIN Host variables, such as $0~string0, are not allowed in a dynamic compilation.
 3050 42000 99999 BEGINNER MAJOR DBADMIN The constraint must have the same catalog and schema as the specified table.
 3051 42000 99999 BEGINNER MAJOR DBADMIN Duplicate HEADING clauses were specified in column definition $0~ColumnName.
-3052 42000 99999 BEGINNER MAJOR DBADMIN Duplicate NOT NULL clauses were specified in column definition $0~ColumnName.
+3052 42000 99999 BEGINNER MAJOR DBADMIN Duplicate $0~String0 clauses were specified in column definition $0~ColumnName.
 3053 42000 99999 BEGINNER MAJOR DBADMIN Duplicate PRIMARY KEY clauses were specified in column definition $0~ColumnName.
 3054 42000 99999 BEGINNER MAJOR DBADMIN The NOT DROPPABLE clause is allowed only in PRIMARY KEY and NOT NULL constraint definitions.
 3055 42000 99999 BEGINNER MAJOR DBADMIN Duplicate DELETE rules were specified.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/comexe/ComTdbHbaseAccess.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHbaseAccess.h b/core/sql/comexe/ComTdbHbaseAccess.h
index f430b39..51bc7ca 100644
--- a/core/sql/comexe/ComTdbHbaseAccess.h
+++ b/core/sql/comexe/ComTdbHbaseAccess.h
@@ -269,19 +269,38 @@ public:
     {(v ? flags_ |= USE_SMALL_SCANNER :
       flags_ &= ~USE_SMALL_SCANNER); };
     NABoolean useSmallScanner()
-    { return (flags_ & USE_SMALL_SCANNER) != 0; };
+    { return (flags_ & (USE_SMALL_SCANNER | USE_SMALL_SCANNER_FOR_MDAM)) != 0; };
+    void setUseSmallScannerForProbes(NABoolean v)
+    {(v ? flags_ |= USE_SMALL_SCANNER_FOR_PROBES :
+      flags_ &= ~USE_SMALL_SCANNER_FOR_PROBES); };
+    NABoolean useSmallScannerForProbes()
+    { return (flags_ & USE_SMALL_SCANNER_FOR_PROBES) != 0; };
+
+    void setUseSmallScannerForMDAMifNeeded(UInt32 numRowRetrieved){
+        //if last scan of mdam fitted in one block, and small scanner CQD is either ON or SYSTEM (this is summarized in USE_SMALL_SCANNER_FOR_PROBES)
+        //then next MDAM scan can use small scanner. Most likely it is about same size as previous one.
+        if ((numRowRetrieved < maxNumRowsPerHBaseBlock_) && ((flags_ & USE_SMALL_SCANNER_FOR_PROBES) != 0))
+            flags_ |= USE_SMALL_SCANNER_FOR_MDAM;
+        else
+            flags_ &= ~USE_SMALL_SCANNER_FOR_MDAM;
+    }
 
+    void setMaxNumRowsPerHbaseBlock(UInt32 n) { maxNumRowsPerHBaseBlock_ = n;}
+    UInt32 maxNumRowsPerHbaseBlock() { return maxNumRowsPerHBaseBlock_; }
 
   private:
     enum
     {
-      CACHE_BLOCKS               = 0x0001,
-      USE_MIN_MDAM_PROBE_SIZE    = 0x0002,
-      USE_SMALL_SCANNER          = 0x0004
+      CACHE_BLOCKS                 = 0x0001,
+      USE_MIN_MDAM_PROBE_SIZE      = 0x0002,
+      USE_SMALL_SCANNER            = 0x0004,
+      USE_SMALL_SCANNER_FOR_PROBES = 0x0008,
+      USE_SMALL_SCANNER_FOR_MDAM   = 0x0010
     };
     
     UInt32 flags_;
     UInt32 numCacheRows_;
+    UInt32 maxNumRowsPerHBaseBlock_;
   };
 
   // ---------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/executor/ExHbaseSelect.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseSelect.cpp b/core/sql/executor/ExHbaseSelect.cpp
index 5aabd9a..2bd904b 100644
--- a/core/sql/executor/ExHbaseSelect.cpp
+++ b/core/sql/executor/ExHbaseSelect.cpp
@@ -444,6 +444,16 @@ ExWorkProcRetcode ExHbaseScanSQTaskTcb::work(short &rc)
   Lng32 retcode = 0;
   rc = 0;
   Lng32 remainingInBatch = batchSize_;
+  NABoolean isFirstBatch = false;
+  // isFirstInBatch is a stack variable for optimization reason. It is used for the mdam small scanner optimization heuristic that
+  // is performed at runtime. Since this function is invoke intensively for all scan (mdam or regular scan), minimizing CPU/memory access
+  // impact on runtime code to a strict minimum is attempted. Given that we are trying to detect if the actual scan is bellow the size
+  // of an HBase block, having the runtime logic performing the detection only affect the first work invoke looks like the right idea.
+  // and leveraging an existing counter (remainingInBatch) instead of creating a new one. The reasonable asumption to allow this is that
+  // 1- batchSize_ being 8K, most likely times the row size, we are good in assuming that first hbase block will fit in batchSize
+  // 2- parent buffer size will be large enough to deal with one HBAse_Block_size without having to rely on re-invoking work in the middle.
+  // and anyway, if none of the reasonable assumption is true, then that's fine, the heuristic won't work, and we will use regular scanner,
+  // meaning optimization is off for the scan part of MDAM (still on for the probe side of it).
 
   while (1)
     {
@@ -467,7 +477,7 @@ ExWorkProcRetcode ExHbaseScanSQTaskTcb::work(short &rc)
 		step_ = HANDLE_ERROR;
 		break;
 	      }
-
+	    isFirstBatch = true;
 	    retcode = tcb_->ehi_->scanOpen(tcb_->table_, 
 					   tcb_->beginRowId_, tcb_->endRowId_,
 					   tcb_->columns_, -1,
@@ -606,6 +616,8 @@ ExWorkProcRetcode ExHbaseScanSQTaskTcb::work(short &rc)
 
 	case SCAN_CLOSE:
 	  {
+	      if (isFirstBatch) //only if closed happen in a single batch, batchSize - remainingInBatch = nb rows retrieved
+	          tcb_->hbaseAccessTdb().getHbasePerfAttributes()->setUseSmallScannerForMDAMifNeeded(batchSize_ - remainingInBatch); //calculate MDAM small scanner flag for next scan if it was MDAM
 	    retcode = tcb_->ehi_->scanClose();
 	    if (tcb_->setupError(retcode, "ExpHbaseInterface::scanClose"))
 	      step_ = HANDLE_ERROR;
@@ -647,8 +659,9 @@ Lng32 ExHbaseScanSQTaskTcb::getProbeResult(char* &keyData)
 				 tcb_->beginRowId_, tcb_->endRowId_,
 				 tcb_->columns_, -1,
 				 tcb_->hbaseAccessTdb().readUncommittedScan(),
-				 tcb_->hbaseAccessTdb().getHbasePerfAttributes()->cacheBlocks(),
-				 tcb_->hbaseAccessTdb().getHbasePerfAttributes()->useSmallScanner(),
+				 tcb_->hbaseAccessTdb().getHbasePerfAttributes()->cacheBlocks() ||
+				 tcb_->hbaseAccessTdb().getHbasePerfAttributes()->useSmallScannerForProbes(), // when small scanner feature is ON or SYSTEM force cache ON
+				 tcb_->hbaseAccessTdb().getHbasePerfAttributes()->useSmallScannerForProbes(),
 				 probeSize,
 				 TRUE, NULL, NULL, NULL);
   if (tcb_->setupError(retcode, "ExpHbaseInterface::scanOpen"))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/generator/GenRelScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelScan.cpp b/core/sql/generator/GenRelScan.cpp
index a919958..b56a7ae 100644
--- a/core/sql/generator/GenRelScan.cpp
+++ b/core/sql/generator/GenRelScan.cpp
@@ -232,7 +232,7 @@ int HbaseAccess::createAsciiColAndCastExpr(Generator * generator,
   // HIVE_FILE_CHARSET can only be empty or GBK
   else if (  needTranslate == TRUE )
   {
-      asciiType =  new (h) SQLVarChar(sizeof(Int64)/2, newGivenType->supportsSQLnull(),
+      asciiType =  new (h) SQLVarChar(sizeof(Int64), newGivenType->supportsSQLnull(),
                                       FALSE, FALSE, CharInfo::GBK);
   }
   else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/generator/Generator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/Generator.cpp b/core/sql/generator/Generator.cpp
index d1e174b..24b7eb9 100644
--- a/core/sql/generator/Generator.cpp
+++ b/core/sql/generator/Generator.cpp
@@ -3147,9 +3147,15 @@ void Generator::setHBaseSmallScanner(Int32 hbaseRowSize, double estRowsAccessed,
 {
   if (CmpCommon::getDefault(HBASE_SMALL_SCANNER) == DF_SYSTEM)
   {
-    if((hbaseRowSize*estRowsAccessed)<hbaseBlockSize)
+    if(((hbaseRowSize*estRowsAccessed)<hbaseBlockSize) && (estRowsAccessed>0))//added estRowsAccessed > 0 because MDAM costing is not populating this field correctly
         hbpa->setUseSmallScanner(TRUE);
+    hbpa->setUseSmallScannerForProbes(TRUE);
   }else if (CmpCommon::getDefault(HBASE_SMALL_SCANNER) == DF_ON)
+  {
       hbpa->setUseSmallScanner(TRUE);
+      hbpa->setUseSmallScannerForProbes(TRUE);
+  }
+  hbpa->setMaxNumRowsPerHbaseBlock(hbaseBlockSize/hbaseRowSize);
 }
 
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index c01998c..01981db 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -8736,8 +8736,8 @@ NATableDB::free_entries_with_QI_key(Int32 numKeys, SQL_QIKEY* qiKeyArray)
   {
     NATable * currTable = cachedTableList_[currIndx];
 
-    // Only need to remove seabase tables
-    if (!currTable->isSeabaseTable())
+    // Only need to remove seabase tables and external Hive/hbase tables
+    if (!currTable->isSeabaseTable() && !currTable->hasExternalTable())
     {
       currIndx++;
       continue;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/parser/ElemDDLCol.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLCol.cpp b/core/sql/parser/ElemDDLCol.cpp
index 3f11cf5..33ee187 100644
--- a/core/sql/parser/ElemDDLCol.cpp
+++ b/core/sql/parser/ElemDDLCol.cpp
@@ -59,7 +59,6 @@ ElemDDLColDef::ElemDDLColDef(
      const NAString *columnFamily,
      const NAString *columnName,
      NAType * pColumnDataType,
-     ElemDDLNode * pColDefaultNode,
      ElemDDLNode * pColAttrList,
      CollHeap * heap)
 : ElemDDLNode(ELM_COL_DEF_ELEM),
@@ -88,7 +87,8 @@ ElemDDLColDef::ElemDDLColDef(
   isLobAttrsSpec_(FALSE),
   lobStorage_(Lob_Invalid_Storage),
   isSeabaseSerializedSpec_(FALSE),
-  seabaseSerialized_(FALSE)
+  seabaseSerialized_(FALSE),
+  isColDefaultSpec_(FALSE)
 {
   //  ComASSERT(pColumnDataType NEQ NULL);
 
@@ -152,252 +152,12 @@ ElemDDLColDef::ElemDDLColDef(
     }
   }
 
-  setChild(INDEX_ELEM_DDL_COL_DEFAULT_VALUE, pColDefaultNode);
   setChild(INDEX_ELEM_DDL_COL_ATTR_LIST, pColAttrList);
 
   // initialize data member pDefault_
 
-  ElemDDLColDefault * pColDefault = NULL;
   ComBoolean isIdentityColumn = FALSE;
 
-  if (pColDefaultNode NEQ NULL)
-  {
-    ComASSERT(pColDefaultNode->castToElemDDLColDefault() NEQ NULL);
-    pColDefault = pColDefaultNode->castToElemDDLColDefault();
-  }
-  if (pColDefault NEQ NULL)
-  {
-    switch (pColDefault->getColumnDefaultType())
-    {
-    case ElemDDLColDefault::COL_NO_DEFAULT:
-      defaultClauseStatus_ = NO_DEFAULT_CLAUSE_SPEC;
-      break;
-    case ElemDDLColDefault::COL_DEFAULT:
-      {
-	defaultClauseStatus_ = DEFAULT_CLAUSE_SPEC;
-
-        if (pColDefault->getSGOptions())
-          {
-            isIdentityColumn = TRUE;
-            pSGOptions_ = pColDefault->getSGOptions();
-            pSGLocation_ = pColDefault->getSGLocation();
-          }
-        else
-          {
-            ComASSERT(pColDefault->getDefaultValueExpr() NEQ NULL);
-            pDefault_ = pColDefault->getDefaultValueExpr();
-          }
-
-	// The cast ItemExpr to ConstValue for (ConstValue *)pDefault_; 
-	// statement below sets arbitary value for the isNULL_. 
-	// Bypass these checks for ID column (basically ITM_IDENTITY).
-	ConstValue *cvDef = (ConstValue *)pDefault_;
-	if ((cvDef && !cvDef->isNull()) && (!isIdentityColumn))
-	  {
-	    const NAType *cvTyp = cvDef->getType();
-            NABoolean isAnErrorAlreadyIssued = FALSE;
-
-            if ( cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE )
-            {
-              CharInfo::CharSet defaultValueCS = ((const CharType *)cvTyp)->getCharSet();
-              // Always check for INFER_CHARSET setting before the ICAT setting.
-              NAString inferCharSetFlag;
-              if (getCharSetInferenceSetting(inferCharSetFlag) == TRUE &&
-                  NOT cvDef->isStrLitWithCharSetPrefixSpecified())
-              {
-                if (pColumnDataType->getTypeQualifier() == NA_CHARACTER_TYPE
-                    && ((const CharType *)pColumnDataType)->getCharSet() == CharInfo::UCS2
-                    && SqlParser_DEFAULT_CHARSET == CharInfo::UCS2
-                    && defaultValueCS == CharInfo::ISO88591
-                    )
-                {
-                  *SqlParser_Diags << DgSqlCode(-1186)
-                                   << DgColumnName(ToAnsiIdentifier(getColumnName()))
-                                   << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
-                                   << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
-                  isAnErrorAlreadyIssued = TRUE;
-                }
-                else
-                {
-                  cvTyp = cvDef -> pushDownType(*columnDataType_, NA_CHARACTER_TYPE);
-                }
-              }
-              else if (CmpCommon::getDefault(ALLOW_IMPLICIT_CHAR_CASTING) == DF_ON &&
-                       NOT cvDef->isStrLitWithCharSetPrefixSpecified() &&
-                       cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE &&
-                       SqlParser_DEFAULT_CHARSET == CharInfo::ISO88591 &&
-                       defaultValueCS == CharInfo::UnknownCharSet)
-              {
-                cvTyp = cvDef -> pushDownType(*columnDataType_, NA_CHARACTER_TYPE);
-              }
-
-            } // column default value has character data type
-
-            if (NOT isAnErrorAlreadyIssued &&
-                pColumnDataType->getTypeQualifier() == NA_CHARACTER_TYPE &&
-                cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE &&
-                (
-                 CmpCommon::getDefault(ALLOW_IMPLICIT_CHAR_CASTING) == DF_ON ||
-                 NOT cvDef->isStrLitWithCharSetPrefixSpecified()))
-            {
-              const CharType *cdCharType = (const CharType *)pColumnDataType;
-              const CharType *cvCharType = (const CharType *)cvTyp;
-              CharInfo::CharSet cdCharSet = cdCharType->getCharSet(); // cd = column definition
-              CharInfo::CharSet cvCharSet = cvCharType->getCharSet(); // cv = constant value
-              if (cvCharSet == CharInfo::ISO88591)  // default value is a _ISO88591 str lit
-              {
-
-              }
-              else if ( (cvCharSet == CharInfo::UNICODE ||  // default value is a _UCS2 string literal
-                         cvCharSet == CharInfo::UTF8)   &&  // or a _UTF8 string literal
-                         cdCharSet != cvCharSet )
-              {
-                //
-                // Check to see if all characters in the specified column default
-                // string literal value can be successfully converted/translated
-                // to the actual character set of the column.
-                //
-                char buf[2032];  // the output buffer - should be big enough
-                buf[0] = '\0';
-                enum cnv_charset eCnvCS = convertCharsetEnum( cdCharSet );
-                const char * pInStr = cvDef->getRawText()->data();
-                Int32 inStrLen = cvDef->getRawText()->length();
-                char * p1stUnstranslatedChar = NULL;
-                UInt32 outStrLenInBytes = 0;
-                unsigned charCount = 0;  // number of characters translated/converted
-                Int32 cnvErrStatus = 0;
-                char *pSubstitutionChar = NULL;
-                Int32 convFlags = 0;
-
-                if ( cvCharSet == CharInfo::UNICODE )
-                {
-                cnvErrStatus =
-                  UTF16ToLocale
-                    ( cnv_version1            // in  - const enum cnv_version version
-                    , pInStr                  // in  - const char *in_bufr
-                    , inStrLen                // in  - const int in_len
-                    , buf                     // out - const char *out_bufr
-                    , 2016                    // in  - const int out_len
-                    , eCnvCS                  // in  - enum cnv_charset charset
-                    , p1stUnstranslatedChar   // out - char * & first_untranslated_char
-                    , &outStrLenInBytes       // out - unsigned int *output_data_len_p
-                    , convFlags               // in  - const int cnv_flags
-                    , (Int32)TRUE               // in  - const int addNullAtEnd_flag
-                    , (Int32)FALSE              // in  - const int allow_invalids
-                    , &charCount              // out - unsigned int * translated_char_cnt_p
-                    , pSubstitutionChar       // in  - const char *substitution_char
-                    );
-                }
-                else // cvCharSet must be CharInfo::UTF8
-                {
-                cnvErrStatus =
-                  UTF8ToLocale
-                    ( cnv_version1            // in  - const enum cnv_version version
-                    , pInStr                  // in  - const char *in_bufr
-                    , inStrLen                // in  - const int in_len
-                    , buf                     // out - const char *out_bufr
-                    , 2016                    // in  - const int out_len
-                    , eCnvCS                  // in  - enum cnv_charset charset
-                    , p1stUnstranslatedChar   // out - char * & first_untranslated_char
-                    , &outStrLenInBytes       // out - unsigned int *output_data_len_p
-                    , (Int32)TRUE               // in  - const int addNullAtEnd_flag
-                    , (Int32)FALSE              // in  - const int allow_invalids
-                    , &charCount              // out - unsigned int * translated_char_cnt_p
-                    , pSubstitutionChar       // in  - const char *substitution_char
-                    );
-                }
-                switch (cnvErrStatus)
-                {
-                case 0: // success
-                case CNV_ERR_NOINPUT: // an empty input string will get this error code
-                  {
-                    ConstValue *pMBStrLitConstValue ;
-                    // convert the string literal saved in cvDef (column default value)
-                    // from UNICODE (e.g. UTF16) to the column character data type
-                    if ( cdCharSet != CharInfo::UNICODE)
-                    {
-                      NAString mbs2(buf, PARSERHEAP());  // note that buf is NULL terminated
-                      pMBStrLitConstValue =
-                        new(PARSERHEAP()) ConstValue ( mbs2
-                                                   , cdCharSet // use this for str lit prefix
-                                                   , CharInfo::DefaultCollation
-                                                   , CharInfo::COERCIBLE
-                                                   , PARSERHEAP()
-                                                   );
-                    }
-                    else
-                    {
-                      NAWString mbs2((NAWchar*)buf, PARSERHEAP());  // note that buf is NULL terminated
-                      pMBStrLitConstValue = 
-                        new(PARSERHEAP()) ConstValue ( mbs2
-                                                   , cdCharSet // use this for str lit prefix
-                                                   , CharInfo::DefaultCollation
-                                                   , CharInfo::COERCIBLE
-                                                   , PARSERHEAP()
-                                                   );
-                    }
-                    delete pDefault_; // deallocate the old ConstValue object
-                    cvDef = NULL;     // do not use cvDef anymore
-                    pDefault_ = pMBStrLitConstValue;
-                    pColDefault->setDefaultValueExpr(pDefault_);
-                  }
-                  break;
-                case CNV_ERR_INVALID_CHAR:
-                  {
-                    // 1401 ==  CAT_UNABLE_TO_CONVERT_COLUMN_DEFAULT_VALUE_TO_CHARSET
-                    *SqlParser_Diags << DgSqlCode(-1401)
-                                     << DgColumnName(ToAnsiIdentifier(getColumnName()))
-                                     << DgString0(CharInfo::getCharSetName(cdCharSet));
-                  }
-                  break;
-                case CNV_ERR_BUFFER_OVERRUN: // output buffer not big enough
-                case CNV_ERR_INVALID_CS:
-                default:
-                  CMPABORT_MSG("Parser internal logic error");
-                  break;
-                } // switch
-              }
-              else if(!pColumnDataType->isCompatible(*cvTyp))
-              {
-                if (NOT isAnErrorAlreadyIssued)
-                {
-                  *SqlParser_Diags << DgSqlCode(-1186)
-                                   << DgColumnName(ToAnsiIdentifier(getColumnName()))
-                                   << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
-                                   << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
-                  isAnErrorAlreadyIssued = TRUE;
-                }
-              }
-            } // column has character data type
-            else
-	    // if interval data type, the default value must have the same
-	    // interval qualifier as the column.
-            if (NOT isAnErrorAlreadyIssued &&
-                (!pColumnDataType->isCompatible(*cvTyp) ||
-                 (pColumnDataType->getTypeQualifier() == NA_INTERVAL_TYPE &&
-                  pColumnDataType->getFSDatatype() != cvTyp->getFSDatatype())))
-            {
-              *SqlParser_Diags << DgSqlCode(-1186)
-                               << DgColumnName(ToAnsiIdentifier(getColumnName()))
-                               << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
-                               << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
-              isAnErrorAlreadyIssued = TRUE;
-            }
-	  }
-	}
-      break;
-    case ElemDDLColDefault::COL_COMPUTED_DEFAULT:
-      {
-	defaultClauseStatus_ = DEFAULT_CLAUSE_SPEC;
-        computedDefaultExpr_ = pColDefault->getComputedDefaultExpr();
-      }
-      break;
-    default:
-      CMPABORT_MSG("Parser internal logic error");
-      break;
-    }
-  }
-
   //
   // Traverse the list of column attributes to check for duplicate
   // HEADING clause and duplicate NOT NULL column constraint definition
@@ -415,12 +175,12 @@ ElemDDLColDef::ElemDDLColDef(
   // has specified NOT NULL NOT DROPPABLE for IDENTITY
   // column. If not specified, then automatically add
   // it. 
-  if (isIdentityColumn)
+  if (pSGOptions_) //isIdentityColumn
     {
       // if NOT NULL not specified, then specify it here.
       if(NOT getIsConstraintNotNullSpecified())
 	isNotNullSpec_ = TRUE;
-
+      
       // [NOT] DROPPABLE is the only attribute for NOT NULL.
       if (pConstraintNotNull_)
 	{
@@ -431,12 +191,12 @@ ElemDDLColDef::ElemDDLColDef(
 			       << DgColumnName(ToAnsiIdentifier(getColumnName()));
 	      return;
 	    }
-		else
-		{
-		// add the NOT DROPPABLE attribute to the NOT NULL .
-		pConstraintNotNull_->setConstraintAttributes
-	    (new (PARSERHEAP()) ElemDDLConstraintAttrDroppable(FALSE)); 
-		}
+          else
+            {
+              // add the NOT DROPPABLE attribute to the NOT NULL .
+              pConstraintNotNull_->setConstraintAttributes
+                (new (PARSERHEAP()) ElemDDLConstraintAttrDroppable(FALSE)); 
+            }
 	}
       else
 	{
@@ -446,7 +206,7 @@ ElemDDLColDef::ElemDDLColDef(
 	    (new (PARSERHEAP()) ElemDDLConstraintAttrDroppable(FALSE)); 
 	}
     } //if isIdentityColumn
- 
+  
   //
   // All column attributes has been checked and saved.
   // If there exists a NOT NULL NONDROPPABLE constraint
@@ -530,6 +290,255 @@ ElemDDLColDef::setChild(Lng32 index, ExprNode * pChildNode)
 }
 
 void
+ElemDDLColDef::setDefaultAttribute(ElemDDLNode * pColDefaultNode)
+{
+  ElemDDLColDefault * pColDefault = NULL;
+  ComBoolean isIdentityColumn = FALSE;
+
+  NAType * pColumnDataType = columnDataType_;
+
+  if (pColDefaultNode NEQ NULL)
+    {
+      ComASSERT(pColDefaultNode->castToElemDDLColDefault() NEQ NULL);
+      pColDefault = pColDefaultNode->castToElemDDLColDefault();
+    }
+
+  if (pColDefault NEQ NULL)
+    {
+      switch (pColDefault->getColumnDefaultType())
+        {
+        case ElemDDLColDefault::COL_NO_DEFAULT:
+          defaultClauseStatus_ = NO_DEFAULT_CLAUSE_SPEC;
+          break;
+        case ElemDDLColDefault::COL_DEFAULT:
+          {
+            defaultClauseStatus_ = DEFAULT_CLAUSE_SPEC;
+            
+            if (pColDefault->getSGOptions())
+              {
+                isIdentityColumn = TRUE;
+                pSGOptions_ = pColDefault->getSGOptions();
+                pSGLocation_ = pColDefault->getSGLocation();
+              }
+            else
+              {
+                ComASSERT(pColDefault->getDefaultValueExpr() NEQ NULL);
+                pDefault_ = pColDefault->getDefaultValueExpr();
+              }
+            
+            // The cast ItemExpr to ConstValue for (ConstValue *)pDefault_; 
+            // statement below sets arbitary value for the isNULL_. 
+            // Bypass these checks for ID column (basically ITM_IDENTITY).
+            ConstValue *cvDef = (ConstValue *)pDefault_;
+            if ((cvDef && !cvDef->isNull()) && (!isIdentityColumn))
+              {
+                const NAType *cvTyp = cvDef->getType();
+                NABoolean isAnErrorAlreadyIssued = FALSE;
+                
+                if ( cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE )
+                  {
+                    CharInfo::CharSet defaultValueCS = ((const CharType *)cvTyp)->getCharSet();
+                    // Always check for INFER_CHARSET setting before the ICAT setting.
+                    NAString inferCharSetFlag;
+                    if (getCharSetInferenceSetting(inferCharSetFlag) == TRUE &&
+                        NOT cvDef->isStrLitWithCharSetPrefixSpecified())
+                      {
+                        if (pColumnDataType->getTypeQualifier() == NA_CHARACTER_TYPE
+                            && ((const CharType *)pColumnDataType)->getCharSet() == CharInfo::UCS2
+                            && SqlParser_DEFAULT_CHARSET == CharInfo::UCS2
+                            && defaultValueCS == CharInfo::ISO88591
+                            )
+                          {
+                            *SqlParser_Diags << DgSqlCode(-1186)
+                                             << DgColumnName(ToAnsiIdentifier(getColumnName()))
+                                             << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
+                                             << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
+                            isAnErrorAlreadyIssued = TRUE;
+                          }
+                        else
+                          {
+                            cvTyp = cvDef -> pushDownType(*columnDataType_, NA_CHARACTER_TYPE);
+                          }
+                      }
+                    else if (CmpCommon::getDefault(ALLOW_IMPLICIT_CHAR_CASTING) == DF_ON &&
+                             NOT cvDef->isStrLitWithCharSetPrefixSpecified() &&
+                             cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE &&
+                             SqlParser_DEFAULT_CHARSET == CharInfo::ISO88591 &&
+                             defaultValueCS == CharInfo::UnknownCharSet)
+                      {
+                        cvTyp = cvDef -> pushDownType(*columnDataType_, NA_CHARACTER_TYPE);
+                      }
+                    
+                  } // column default value has character data type
+                
+                if (NOT isAnErrorAlreadyIssued &&
+                    pColumnDataType->getTypeQualifier() == NA_CHARACTER_TYPE &&
+                    cvTyp->getTypeQualifier() == NA_CHARACTER_TYPE &&
+                    (
+                         CmpCommon::getDefault(ALLOW_IMPLICIT_CHAR_CASTING) == DF_ON ||
+                         NOT cvDef->isStrLitWithCharSetPrefixSpecified()))
+                  {
+                    const CharType *cdCharType = (const CharType *)pColumnDataType;
+                    const CharType *cvCharType = (const CharType *)cvTyp;
+                    CharInfo::CharSet cdCharSet = cdCharType->getCharSet(); // cd = column definition
+                    CharInfo::CharSet cvCharSet = cvCharType->getCharSet(); // cv = constant value
+                    if (cvCharSet == CharInfo::ISO88591)  // default value is a _ISO88591 str lit
+                      {
+                        
+                      }
+                    else if ( (cvCharSet == CharInfo::UNICODE ||  // default value is a _UCS2 string literal
+                               cvCharSet == CharInfo::UTF8)   &&  // or a _UTF8 string literal
+                              cdCharSet != cvCharSet )
+                      {
+                        //
+                        // Check to see if all characters in the specified column default
+                        // string literal value can be successfully converted/translated
+                        // to the actual character set of the column.
+                        //
+                        char buf[2032];  // the output buffer - should be big enough
+                        buf[0] = '\0';
+                        enum cnv_charset eCnvCS = convertCharsetEnum( cdCharSet );
+                        const char * pInStr = cvDef->getRawText()->data();
+                        Int32 inStrLen = cvDef->getRawText()->length();
+                        char * p1stUnstranslatedChar = NULL;
+                        UInt32 outStrLenInBytes = 0;
+                        unsigned charCount = 0;  // number of characters translated/converted
+                        Int32 cnvErrStatus = 0;
+                        char *pSubstitutionChar = NULL;
+                        Int32 convFlags = 0;
+                        
+                        if ( cvCharSet == CharInfo::UNICODE )
+                          {
+                            cnvErrStatus =
+                              UTF16ToLocale
+                              ( cnv_version1            // in  - const enum cnv_version version
+                                , pInStr                  // in  - const char *in_bufr
+                                , inStrLen                // in  - const int in_len
+                                , buf                     // out - const char *out_bufr
+                                , 2016                    // in  - const int out_len
+                                , eCnvCS                  // in  - enum cnv_charset charset
+                                , p1stUnstranslatedChar   // out - char * & first_untranslated_char
+                                , &outStrLenInBytes       // out - unsigned int *output_data_len_p
+                                , convFlags               // in  - const int cnv_flags
+                                , (Int32)TRUE               // in  - const int addNullAtEnd_flag
+                                , (Int32)FALSE              // in  - const int allow_invalids
+                                , &charCount              // out - unsigned int * translated_char_cnt_p
+                                , pSubstitutionChar       // in  - const char *substitution_char
+                                );
+                          }
+                        else // cvCharSet must be CharInfo::UTF8
+                          {
+                            cnvErrStatus =
+                              UTF8ToLocale
+                              ( cnv_version1            // in  - const enum cnv_version version
+                                , pInStr                  // in  - const char *in_bufr
+                                , inStrLen                // in  - const int in_len
+                                , buf                     // out - const char *out_bufr
+                                , 2016                    // in  - const int out_len
+                                , eCnvCS                  // in  - enum cnv_charset charset
+                                , p1stUnstranslatedChar   // out - char * & first_untranslated_char
+                                , &outStrLenInBytes       // out - unsigned int *output_data_len_p
+                                , (Int32)TRUE               // in  - const int addNullAtEnd_flag
+                                , (Int32)FALSE              // in  - const int allow_invalids
+                                , &charCount              // out - unsigned int * translated_char_cnt_p
+                                , pSubstitutionChar       // in  - const char *substitution_char
+                                );
+                          }
+                        switch (cnvErrStatus)
+                          {
+                          case 0: // success
+                          case CNV_ERR_NOINPUT: // an empty input string will get this error code
+                            {
+                              ConstValue *pMBStrLitConstValue ;
+                              // convert the string literal saved in cvDef (column default value)
+                              // from UNICODE (e.g. UTF16) to the column character data type
+                              if ( cdCharSet != CharInfo::UNICODE)
+                                {
+                                  NAString mbs2(buf, PARSERHEAP());  // note that buf is NULL terminated
+                                  pMBStrLitConstValue =
+                                    new(PARSERHEAP()) ConstValue ( mbs2
+                                                                   , cdCharSet // use this for str lit prefix
+                                                                   , CharInfo::DefaultCollation
+                                                                   , CharInfo::COERCIBLE
+                                                                   , PARSERHEAP()
+                                                                   );
+                                }
+                              else
+                                {
+                                  NAWString mbs2((NAWchar*)buf, PARSERHEAP());  // note that buf is NULL terminated
+                                  pMBStrLitConstValue = 
+                                    new(PARSERHEAP()) ConstValue ( mbs2
+                                                                   , cdCharSet // use this for str lit prefix
+                                                                   , CharInfo::DefaultCollation
+                                                                   , CharInfo::COERCIBLE
+                                                                   , PARSERHEAP()
+                                                                   );
+                                }
+                              delete pDefault_; // deallocate the old ConstValue object
+                              cvDef = NULL;     // do not use cvDef anymore
+                              pDefault_ = pMBStrLitConstValue;
+                              pColDefault->setDefaultValueExpr(pDefault_);
+                            }
+                            break;
+                          case CNV_ERR_INVALID_CHAR:
+                            {
+                              // 1401 ==  CAT_UNABLE_TO_CONVERT_COLUMN_DEFAULT_VALUE_TO_CHARSET
+                              *SqlParser_Diags << DgSqlCode(-1401)
+                                               << DgColumnName(ToAnsiIdentifier(getColumnName()))
+                                               << DgString0(CharInfo::getCharSetName(cdCharSet));
+                            }
+                            break;
+                          case CNV_ERR_BUFFER_OVERRUN: // output buffer not big enough
+                          case CNV_ERR_INVALID_CS:
+                          default:
+                            CMPABORT_MSG("Parser internal logic error");
+                            break;
+                          } // switch
+                      }
+                    else if(!pColumnDataType->isCompatible(*cvTyp))
+                      {
+                        if (NOT isAnErrorAlreadyIssued)
+                          {
+                            *SqlParser_Diags << DgSqlCode(-1186)
+                                             << DgColumnName(ToAnsiIdentifier(getColumnName()))
+                                             << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
+                                             << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
+                            isAnErrorAlreadyIssued = TRUE;
+                          }
+                      }
+                  } // column has character data type
+                else
+                  // if interval data type, the default value must have the same
+                  // interval qualifier as the column.
+                  if (NOT isAnErrorAlreadyIssued &&
+                      (!pColumnDataType->isCompatible(*cvTyp) ||
+                       (pColumnDataType->getTypeQualifier() == NA_INTERVAL_TYPE &&
+                        pColumnDataType->getFSDatatype() != cvTyp->getFSDatatype())))
+                    {
+                      *SqlParser_Diags << DgSqlCode(-1186)
+                                       << DgColumnName(ToAnsiIdentifier(getColumnName()))
+                                       << DgString0(pColumnDataType->getTypeSQLname(TRUE/*terse*/))
+                                       << DgString1(cvTyp->getTypeSQLname(TRUE/*terse*/));
+                      isAnErrorAlreadyIssued = TRUE;
+                    }
+              }
+          }
+          break;
+        case ElemDDLColDefault::COL_COMPUTED_DEFAULT:
+          {
+            defaultClauseStatus_ = DEFAULT_CLAUSE_SPEC;
+            computedDefaultExpr_ = pColDefault->getComputedDefaultExpr();
+          }
+          break;
+        default:
+          CMPABORT_MSG("Parser internal logic error");
+          break;
+        }
+    }
+
+}
+
+void
 ElemDDLColDef::setColumnAttribute(ElemDDLNode * pColAttr)
 {
   switch(pColAttr->getOperatorType())
@@ -564,6 +573,7 @@ ElemDDLColDef::setColumnAttribute(ElemDDLNode * pColAttr)
     {
       // Duplicate NOT NULL clauses in column definition.
       *SqlParser_Diags << DgSqlCode(-3052)
+                       << DgString0("NOT NULL")
                        << DgColumnName(ToAnsiIdentifier(getColumnName()));
     }
     isNotNullSpec_ = TRUE;
@@ -692,8 +702,9 @@ ElemDDLColDef::setColumnAttribute(ElemDDLNode * pColAttr)
 	if(TRUE == isLobAttrsSpec_)
 	  {
 	    // Duplicate LOB attrs in column definition.
-	    *SqlParser_Diags << DgSqlCode(-12064)
-			     << DgColumnName(ToAnsiIdentifier(getColumnName()));
+            *SqlParser_Diags << DgSqlCode(-3052)
+                             << DgString0("LOB")
+                             << DgColumnName(ToAnsiIdentifier(getColumnName()));
 	  }
       
       isLobAttrsSpec_ = TRUE;
@@ -706,9 +717,10 @@ ElemDDLColDef::setColumnAttribute(ElemDDLNode * pColAttr)
       ComASSERT( NULL NEQ pColAttr->castToElemDDLSeabaseSerialized())
 	if(TRUE == isSeabaseSerializedSpec_)
 	  {
-	    // Duplicate attrs in column definition.
-	    *SqlParser_Diags << DgSqlCode(-12064)
-			     << DgColumnName(ToAnsiIdentifier(getColumnName()));
+	    // Duplicate SERIALIZED attrs in column definition.
+            *SqlParser_Diags << DgSqlCode(-3052)
+                             << DgString0("SERIALIZED")
+                             << DgColumnName(ToAnsiIdentifier(getColumnName()));
 	  }
       
       isSeabaseSerializedSpec_ = TRUE;
@@ -716,6 +728,22 @@ ElemDDLColDef::setColumnAttribute(ElemDDLNode * pColAttr)
     }
     break;
 
+  case ELM_COL_DEFAULT_ELEM:
+    {
+      ComASSERT( NULL NEQ pColAttr->castToElemDDLColDefault());
+	if(TRUE == isColDefaultSpec_)
+	  {
+	    // Duplicate DEFAULT attrs in column definition.
+            *SqlParser_Diags << DgSqlCode(-3052)
+                             << DgString0("DEFAULT")
+                             << DgColumnName(ToAnsiIdentifier(getColumnName()));
+	  }
+      
+      isColDefaultSpec_ = TRUE;
+      setDefaultAttribute(pColAttr->castToElemDDLColDefault());
+    }
+    break;
+
   default :
     ABORT("internal logic error");
     break;
@@ -1555,7 +1583,7 @@ ElemProxyColDef::ElemProxyColDef(QualifiedName *tableName,
                                  NAType *type,
                                  ElemDDLNode *colAttrs,
                                  CollHeap *heap)
-     : ElemDDLColDef(NULL, &colName, type, NULL, colAttrs, heap),
+     : ElemDDLColDef(NULL, &colName, type, colAttrs, heap),
        tableName_(tableName)
 {
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/core/sql/parser/ElemDDLColDef.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLColDef.h b/core/sql/parser/ElemDDLColDef.h
index a0f9e00..2f275d0 100644
--- a/core/sql/parser/ElemDDLColDef.h
+++ b/core/sql/parser/ElemDDLColDef.h
@@ -74,13 +74,14 @@ public:
   enum defaultClauseStatusType { DEFAULT_CLAUSE_NOT_SPEC = 0,
                                  NO_DEFAULT_CLAUSE_SPEC = 1,
                                  DEFAULT_CLAUSE_SPEC = 2};
-  
+  enum { INDEX_ELEM_DDL_COL_ATTR_LIST = 0,
+         MAX_ELEM_DDL_COL_DEF_ARITY = 1};
+
   // default constructor
   ElemDDLColDef(
        const NAString * columnFamily,
        const NAString * columnName,
        NAType * pColumnDataType,
-       ElemDDLNode * pColDefaultValue = NULL,
        ElemDDLNode * pColAttrList = NULL,
        CollHeap * heap = PARSERHEAP());
 
@@ -116,6 +117,8 @@ public:
   void setDefaultClauseStatus(defaultClauseStatusType d)
   { defaultClauseStatus_ = d; }
 
+  void setDefaultAttribute(ElemDDLNode * pColDefaultNode);
+
   inline const defaultClauseStatusType getDefaultClauseStatus() const;
 
         // Currently, only three cases are available:
@@ -201,6 +204,8 @@ public:
   NABoolean isSerializedSpecified() { return isSeabaseSerializedSpec_; }
   inline NABoolean isSeabaseSerialized() { return seabaseSerialized_; }
 
+  NABoolean isColDefaultSpecified() { return isColDefaultSpec_; }
+
   //
   // methods for tracing
   //
@@ -292,10 +297,6 @@ private:
   //   Column Attributes list includes column constraint definitions
   //   and column heading specification (HEADING clause).
   //
-  enum { INDEX_ELEM_DDL_COL_DEFAULT_VALUE = 0,
-         INDEX_ELEM_DDL_COL_ATTR_LIST,
-         MAX_ELEM_DDL_COL_DEF_ARITY };
-
   ElemDDLNode * children_[MAX_ELEM_DDL_COL_DEF_ARITY];
 
   ComColumnDirection direction_;  // IN / OUT / INOUT
@@ -307,6 +308,7 @@ private:
   NABoolean isSeabaseSerializedSpec_;
   NABoolean seabaseSerialized_;
 
+  NABoolean isColDefaultSpec_;
 }; // class ElemDDLColDef
 
 // -----------------------------------------------------------------------



[09/50] [abbrv] incubator-trafodion git commit: add lv_hbase_cp

Posted by db...@apache.org.
add lv_hbase_cp


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

Branch: refs/heads/master
Commit: 02822109f21cc80f7787ac04fc8ffe87431542b3
Parents: 71f80f6
Author: traf <tr...@aven01.novalocal>
Authored: Fri Mar 11 10:05:45 2016 +0000
Committer: traf <tr...@aven01.novalocal>
Committed: Fri Mar 11 10:05:45 2016 +0000

----------------------------------------------------------------------
 core/sqf/sqenvcom.sh | 59 +++++++----------------------------------------
 1 file changed, 8 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/02822109/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 6c96ef4..6dadb19 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -281,6 +281,8 @@ if [[ -e $MY_SQROOT/sql/scripts/sw_env.sh ]]; then
     HBASE_JAR_FILES="$HBASE_JAR_FILES $d/*.jar"
   done
 
+  lv_hbase_cp=
+
   export HIVE_JAR_DIRS="$HIVE_HOME/lib"
   export HIVE_JAR_FILES="$HIVE_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client-core-*.jar"
 
@@ -312,18 +314,6 @@ elif [[ -d /opt/cloudera/parcels/CDH ]]; then
   export HADOOP_JAR_DIRS="/opt/cloudera/parcels/CDH/lib/hadoop
                           /opt/cloudera/parcels/CDH/lib/hadoop/lib"
   export HADOOP_JAR_FILES="/opt/cloudera/parcels/CDH/lib/hadoop/client/hadoop-hdfs-*.jar"
-  export HBASE_JAR_FILES="/opt/cloudera/parcels/CDH/lib/hbase/hbase-*-security.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-client.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-common.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-server.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-examples.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-protocol.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/lib/htrace-core.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/lib/zookeeper.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/lib/$protobuf-*.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/lib/snappy-java-*.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/lib/high-scale-lib-*.jar
-                          /opt/cloudera/parcels/CDH/lib/hbase/hbase-hadoop-compat.jar "
   export HIVE_JAR_DIRS="/opt/cloudera/parcels/CDH/lib/hive/lib"
   export HIVE_JAR_FILES="/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/hadoop-mapreduce-client-core.jar
                          /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/hadoop-mapreduce-client-common.jar"
@@ -356,18 +346,6 @@ elif [[ -n "$(ls /usr/lib/hadoop/hadoop-*cdh*.jar 2>/dev/null)" ]]; then
   export HADOOP_JAR_DIRS="/usr/lib/hadoop
                           /usr/lib/hadoop/lib"
   export HADOOP_JAR_FILES="/usr/lib/hadoop/client/hadoop-hdfs-*.jar"
-  export HBASE_JAR_FILES="/usr/lib/hbase/hbase-*-security.jar
-                          /usr/lib/hbase/hbase-client.jar
-                          /usr/lib/hbase/hbase-common.jar
-                          /usr/lib/hbase/hbase-server.jar
-                          /usr/lib/hbase/hbase-examples.jar
-                          /usr/lib/hbase/hbase-protocol.jar
-                          /usr/lib/hbase/lib/htrace-core.jar
-                          /usr/lib/hbase/lib/zookeeper.jar
-                          /usr/lib/hbase/lib/protobuf-*.jar
-                         /usr/lib/hbase/lib/snappy-java-*.jar
-                         /usr/lib/hbase/lib/high-scale-lib-*.jar
-                         /usr/lib/hbase/hbase-hadoop-compat.jar "
   export HIVE_JAR_DIRS="/usr/lib/hive/lib"
   export HIVE_JAR_FILES="/usr/lib/hadoop-mapreduce/hadoop-mapreduce-client-core.jar"
 
@@ -399,18 +377,6 @@ elif [[ -n "$(ls /etc/init.d/ambari* 2>/dev/null)" ]]; then
   export HADOOP_JAR_DIRS="/usr/hdp/current/hadoop-client
                           /usr/hdp/current/hadoop-client/lib"
   export HADOOP_JAR_FILES="/usr/hdp/current/hadoop-client/client/hadoop-hdfs-*.jar"
-  export HBASE_JAR_FILES="/usr/hdp/current/hbase-client/hbase-*-security.jar
-                          /usr/hdp/current/hbase-client/lib/hbase-common.jar
-                          /usr/hdp/current/hbase-client/lib/hbase-client.jar
-                          /usr/hdp/current/hbase-client/lib/hbase-server.jar
-                          /usr/hdp/current/hbase-client/lib/hbase-protocol.jar
-                          /usr/hdp/current/hbase-client/lib/htrace-core*.jar
-                          /usr/hdp/current/hbase-client/lib/zookeeper.jar
-                          /usr/hdp/current/hbase-client/lib/protobuf-*.jar
-                         /usr/hdp/current/hbase-client/lib/snappy-java-*.jar
-                         /usr/hdp/current/hbase-client/lib/high-scale-lib-*.jar
-                         /usr/hdp/current/hbase-client/lib/hbase-hadoop-compat-*-hadoop2.jar "
-
   export HIVE_JAR_DIRS="/usr/hdp/current/hive-client/lib"
   export HIVE_JAR_FILES="/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core*.jar"
 
@@ -599,23 +565,12 @@ EOF
                             $APACHE_HADOOP_HOME/share/hadoop/mapreduce
                             $APACHE_HADOOP_HOME/share/hadoop/hdfs"
     export HADOOP_JAR_FILES=
-
-
-    export HBASE_JAR_FILES="$APACHE_HBASE_HOME/lib/hbase-common-*.jar
-                            $APACHE_HBASE_HOME/lib/hbase-client-*.jar
-                            $APACHE_HBASE_HOME/lib/hbase-server-*.jar
-                            $APACHE_HBASE_HOME/lib/hbase-protocol-*.jar
-                            $APACHE_HBASE_HOME/lib/hbase-examples-*.jar
-                            $APACHE_HBASE_HOME/lib/htrace-core-*.jar
-                            $APACHE_HBASE_HOME/lib/zookeeper-*.jar
-                            $APACHE_HBASE_HOME/lib/protobuf-*.jar
-                            $APACHE_HBASE_HOME/lib/snappy-java-*.jar
-                            $APACHE_HBASE_HOME/lib/high-scale-lib-*.jar
-                            $APACHE_HBASE_HOME/lib/hbase-hadoop-compat-*-hadoop2.jar "
-
     export HIVE_JAR_DIRS="$APACHE_HIVE_HOME/lib"
 
-    export HBASE_TRX_JAR=hbase-trx-hbase_98_4-${TRAFODION_VER}.jar
+    #hbase classpath captures all the right set of jars hbase is using.
+    #this also includes the trx jar that gets installed as part of install.
+    #Additional testing needed.Including it here for future validation.
+    lv_hbase_cp=`hbase classpath`
 
     # end of code for Apache Hadoop/HBase installation w/o distro
   else
@@ -858,6 +813,8 @@ for d in $HIVE_JAR_DIRS; do
   HIVE_JAR_FILES="$HIVE_JAR_FILES $d/*.jar"
 done
 
+SQ_CLASSPATH=$lv_hbase_cp;
+
 # assemble all of them into a classpath
 for j in $HBASE_JAR_FILES $HADOOP_JAR_FILES $HIVE_JAR_FILES; do
   if [[ -f $j ]]; then


[49/50] [abbrv] incubator-trafodion git commit: Merge pull request #12 from apache/master

Posted by db...@apache.org.
Merge pull request #12 from apache/master

update head

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

Branch: refs/heads/master
Commit: c67fbfd03b5da42c8dd21974539a18a04b2625e1
Parents: 56650c0 70b17ed
Author: mashengchen <ma...@gmail.com>
Authored: Thu Mar 31 10:20:57 2016 +0800
Committer: mashengchen <ma...@gmail.com>
Committed: Thu Mar 31 10:20:57 2016 +0800

----------------------------------------------------------------------
 core/sqf/src/seabed/src/fs.cpp             |    3 +-
 core/sql/executor/ex_control.cpp           |    6 +
 core/sql/regress/core/EXPECTEDRTS          | 1436 ++++++++++++-----------
 core/sql/regress/core/FILTERRTS            |    2 +
 core/sql/regress/core/TESTRTS              |   24 +-
 core/sql/regress/tools/runregr_udr.ksh     |    2 +-
 core/sql/regress/udr/EXPECTED103           |  529 +++++++++
 core/sql/regress/udr/FILTER103             |   25 +
 core/sql/regress/udr/TEST103               |  246 ++++
 core/sql/regress/udr/TEST103_functions.cpp |  191 +++
 core/sql/regress/udr/TEST103_procs.java    |  224 ++++
 core/sql/regress/udr/Utils.java            |  279 +++++
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp  |   23 +-
 core/sql/sqlcomp/nadefaults.cpp            |    2 +-
 install/installer/traf_cloudera_mods98     |    6 +-
 15 files changed, 2322 insertions(+), 676 deletions(-)
----------------------------------------------------------------------



[26/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED313
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED313 b/core/sql/regress/charsets/EXPECTED313
index c9eecb5..521e3bc 100644
--- a/core/sql/regress/charsets/EXPECTED313
+++ b/core/sql/regress/charsets/EXPECTED313
@@ -628,28 +628,28 @@ u1u1                       8
 --- 4 row(s) selected.
 >>select * from cs313t3 union (select * from cs313t4) order by 1;
 
-A1              
-----------------
+A1                                                              
+----------------------------------------------------------------
 
-a1a1            
-u1u1            
-���             
-???             
+a1a1                                                            
+u1u1                                                            
+���                                                             
+???                                                             
 
 --- 4 row(s) selected.
 >>select * from cs313t3 union all (select * from cs313t4) order by 1;
 
-A1              
-----------------
+A1                                                              
+----------------------------------------------------------------
 
-a1a1            
-a1a1            
-u1u1            
-u1u1            
-���             
-���             
-???             
-???             
+a1a1                                                            
+a1a1                                                            
+u1u1                                                            
+u1u1                                                            
+���                                                             
+���                                                             
+???                                                             
+???                                                             
 
 --- 8 row(s) selected.
 >>--
@@ -5092,28 +5092,28 @@ def               def
 --- 4 row(s) selected.
 >>select * from cs313t70 union (select * from cs313t71) order by 1,2;
 
-A1                U1              
-----------------  ----------------
+A1                                                                U1
+----------------------------------------------------------------  ----------------------------------------------------------------
 
-abc               abc             
-def               def             
-���               ���             
-???               ???             
+abc                                                               abc                                                             
+def                                                               def                                                             
+���                                                               ���                                                             
+???                                                               ???                                                             
 
 --- 4 row(s) selected.
 >>select * from cs313t70 union all (select * from cs313t71) order by 1,2;
 
-A1                U1              
-----------------  ----------------
+A1                                                                U1
+----------------------------------------------------------------  ----------------------------------------------------------------
 
-abc               abc             
-abc               abc             
-def               def             
-def               def             
-���               ���             
-���               ���             
-???               ???             
-???               ???             
+abc                                                               abc                                                             
+abc                                                               abc                                                             
+def                                                               def                                                             
+def                                                               def                                                             
+���                                                               ���                                                             
+���                                                               ���                                                             
+???                                                               ???                                                             
+???                                                               ???                                                             
 
 --- 8 row(s) selected.
 >>--
@@ -5188,24 +5188,24 @@ def                               def               def               def
 >>--
 >>select * from cs313t70 union (select * from cs313t70 union (select * from cs313t71)) order by 1,2;
 
-A1                U1              
-----------------  ----------------
+A1                                                                U1
+----------------------------------------------------------------  ----------------------------------------------------------------
 
-abc               abc             
-def               def             
-���               ���             
-???               ???             
+abc                                                               abc                                                             
+def                                                               def                                                             
+���                                                               ���                                                             
+???                                                               ???                                                             
 
 --- 4 row(s) selected.
 >>select * from cs313t70 union (select * from cs313t71 union (select * from cs313t70)) order by 1,2;
 
-A1                U1              
-----------------  ----------------
+A1                                                                U1
+----------------------------------------------------------------  ----------------------------------------------------------------
 
-abc               abc             
-def               def             
-���               ���             
-???               ???             
+abc                                                               abc                                                             
+def                                                               def                                                             
+���                                                               ���                                                             
+???                                                               ???                                                             
 
 --- 4 row(s) selected.
 >>--
@@ -5724,7 +5724,10 @@ u1u1                              u1u1
 >>create TRIGGER TRG1_cs313t90   before UPDATE on cs313t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UCS2_col2 = _UTF8'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs313t90 values('Test1','Test1','Test1','Test1'), ('test111','test1111','test111','test1111');
 
@@ -5737,7 +5740,7 @@ u1u1                              u1u1
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5750,7 +5753,7 @@ test111                                                                   test11
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5766,8 +5769,8 @@ test111                                                                   test11
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 
@@ -5781,8 +5784,8 @@ test222                                                                   test22
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 
@@ -5799,9 +5802,9 @@ test222                                                                   test22
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5816,9 +5819,9 @@ test333                                                                   test33
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5827,11 +5830,17 @@ test333                                                                   test33
 >>--
 >>DROP TRIGGER TRG1_cs313t90;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs313t90   before UPDATE on cs313t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _ucs2'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs313t90 values('Test4','Test4','Test4','Test4'), ('test444','test4444','test444','test4444');
 
@@ -5844,10 +5853,10 @@ test333                                                                   test33
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5863,10 +5872,10 @@ test444                                                                   test44
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5885,11 +5894,11 @@ test444                                                                   test44
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5906,11 +5915,11 @@ test555                                                                   test55
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5930,12 +5939,12 @@ test555                                                                   test55
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Iso6                                                                      Test6                                                                     Test6                                 abc                                 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Iso6                                                                      Test6                                                                     Test6                                 Test6                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5953,12 +5962,12 @@ test666                                                                   test66
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Iso6                                                                      Test6                                                                     Test6                                 abc                                 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Iso6                                                                      Test6                                                                     Test6                                 Test6                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5984,7 +5993,10 @@ test666                                                                   test66
 >>create TRIGGER TRG1_cs313t91   before UPDATE on cs313t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UCS2_col2 = _UTF8'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs313t91 values(1,'Test1','Test1','Test1','Test1'), (2,'test111','test1111','test111','test1111');
 
@@ -5997,7 +6009,7 @@ test666                                                                   test66
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -6010,7 +6022,7 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -6026,9 +6038,9 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -6041,9 +6053,9 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -6059,11 +6071,11 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
 
 --- 6 row(s) selected.
@@ -6076,22 +6088,28 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
 
 --- 6 row(s) selected.
 >>--
 >>DROP TRIGGER TRG1_cs313t91;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs313t91   before UPDATE on cs313t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _ucs2'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs313t91 values(7,'Test4','Test4','Test4','Test4'), (8,'test444','test4444','test444','test4444');
 
@@ -6104,13 +6122,13 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -6123,13 +6141,13 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -6145,15 +6163,15 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -6166,15 +6184,15 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -6190,17 +6208,17 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
-         11  Iso6                                                                      Test6                                                                     Test6                                 abc                                 
+         11  Iso6                                                                      Test6                                                                     Test6                                 Test6                               
          12  test666                                                                   test6666                                                                  test666                               test6666                            
 
 --- 12 row(s) selected.
@@ -6213,17 +6231,17 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
-         11  Iso6                                                                      Test6                                                                     Test6                                 abc                                 
+         11  Iso6                                                                      Test6                                                                     Test6                                 Test6                               
          12  test666                                                                   test6666                                                                  test666                               test6666                            
 
 --- 12 row(s) selected.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/DIFF006.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/DIFF006.KNOWN.SB b/core/sql/regress/compGeneral/DIFF006.KNOWN.SB
deleted file mode 100644
index fb4d19d..0000000
--- a/core/sql/regress/compGeneral/DIFF006.KNOWN.SB
+++ /dev/null
@@ -1,4 +0,0 @@
-96c96
-< *** ERROR[3233] This type of UPDATE is not allowed when NO ROLLBACK transaction setting is in effect. Suggestion: Set ALLOW_RISKY_UPDATE_WITH_NO_ROLLBACK CQD to ON to allow UPDATE command with right-hand side SET clause consisting of columns.
----
-> *** ERROR[3231] WITH NO ROLLBACK clause was used in an INSERT, UPDATE, or DELETE statement when AUTOCOMMIT is OFF.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/compGeneral/EXPECTED005
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED005 b/core/sql/regress/compGeneral/EXPECTED005
index f3a87e9..e9b12ce 100755
--- a/core/sql/regress/compGeneral/EXPECTED005
+++ b/core/sql/regress/compGeneral/EXPECTED005
@@ -1001,9 +1001,10 @@ DNO                   DNAME                 ENO          DNO
 +>        select A.dno,B.eno
 +>        from t005t02 A full outer join t005t01 B on A.dno = B.dno;
 
-*** ERROR[12001] Creation failed. The materialized view cannot be maintained incrementally.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
 
---- SQL operation failed with errors.
 >>
 >>create materialized view T_MV1
 +>        Refresh on statement
@@ -1012,9 +1013,10 @@ DNO                   DNAME                 ENO          DNO
 +>        select A.dno,B.eno
 +>        from t005t02 A full outer join t005t01 B on A.dno = B.dno;
 
-*** ERROR[12001] Creation failed. The materialized view cannot be maintained incrementally.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
 
---- SQL operation failed with errors.
 >>
 >>
 >>?section cleanup


[41/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc b/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
new file mode 100644
index 0000000..a9fbe86
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
@@ -0,0 +1,416 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[performance-and-troubleshooting]]
+= Performance and Troubleshooting
+
+This chapter describes how to improve and monitor the performance of
+SPJs on the Trafodion platform and provides guidelines for
+troubleshooting common problems:
+
+* link:#_bookmark209["Troubleshooting Common Problems"]
+* link:#_bookmark212["Performance Tip"]
+* link:#_bookmark214["Displaying an Execution Plan of a CALL Statement"
+(page 59)]
+
+[[troubleshooting-common-problems]]
+== Troubleshooting Common Problems
+
+To resolve problems that occur when you register or execute an SPJ,
+follow these guidelines:
+
+* Note the SQLCODE or SQLSTATE value of the error messages and locate
+the information in the __Neoview Messages Manual__, which provides
+cause, effect, and recovery information for all SQL errors.
+* Check that the user has the appropriate permissions to create or call
+the SPJ. See these sections:
+** link:#_bookmark114["Required Privileges for Creating or Dropping an
+SPJ" (page 37)]
+** link:#_bookmark156["Required Privileges for Calling an SPJ" (page
+49)]
+* Check the code of the SPJ method. See link:#bookmark36[Chapter 3 (page
+18)]. Fix any problems.
+* If you successfully compiled, deployed, and registered the SPJ but are
+receiving errors when calling the SPJ, check that the output parameters
+in the Java method are specified as arrays. See
+link:#_bookmark48["Returning Output Values From the Java Method" (page
+19)].
+* Verify that someone did not alter the library by selecting a JAR file
+that contains a different class name, method name, or method signature
+than the original JAR file, without dropping and re-creating the SPJ.
+
+In HPDM, compare the library's class name, method name, and method
+signature with the procedure's external file (class name), external name
+(method name), and signature. To see the library's class name, method
+name, and method signature, launch the Library Browser dialog box in
+HPDM by right-clicking the name of the library, and selecting Browse
+Library. For more information, see link:#_bookmark109["Use the Library
+Browser" (page 35)]. To see the procedure's external file (class name),
+external name (method name), and signature in HPDM, see
+link:#_bookmark131["Using HPDM] link:#_bookmark131[to Display a
+Procedure in a Schema" (page 42)]. If you notice a discrepancy, see
+link:#_bookmark136["Altering] link:#_bookmark136[an SPJ and Its Java
+Bytecode" (page 44)].
+
+* Check the characteristics of the stored procedure in HPDM and compare
+them with the SPJ method that resides on the Trafodion platform. Fix any
+discrepancies.
+* Check the syntax of the CALL statement in the application. See
+link:#bookmark151[Chapter 7 (page 49)]. Fix any problems.
+* If the SPJ is supposed to return result sets, but the result sets are
+not being returned to the calling application, check that the SPJ method
+does not explicitly close a java.sql.Connection object. See
+link:#_bookmark66["Use of java.sql.Connection Objects" (page 23)].
+* If a java.lang.ArrayIndexOutOfBoundsException occurs, check that the
+SPJ method is not trying to insert more than one array element into a
+java.sql.ResultSets[] array. For more information, see
+link:#_bookmark54["Returning Stored Procedure Result Sets" (page 20)].
+* To identify Java-related errors, execute the SPJ method outside the
+Trafodion database by invoking the Java method directly in a Java
+application that you run on a client workstation, using the HP JDBC Type
+4 driver to connect to the Trafodion platform.
+* If you are using JDBC tracing and logging, follow these guidelines:
+** Execute the SPJ method outside the database by invoking the Java
+method directly from a Java application that you run on a client
+workstation, using the HP JDBC Type 4 driver to connect to the Trafodion
+platform.
+** Verify that the file directory specified in the T4LogFile property
+exists on the client workstation and that you have write access to it.
+
+For more information about JDBC tracing and logging, see the __Neoview
+JDBC Type 4 Driver Programmer's Reference__.
+
+
+[[performance-tip]]
+== Performance Tip
+
+To ensure the optimal performance of SPJs on the Trafodion platform,
+avoid nesting CALL statements in an SPJ method, which wastes resources
+and might diminish performance. For more information, see
+link:#_bookmark62["Nested Java Method Invocations" (page 22)].
+
+[[displaying-an-execution-plan-of-a-call-statement]]
+== Displaying an Execution Plan of a CALL Statement
+
+An execution plan reveals how a CALL statement was optimized. You can
+display all or part of the execution plan for a CALL statement by using
+the EXPLAIN statement or function.
+
+[[using-the-explain-statement]]
+=== Using the EXPLAIN Statement
+
+Suppose that you want to display the execution plan for this CALL
+statement:
+
+```
+CALL demo.persnl.adjustsalary(202,5.5,?);
+```
+
+Enter this EXPLAIN statement in an trafci session:
+
+```
+SQL>**prepare spj1 from call demo.persnl.adjustsalary(202,5.5,?);**
+
+--- SQL command prepared. SQL>**explain spj1;**
+
+------------------------------------------------------------------ PLAN
+SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED
+
+STATEMENT_NAME ........... SPJ1
+
+PLAN_ID .................. 212206487012085509
+
+ROWS_OUT 1
+
+EST_TOTAL_COST 0
+
+STATEMENT ................ call demo.persnl.adjustsalary(202,5.5,?)
+
+------------------------------------------------------------------ NODE
+LISTING ROOT ====================================== SEQ_NO 2 ONLY CHILD
+1 REQUESTS_IN 1
+
+ROWS_OUT 1
+
+EST_OPER_COST 0
+
+EST_TOTAL_COST 0
+
+DESCRIPTION
+
+max_card_est 1
+
+fragment_id 0
+
+parent_frag ............ (none)
+
+fragment_type .......... master
+
+statement_index 0
+
+affinity_value 3,466,211,324
+
+max_max_cardinality 1
+
+total_overflow_size .... 0.00 KB xn_autoabort_interval -1
+
+plan_version ....... 2,500
+
+LDAP_USERNAME .......... sqluser_admin NVCI_PROCESS ........... ON
+SHOWCONTROL_UNEXTERNALI OFF
+
+SCHEMA ................. DEMO.INVENT
+
+CATALOG ................ NEO
+
+PRIORITY ............... 9 (for table
+HP_SYSTEM_CATALOG.MXCS_SCHEMA.ASSOC2DS) PRIORITY ............... 9 (for
+table HP_SYSTEM_CATALOG.MXCS_SCHEMA.DATASOURC
+
+ES)
+
+PRIORITY ............... 9 (for table
+HP_SYSTEM_CATALOG.MXCS_SCHEMA.ENVIRONME
+
+NTVALUES)
+
+PRIORITY ............... 9 (for table
+HP_SYSTEM_CATALOG.MXCS_SCHEMA.NAME2ID) PRIORITY ............... 9 (for
+table HP_SYSTEM_CATALOG.MXCS_SCHEMA.RESOURCEP
+
+OLICIES) select_list ............ NUMERIC(8,2) SIGNED
+
+input_variables ........ ?
+
+CALL ====================================== SEQ_NO 1 NO CHILDREN
+TABLE_NAME ............... DEMO.PERSNL.ADJUSTSALARY
+
+REQUESTS_IN 1
+
+ROWS_OUT 1
+
+EST_OPER_COST 0
+
+EST_TOTAL_COST 0
+
+DESCRIPTION
+
+max_card_est ........... -1
+
+fragment_id 0
+
+parent_frag ............ (none)
+
+fragment_type .......... master
+
+routine_name ........... DEMO.PERSNL.ADJUSTSALARY
+
+parameter_modes ........ I I O sql_access_mode ........ MODIFIES SQL
+DATA external_name .......... adjustSalary library ................
+DEMO.PERSNL.PAYROLL
+
+external_file .......... Payroll
+
+signature ..............
+(Ljava/math/BigDecimal;D[Ljava/math/BigDecimal;)V language
+............... JAVA
+
+parameter_style ........ JAVA external_security ...... INVOKER
+max_result_sets 0
+
+parameters ............. cast(202), cast(cast((cast(5.5) / cast(10)))),
+
+NUMERIC(8,2) SIGNED
+
+--- SQL operation complete. SQL>
+```
+
+The EXPLAIN statement generates and displays all the columns of the
+result table of the EXPLAIN function. For the syntax of the EXPLAIN
+statement, see the __Trafodion SQL Reference Manual__. For more
+information about optimizing query execution plans, see the __Trafodion
+Query Guide__.
+
+[[using-the-explain-function]]
+=== Using the EXPLAIN Function
+
+You can also prepare the CALL statement and select specific columns from
+the result table of the EXPLAIN function, as shown below:
+
+```
+SQL>**prepare spj1 from call demo.persnl.adjustsalary(202,5.5,?);**
+
+--- SQL command prepared.
+
+SQL>**select substring(operator,1,8) as "OPERATOR", operator_cost,**
+
++>**substring(description,1,500) as "DESCRIPTION"**
+
++>**from table (explain(null, 'SPJ1'));**
+
+OPERATOR OPERATOR_COST  DESCRIPTION
+-------- -------------- --------------------------------------------------------------------------------------
+
+CALL 0.0 max_card_est: -1 fragment_id: 0 parent_frag: (none)
+fragment_type: master routine_name: DEMO.PERSNL.ADJUSTSALARY
+parameter_modes: I I O sql_access_mode: MODIFIES SQL DATA external_name:
+adjustSalary library: DEMO.PERSNL.PAYROLL external_file: Payroll
+signature: (Ljava/math/BigDecimal;D[Ljava/math/BigDecimal;)V language:
+JAVA parameter_style: JAVA external_security: INVOKER max_result_sets: 0
+parameters: cast(202), cast(cast((cast(5.5) / cast(10)))), NUMERIC(8,2)
+SIGNED
+
+ROOT 0.0 max_card_est: 1 fragment_id: 0 parent_frag: (none)
+fragment_type: master statement_index:
+
+0 affinity_value: 3466211324 max_max_cardinality: 1 total_overflow_size:
+0.00 KB statement: call demo.persnl.adjustsalary(202,5.5,?)
+xn_autoabort_interval: -1 plan_version: 2500 LDAP_USERNAME:
+sqluser_admin NVCI_PROCESS: ON SHOWCONTROL_UNEXTERNALIZED_ATTRS: OFF
+SCHEMA: DEMO.INVENT CATALOG: NEO PRIORITY: 9 (for table
+HP_SYSTEM_CATALOG.MXCS_SCHEMA.ASSOC2DS) PRIORITY: 9 (for table
+HP_SYSTEM_CATALOG.MXCS_SCHEMA.D
+
+--- 2 row(s) selected. SQL>
+```
+
+For a CALL statement, the OPERATOR column of the result table contains a
+row named CALL. The DESCRIPTION column contains special token pairs for
+the CALL operator. For descriptions of the token pairs, see this table:
+
+Token
+
+Token Description
+
+Data Type
+
+max_card_est
+
+The upper limit for the operator cardinality in the query tree.
+
+integer
+
+fragment_id
+
+A sequential number assigned to the fragment. 0 is always the master
+executor, and 1 is reserved for the Explain plan. Numbers 2 to _n_ will
+be ESP or TSE fragments.
+
+integer
+
+parent_frag
+
+The fragment_id for the parent fragment of the current fragment. The
+value is (none) for the master executor.
+
+integer
+
+fragment_type
+
+Type of fragment, which can be either master, ESP, or TSE.
+
+text
+
+routine_name
+
+ANSI name of the procedure.
+
+text
+
+parameter_modes
+
+A sequence of characters that specifies SQL parameter modes for the
+procedure. I is used for an IN parameter, O for an OUT parameter, and N
+for an INOUT parameter. Characters are separated by a single space. The
+value none is returned if the procedure has no SQL parameters.
+
+text
+
+sql_access_mode
+
+SQL access mode of the procedure.
+
+text
+
+external_name
+
+Java method name.
+
+text
+
+library
+
+ANSI name of the library object that maps to the procedure's JAR file.
+
+text
+
+external_file
+
+Java class name, possibly prefixed by a package name, that contains the
+SPJ method.
+
+text
+
+signature
+
+Java signature of the SPJ method in internal Java Virtual Machine (JVM)
+format.
+
+text
+
+language
+
+Language in which the SPJ method is written, which is always Java.
+
+text
+
+parameter_style
+
+Convention of passing parameter arguments to the stored procedure, which
+conforms to the Java language for SPJs.
+
+text
+
+external_security
+
+External security of the stored procedure, indicating the privileges or
+rights that users have when executing (or calling) the procedure. The
+value is either INVOKER or DEFINER. For more information, see
+link:#_bookmark124["Understand External Security" (page 41)].
+
+text
+
+max_result_sets
+
+The maximum number of result sets that this procedure can return.
+
+integer
+
+parameters
+
+The parameter arguments that are passed to or from the procedure.
+
+text
+
+For the syntax of the EXPLAIN function, see the __Trafodion SQL Reference
+Manual__.
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/sample_database.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/sample_database.adoc b/docs/spj_guide/src/asciidoc/_chapters/sample_database.adoc
new file mode 100644
index 0000000..6ee790c
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/sample_database.adoc
@@ -0,0 +1,816 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[b-sample-database]]
+= B Sample Database
+
+This appendix presents the Sample Database schemas and tables on which
+the SPJs in this manual operate:
+
+* link:#_bookmark338["PERSNL Schema" (page 103)]
+** link:#_bookmark340["JOB Table" (page 103)]
+** link:#_bookmark342["EMPLOYEE Table" (page 104)]
+** link:#_bookmark344["DEPT Table" (page 106)]
+** link:#_bookmark346["PROJECT Table" (page 107)]
+* link:#_bookmark348["SALES Schema" (page 110)]
+** link:#_bookmark350["CUSTOMER Table" (page 110)]
+** link:#_bookmark352["ORDERS Table" (page 111)]
+** link:#_bookmark354["ODETAIL Table" (page 112)]
+** link:#_bookmark356["PARTS Table" (page 114)]
+* link:#_bookmark358["INVENT Schema" (page 115)]
+** link:#_bookmark360["SUPPLIER Table" (page 115)]
+** link:#_bookmark362["PARTSUPP Table" (page 116)]
+** link:#_bookmark364["PARTLOC Table" (page 119)]
+
+[[persnl-schema]]
+== PERSNL Schema
+
+The PERSNL schema stores employee data.
+
+```
+CREATE SCHEMA DEMO.PERSNL ;
+SET SCHEMA DEMO.PERSNL ;
+```
+
+[[job-table]]
+=== JOB Table
+
+```
+CREATE TABLE demo.persnl.job
+( jobcode NUMERIC (4)  UNSIGNED NO DEFAULT  NOT NULL
+, jobdesc VARCHAR (18)          DEFAULT ' ' NOT NULL
+, PRIMARY KEY (jobcode)
+) ;
+
+INSERT INTO demo.persnl.job VALUES
+  ( 100, 'MANAGER' )
+, ( 200, 'PRODUCTION SUPV' )
+, ( 250, 'ASSEMBLER' )
+, ( 300, 'SALESREP' )
+, ( 400, 'SYSTEM ANALYST' )
+, ( 420, 'ENGINEER' )
+, ( 450, 'PROGRAMMER' )
+, ( 500, 'ACCOUNTANT' )
+, ( 600, 'ADMINISTRATOR' )
+, ( 900, 'SECRETARY' )
+;
+
+UPDATE STATISTICS FOR TABLE demo.persnl.job ON EVERY COLUMN;
+```
+
+[[employee-table]]
+=== EMPLOYEE Table
+
+```
+CREATE TABLE demo.persnl.employee
+( empnum     NUMERIC (4)    UNSIGNED NO DEFAULT  NOT NULL
+, first_name CHARACTER (15)          DEFAULT ' ' NOT NULL
+, last_name  CHARACTER (20)          DEFAULT ' ' NOT NULL
+, deptnum    NUMERIC (4)    UNSIGNED NO DEFAULT  NOT NULL
+, jobcode    NUMERIC (4)    UNSIGNED DEFAULT     NULL
+, salary     NUMERIC (8, 2) UNSIGNED DEFAULT     NULL
+, PRIMARY KEY (empnum)
+);
+
+ALTER TABLE demo.persnl.employee
+   ADD CONSTRAINT empnum_constrnt CHECK (empnum BETWEEN 0001 AND 9999)
+   ;
+
+CREATE INDEX xempname ON employee
+( last_name
+, first_name
+) ;
+
+CREATE INDEX xempdept ON employee
+( deptnum
+) ;
+
+CREATE VIEW demo.persnl.emplist AS
+SELECT
+  empnum
+, first_name
+, last_name
+, deptnum
+, jobcode
+FROM employee
+;
+
+INSERT INTO demo.persnl.employee VALUES
+  (  1,  'ROGER',    'GREEN',      9000, 100,  175500.00 )
+, ( 23,  'JERRY',    'HOWARD',     1000, 100,  137000.10 )
+, ( 29,  'JANE',     'RAYMOND',    3000, 100,  136000.00 )
+, ( 32,  'THOMAS',   'RUDLOFF',    2000, 100,  138000.40 )
+, ( 39,  'KLAUS ',   'SAFFERT',    3200, 100,  75000.00  )
+, ( 43,  'PAUL',     'WINTER',     3100, 100,  90000.00  )
+, ( 65,  'RACHEL',   'MCKAY',      4000, 100,  118000.00 )
+, ( 72,  'GLENN',    'THOMAS',     3300, 100,  80000.00  )
+, ( 75,  'TIM',      'WALKER',     3000, 300,  32000.00  )
+, ( 87,  'ERIC',     'BROWN',      4000, 400,  89000.00  )
+, ( 89,  'PETER',    'SMITH',      3300, 300,  37000.40  )
+, ( 93,  'DONALD',   'TAYLOR',     3100, 300,  33000.00  )
+, ( 104, 'DAVID',    'STRAND',     4000, 400,  69000.00  )
+, ( 109, 'STEVE',    'COOK',       4000, 400,  68000.00  )
+, ( 111, 'SHERRIE',  'WONG',       3500, 100,  70000.00  )
+, ( 178, 'JOHN',     'CHOU',       3500, 900,  28000.00  )
+, ( 180, 'MANFRED',  'CONRAD',     4000, 450,  32000.00  )
+, ( 201, 'JIM',      'HERMAN',     3000, 300,  19000.00  )
+, ( 202, 'LARRY',    'CLARK',      1000, 500,  25000.75  )
+, ( 203, 'KATHRYN',  'HALL',       4000, 400,  96000.00  )
+, ( 205, 'GINNY',    'FOSTER',     3300, 900,  30000.00  )
+, ( 206, 'DAVE',     'FISHER',     3200, 900,  25000.00  )
+, ( 207, 'MARK',     'FOLEY',      4000, 420,  33000.00  )
+, ( 208, 'SUE',      'CRAMER',     1000, 900,  19000.00  )
+, ( 209, 'SUSAN',    'CHAPMAN',    1500, 900,  17000.00  )
+, ( 210, 'RICHARD',  'BARTON',     1000, 500,  29000.00  )
+, ( 211, 'JIMMY',    'SCHNEIDER',  1500, 600,  26000.00  )
+, ( 212, 'JONATHAN', 'MITCHELL',   1500, 600,  32000.00  )
+, ( 213, 'ROBERT',   'WHITE',      1500, 100,  90000.00  )
+, ( 214, 'JULIA',    'KELLY',      1000, 500,  50000.00  )
+, ( 215, 'WALTER',   'LANCASTER',  4000, 450,  33000.50  )
+, ( 216, 'JOHN',     'JONES',      4000, 450,  40000.00  )
+, ( 217, 'MARLENE',  'BONNY',      4000, 900,  24000.90  )
+, ( 218, 'GEORGE',   'FRENCHMAN',  4000, 420,  36000.00  )
+, ( 219, 'DAVID',    'TERRY',      2000, 250,  27000.12  )
+, ( 220, 'JOHN',     'HUGHES',     3200, 300,  33000.10  )
+, ( 221, 'OTTO',     'SCHNABL',    3200, 300,  33000.00  )
+, ( 222, 'MARTIN',   'SCHAEFFER',  3200, 300,  31000.00  )
+, ( 223, 'HERBERT',  'KARAJAN',    3200, 300,  29000.00  )
+, ( 224, 'MARIA',    'JOSEF',      4000, 420,  18000.10  )
+, ( 225, 'KARL',     'HELMSTED',   4000, 450,  32000.00  )
+, ( 226, 'HEIDI',    'WEIGL',      3200, 300,  22000.00  )
+, ( 227, 'XAVIER',   'SEDLEMEYER', 3300, 300,  30000.00  )
+, ( 228, 'PETE',     'WELLINGTON', 3100, 300,  32000.20  )
+, ( 229, 'GEORGE',   'STRICKER',   3100, 300,  32222.00  )
+, ( 230, 'ROCKY',    'LEWIS',      2000, 200,  24000.00  )
+, ( 231, 'HERB',     'ALBERT',     3300, 300,  33000.00  )
+, ( 232, 'THOMAS',   'SPINNER',    4000, 450,  45000.00  )
+, ( 233, 'TED',      'MCDONALD',   2000, 250,  29000.00  )
+, ( 234, 'MARY',     'MILLER',     2500, 100,  56000.00  )
+, ( 235, 'MIRIAM',   'KING',       2500, 900,  18000.00  )
+, ( 321, 'BILL',     'WINN',       2000, 900,  32000.00  )
+, ( 337, 'DINAH',    'CLARK',      9000, 900,  37000.00  )
+, ( 343, 'ALAN',     'TERRY',      3000, 900,  39500.00  )
+, ( 557, 'BEN',      'HENDERSON',  4000, 400,  65000.00  )
+, ( 568, 'JESSICA',  'CRINER',     3500, 300,  39500.00  )
+, ( 990, 'THOMAS',   'STIBBS',     3500, NULL, NULL      )
+, ( 991, 'WAYNE',    'O''NEIL',    3500, NULL, NULL      )
+, ( 992, 'BARRY',    'KINNEY',     3500, NULL, NULL      )
+, ( 993, 'PAUL',     'BUSKETT',    3100, NULL, NULL      )
+, ( 994, 'EMMY',     'BUSKETT',    3100, NULL, NULL      )
+, ( 995, 'WALT',     'FARLEY',     3100, NULL, NULL      )
+;
+
+UPDATE STATISTICS FOR TABLE demo.persnl.employee ON EVERY COLUMN ;
+```
+
+[[dept-table]]
+=== DEPT Table
+
+```
+CREATE TABLE demo.persnl.dept
+( deptnum  NUMERIC (4) UNSIGNED NO DEFAULT  NOT NULL
+, deptname CHARACTER (12)       NO DEFAULT  NOT NULL
+, manager  NUMERIC (4) UNSIGNED NO DEFAULT  NOT NULL
+, rptdept  NUMERIC (4) UNSIGNED DEFAULT 0   NOT NULL
+, location VARCHAR (18)         DEFAULT ' ' NOT NULL
+, PRIMARY KEY (deptnum)
+) ;
+
+CREATE INDEX xdeptmgr ON dept
+( manager
+) ;
+
+CREATE INDEX xdeptrpt ON dept
+( rptdept
+) ;
+
+ALTER TABLE demo.persnl.dept
+   ADD CONSTRAINT mgrnum_constrnt
+   CHECK (manager BETWEEN 0000 AND 9999)
+   ;
+
+ALTER TABLE demo.persnl.dept
+
+ADD CONSTRAINT deptnum_constrnt
+   CHECK ( deptnum IN
+           ( 1000
+           , 1500
+           , 2000
+           , 2500
+           , 3000
+           , 3100
+           , 3200
+           , 3300
+           , 3500
+           , 4000
+           , 4100
+           , 9000
+           )
+        ) ;
+
+CREATE VIEW demo.persnl.mgrlist
+( first_name
+, last_name
+, department
+)
+AS SELECT
+  first_name
+, last_name
+, deptname
+FROM dept, employee
+WHERE dept.manager = employee.empnum
+;
+
+INSERT INTO demo.persnl.dept VALUES
+  ( 1000, 'FINANCE',       23, 9000, 'CHICAGO'     )
+, ( 1500, 'PERSONNEL',    213, 1000, 'CHICAGO'     )
+, ( 2000, 'INVENTORY',     32, 9000, 'LOS ANGELES' )
+, ( 2500, 'SHIPPING',     234, 2000, 'PHOENIX'     )
+, ( 3000, 'MARKETING',     29, 9000, 'NEW YORK'    )
+, ( 3100, 'CANADA SALES',  43, 3000, 'TORONTO'     ) 
+, ( 3200, 'GERMNY SALES',  39, 3000, 'FRANKFURT'   )
+, ( 3300, 'ENGLND SALES',  72, 3000, 'LONDON'      )
+, ( 3500, 'ASIA SALES',   111, 3000, 'HONG KONG'   )
+, ( 4000, 'RESEARCH',      65, 9000, 'NEW YORK'    )
+, ( 4100, 'PLANNING',      87, 4000, 'NEW YORK'    )
+, ( 9000, 'xxCORPORATE',    1, 9000, 'CHICAGO'     )
+;
+
+UPDATE STATISTICS FOR TABLE demo.persnl.dept ON EVERY COLUMN ;
+```
+
+[[project-table]]
+=== PROJECT Table
+
+```
+CREATE TABLE demo.persnl.project
+( projcode       NUMERIC (4)  UNSIGNED NO DEFAULT                                     NOT NULL
+, empnum         NUMERIC (4)  UNSIGNED NO DEFAULT                                     NOT NULL
+, projdesc       VARCHAR (18)          DEFAULT ' '                                    NOT NULL
+, start_date     DATE                  DEFAULT DATE '2011-07-01'                      NOT NULL
+, ship_timestamp TIMESTAMP             DEFAULT TIMESTAMP '2011-08-01:12:00:00.000000' NOT NULL
+, est_complete   INTERVAL DAY          DEFAULT INTERVAL '30' DAY                      NOT NULL
+, PRIMARY KEY (projcode, empnum)
+) ;
+
+INSERT INTO demo.persnl.project
+VALUES
+  ( 1000, 213, 'SALT LAKE CITY',    DATE '2011-04-10', TIMESTAMP '2011-04-21:08:15:00.00',   INTERVAL '15' DAY )
+, ( 1000, 211, 'SALT LAKE CITY',    DATE '2011-04-10', TIMESTAMP '2011-04-21:08:15:00.00',   INTERVAL '15' DAY )
+, ( 1000,  23, 'SALT LAKE CITY',    DATE '2011-04-10', TIMESTAMP '2011-04-21:08:15:00.00',   INTERVAL '15' DAY )
+, ( 1000,   1, 'SALT LAKE CITY',    DATE '2011-04-10', TIMESTAMP '2011-04-21:08:15:00.00',   INTERVAL '15' DAY )
+, ( 2000, 227, 'ROSS PRODUCTS',     DATE '2011-06-10', TIMESTAMP '2011-07-21:08:30:00.0000', INTERVAL '30' DAY )
+, ( 2000, 109, 'ROSS PRODUCTS',     DATE '2011-06-10', TIMESTAMP '2011-07-21:08:30:00.0000', INTERVAL '30' DAY )
+, ( 2000, 215, 'ROSS PRODUCTS',     DATE '2011-06-10', TIMESTAMP '2011-07-21:08:30:00.0000', INTERVAL '30' DAY )
+, ( 2000,  65, 'ROSS PRODUCTS',     DATE '2011-06-10', TIMESTAMP '2011-07-21:08:30:00.0000', INTERVAL '30' DAY )
+, ( 2500,  65, 'MONTANA TOOLS',     DATE '2011-10-10', TIMESTAMP '2011-12-21:09:00:00.0000', INTERVAL '60' DAY )
+, ( 2500, 207, 'MONTANA TOOLS',     DATE '2011-10-10', TIMESTAMP '2011-12-21:09:00:00.0000', INTERVAL '60' DAY )
+, ( 2500, 232, 'MONTANA TOOLS',     DATE '2011-10-10', TIMESTAMP '2011-12-21:09:00:00.0000', INTERVAL '60' DAY )
+, ( 2500, 180, 'MONTANA TOOLS',     DATE '2011-10-10', TIMESTAMP '2011-12-21:09:00:00.0000', INTERVAL '60' DAY )
+, ( 2500,  93, 'MONTANA TOOLS',     DATE '2011-10-10', TIMESTAMP '2011-12-21:09:00:00.0000', INTERVAL '60' DAY )
+, ( 3000,  65, 'AHAUS TOOL/SUPPLY', DATE '2011-08-21', TIMESTAMP '2011-10-21:08:10:00.0000', INTERVAL '60' DAY )
+, ( 3000, 221, 'AHAUS TOOL/SUPPLY', DATE '2011-08-21', TIMESTAMP '2011-10-21:08:10:00.0000', INTERVAL '60' DAY )
+, ( 3000, 226, 'AHAUS TOOL/SUPPLY', DATE '2011-08-21', TIMESTAMP '2011-10-21:08:10:00.0000', INTERVAL '60' DAY )
+, ( 3000, 224, 'AHAUS TOOL/SUPPLY', DATE '2011-08-21', TIMESTAMP '2011-10-21:08:10:00.0000', INTERVAL '60' DAY )
+, ( 3000, 225, 'AHAUS TOOL/SUPPLY', DATE '2011-08-21', TIMESTAMP '2011-10-21:08:10:00.0000', INTERVAL '60' DAY )
+, ( 4000,  75, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 4000,  29, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 4000, 231, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 4000, 228, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 4000, 223, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 4000, 568, 'THE WORKS',         DATE '2011-09-21', TIMESTAMP '2011-10-21:10:15:00.0000', INTERVAL '30' DAY )
+, ( 5000,  65, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+, ( 5000, 568, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+, ( 5000, 557, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+, ( 5000, 216, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+, ( 5000, 203, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+, ( 5000, 218, 'ASIA PROJECT',      DATE '2011-09-28', TIMESTAMP '2011-10-28:09:25:01.1111', INTERVAL '30' DAY )
+;
+
+UPDATE STATISTICS FOR TABLE demo.persnl.project ON EVERY COLUMN ;
+```
+
+[[sales-schema]]
+== SALES Schema
+
+The SALES schema stores customer and sales data.
+
+```
+CREATE SCHEMA DEMO.SALES ;
+SET SCHEMA DEMO.SALES ;
+```
+
+[[customer-table]]
+=== CUSTOMER Table
+
+```
+CREATE TABLE demo.sales.customer
+( custnum  NUMERIC (4) UNSIGNED NO DEFAULT   NOT NULL
+, custname CHARACTER (18)       NO DEFAULT   NOT NULL
+, street   CHARACTER (22)       NO DEFAULT   NOT NULL
+, city     CHARACTER (14)       NO DEFAULT   NOT NULL
+, state    CHARACTER (12)       DEFAULT ' '  NOT NULL
+, postcode CHARACTER (10)       NO DEFAULT   NOT NULL
+, credit   CHARACTER (2)        DEFAULT 'C1' NOT NULL
+, PRIMARY KEY (custnum)
+) ;
+
+INSERT INTO demo.sales.customer VALUES
+  (   21, 'CENTRAL UNIVERSITY', 'UNIVERSITY WAY',        'PHILADELPHIA',  'PENNSYLVANIA', '19104',    'A1' )
+, (  123, 'BROWN MEDICAL CO',   '100 CALIFORNIA STREET', 'SAN FRANCISCO', 'CALIFORNIA',   '94944',    'C2' )
+, (  143, 'STEVENS SUPPLY',     '2020 HARRIS STREET',    'DENVER',        'COLORADO',     '80734',    'A2' )
+, (  324, 'PREMIER INSURANCE',  '3300 WARBASH',          'LUBBOCK',       'TEXAS',        '76308',    'A1' )
+, (  543, 'FRESNO STATE BANK',  '2300 BROWN BLVD',       'FRESNO',        'CALIFORNIA',   '93921',    'B3' )
+, (  926, 'METALL-AG.',         '12 WAGNERRING',         'FRANKFURT',     'WEST GERMANY', '34',       'D4' )
+, ( 1234, 'DATASPEED',          '300 SAN GABRIEL WAY',   'NEW YORK',      'NEW YORK',     '10014',    'C1' )
+, ( 3210, 'BESTFOOD MARKETS',   '3333 PHELPS STREET',    'LINCOLN',       'NEBRASKA',     '68134',    'A4' )
+, ( 3333, 'NATIONAL UTILITIES', '6500 TRANS-CANADIENNE', 'QUEBEC',        'CANADA',       'H4T 1X4',  'A1' )
+, ( 5635, 'ROYAL CHEMICALS',    '45 NEW BROAD STREET',   'LONDON',        'ENGLAND',      'EC2M 1NH', 'B2' )
+, ( 7654, 'MOTOR DISTRIBUTING', '2345 FIRST STREET',     'CHICAGO',       'ILLINOIS',     '60610',    'E4' )
+, ( 7777, 'SLEEPWELL HOTELS',   '9000 PETERS AVENUE',    'DALLAS',        'TEXAS',        '75244',    'B1' )
+, ( 9000, 'BUNKNOUGHT INN',     '4738 RALPH STREET',     'BAYONNE',       'NEW JERSEY',   '09520',    'C1' )
+, ( 9010, 'HOTEL OREGON',       '333 PORTLAND AVE.',     'MEDFORD',       'OREGON',       '97444',    'C2' )
+, ( 9033, 'ART SUPPLIES, INC.', '22 SWEET ST.',          'PITTSBURGH',    'PENNA.',       '08333',    'C3' )
+;
+
+UPDATE STATISTICS FOR TABLE demo.sales.customer ON EVERY COLUMN;
+```
+
+[[orders-table]]
+=== ORDERS Table
+
+```
+CREATE TABLE demo.sales.orders
+( ordernum   NUMERIC (6) UNSIGNED NO DEFAULT                NOT NULL
+, order_date DATE                 DEFAULT DATE '2011-07-01' NOT NULL
+, deliv_date DATE                 DEFAULT DATE '2011-08-01' NOT NULL
+, salesrep   NUMERIC (4) UNSIGNED DEFAULT 0                 NOT NULL
+, custnum    NUMERIC (4) UNSIGNED NO DEFAULT                NOT NULL
+, PRIMARY KEY (ordernum)
+) ;
+
+ALTER TABLE demo.sales.orders
+   ADD CONSTRAINT demo.sales.date_constrnt CHECK (deliv_date >= order_date)
+   ;
+
+CREATE INDEX xordrep ON orders
+( salesrep
+) ;
+
+CREATE INDEX xordcus ON orders
+( custnum
+) ;
+
+CREATE VIEW demo.sales.ordrep AS SELECT
+  empnum
+, last_name
+, ordernum
+, o.custnum
+FROM
+  demo.persnl.employee e
+, demo.sales.orders o
+, demo.sales.customer c
+WHERE e.empnum = o.salesrep
+  AND o.custnum = C.custnum
+;
+
+CREATE INDEX xcustnam ON customer
+(
+custname
+) ;
+
+CREATE VIEW demo.sales.custlist AS SELECT
+  custnum
+, custname
+, street
+, city
+, state
+, postcode
+FROM demo.sales.customer
+;
+
+INSERT INTO demo.sales.orders VALUES
+  ( 100210, DATE '2011-04-10', DATE '2011-04-10', 220, 1234 )
+, ( 100250, DATE '2011-01-23', DATE '2011-06-15', 220, 7777 )
+, ( 101220, DATE '2011-07-21', DATE '2011-12-15', 221, 5635 )
+, ( 200300, DATE '2011-02-06', DATE '2011-07-01', 222,  926 )
+, ( 200320, DATE '2011-02-17', DATE '2011-07-20', 223,   21 )
+, ( 200490, DATE '2011-03-19', DATE '2011-11-01', 226,  123 )
+, ( 300350, DATE '2011-03-03', DATE '2011-08-10', 231,  543 )
+, ( 300380, DATE '2011-03-19', DATE '2011-08-20', 226,  123 )
+, ( 400410, DATE '2011-03-27', DATE '2011-09-01', 227, 7654 )
+, ( 500450, DATE '2011-04-20', DATE '2011-09-15', 220,  324 )
+, ( 600480, DATE '2011-05-12', DATE '2011-10-10', 226, 3333 )
+, ( 700510, DATE '2011-06-01', DATE '2011-10-20', 229,  143 )
+, ( 800660, DATE '2011-10-09', DATE '2011-11-01', 568, 3210 )
+;
+
+UPDATE STATISTICS FOR TABLE demo.sales.orders ON EVERY COLUMN;
+```
+
+[[odetail-table]]
+=== ODETAIL Table
+
+```
+CREATE TABLE demo.sales.odetail
+( ordernum    NUMERIC (6) UNSIGNED NO DEFAULT NOT NULL
+, partnum     NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, unit_price  NUMERIC (8, 2)       NO DEFAULT NOT NULL
+, qty_ordered NUMERIC (5) UNSIGNED NO DEFAULT NOT NULL
+, PRIMARY KEY (ordernum,partnum)
+) ;
+
+INSERT INTO demo.sales.odetail VALUES
+  ( 100210, 244,  3500.00,  3 )
+, ( 100210,2001,  1100.00,  3 )
+, ( 100210,2403,  620.00,   6 )
+, ( 100210,5100,  150.00,  10 )
+, ( 100250, 244,  3500.00,  4 )
+, ( 100250,5103,  400.00,  10 )
+, ( 100250,6301,  245.00,  15 )
+, ( 100250,6500,  95.00,   10 )
+, ( 101220, 255,  3900.00, 10 )
+, ( 101220,5103,  400.00,   3 )
+, ( 101220,7102,  275.00,   7 )
+, ( 101220,7301,  425.00,   8 )
+, ( 200300, 244,  3500.00,  8 )
+, ( 200300,2001,  1000.00, 10 )
+, ( 200300,2002,  1400.00, 10 )
+, ( 200320,5504,  165.00,   5 )
+, ( 200320,6201,  195.00,  16 )
+, ( 200320,6301,  245.00,   6 )
+, ( 200320,6400,  540.00,   7 )
+, ( 200490,3210,  715.00,   1 )
+, ( 200490,5505,  350.00,   1 )
+, ( 300350, 244,  2800.00, 20 )
+, ( 300350,5100,  150.00,   5 )
+, ( 300350,5110,  525.00,  12 )
+, ( 300350,6301,  245.00,   5 )
+, ( 300350,6400,  550.00,   5 )
+, ( 300380, 244,  3000.00,  6 )
+, ( 300380,2402,  320.00,  12 )
+, ( 300380,2405,  760.00,   8 )
+, ( 400410, 212,  2450.00, 12 )
+, ( 400410, 255,  3800.00, 12 )
+, ( 400410,2001,  1000.00, 36 )
+, ( 400410,6301,  240.00,  48 )
+, ( 400410,6400,  500.00,  70 )
+, ( 400410,7301,  415.00,  36 )
+, ( 500450, 212,  2500.00,  8 )
+, ( 500450, 255,  3900.00, 12 )
+, ( 500450,2001,  1100.00, 16 )
+, ( 500450,2002,  1500.00, 16 )
+, ( 500450,2402,  330.00,  48 )
+, ( 600480,2001,  1000.00, 60 )
+, ( 600480,2002,  1450.00, 20 )
+, ( 600480,2003,  1900.00, 40 )
+, ( 600480,3103,  4000.00, 40 )
+, ( 600480,3205,  625.00,  20 )
+, ( 600480,5100,  135.00,  60 )
+, ( 600480,5103,  390.00,  20 )
+, ( 600480,7301,  425.00,  40 )
+, ( 700410,2003,  1900.00, 65 )
+, ( 700410,2403,  650.00,  10 )
+, ( 700510, 255,  4000.00,  4 )
+, ( 700510,6500,  95.00,    8 )
+, ( 700510,7102,  275.00,   5 )
+, ( 800660, 244,  3000.00,  6 )
+, ( 800660,2001,  1000.00, 30 )
+, ( 800660,2403,  600.00,  48 )
+, ( 800660,2405,  795.00,  10 )
+, ( 800660,3201,  525.00,   6 )
+, ( 800660,3205,  600.00,  18 )
+, ( 800660,3210,  715.00,   6 )
+, ( 800660,4102,  26.00,  130 )
+, ( 800660,5100,  150.00,  12 )
+, ( 800660,5101,  200.00,   6 )
+, ( 800660,5110,  490.00,  48 )
+, ( 800660,5504,  165.00,  18 )
+, ( 800660,6201,  195.00,   6 )
+, ( 800660,6301,  235.00,  24 )
+, ( 800660,6400,  525.00,  30 )
+, ( 800660,6401,  700.00,  36 )
+, ( 800660,6500,  95.00,   22 )
+, ( 800660,7102,  275.00,   6 )
+, ( 800660,7301,  425.00,  12 )
+;
+
+UPDATE STATISTICS FOR TABLE demo.sales.odetail ON EVERY COLUMN;
+```
+
+[[parts-table]]
+=== PARTS Table
+
+```
+CREATE TABLE demo.sales.parts
+( partnum       NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, partdesc      CHARACTER (18)       NO DEFAULT NOT NULL
+, price         NUMERIC (8, 2)       NO DEFAULT NOT NULL
+, qty_available NUMERIC (5)          DEFAULT 0  NOT NULL
+, PRIMARY KEY (partnum)
+) ;
+
+CREATE INDEX xpartdes ON parts
+( partdesc
+) ;
+
+INSERT INTO demo.sales.parts VALUES
+  (  186, '186 MegaByte Disk',  186186.86, 186  )
+, (  212, 'PC SILVER, 20 MB',     2500.00, 3525 )
+, (  244, 'PC GOLD, 30 MB',       3000.00, 4426 )
+, (  255, 'PC DIAMOND, 60 MB',    4000.00, 3321 )
+, ( 2001, 'GRAPHIC PRINTER,M1',   1100.00, 2100 )
+, ( 2002, 'GRAPHIC PRINTER,M2',   1500.00, 3220 )
+, ( 2003, 'GRAPHIC PRINTER,M3',   2000.00, 2200 )
+, ( 2402, 'DAISY PRINTER,T1',      350.00, 4425 )
+, ( 2403, 'DAISY PRINTER,T2',      650.00, 3312 )
+, ( 2405, 'DAISY PRINTER, T3',     795.00, 2712 )
+, ( 3103, 'LASER PRINTER, X1',    4200.00, 3300 )
+, ( 3201, 'HARD DISK 20 MB',       525.00, 4436 )
+, ( 3205, 'HARD DISK 30 MB',       625.00, 2209 )
+, ( 3210, 'HARD DISK 40 MB',       715.00, 3314 )
+, ( 4102, 'DISKETTE HD, BOX',       28.00, 6540 )
+, ( 5100, 'MONITOR BW, TYPE 1',    150.00, 3237 )
+, ( 5101, 'MONITOR BW, TYPE 2',    200.00, 2400 )
+, ( 5103, 'MONITOR COLOR, M1',     400.00, 3328 )
+, ( 5110, 'MONITOR COLOR, M2',     525.00, 3236 )
+, ( 5504, 'MEMORY CARD, 512KB',    165.00, 2630 )
+, ( 5505, 'MEMORY CARD, 1 MB',     315.00, 3830 )
+, ( 6201, 'GRAPHIC CARD, LR',      195.00, 2306 )
+, ( 6301, 'GRAPHIC CARD, HR',      245.00, 2331 )
+, ( 6400, 'STREAMING TAPE,M20',    550.00, 1268 )
+, ( 6401, 'STREAMING TAPE,M60',    725.00, 1308 )
+, ( 6500, 'DISK CONTROLLER',        95.00, 2532 )
+, ( 6603, 'PRINTER CONTROLLER',     45.00, 430  )
+, ( 7102, 'SMART MODEM, 1200',     275.00, 2200 )
+, ( 7301, 'SMART MODEM, 2400',     425.00, 2332 )
+;
+
+UPDATE STATISTICS FOR TABLE demo.sales.parts ON EVERY COLUMN ;
+```
+
+[[invent-schema]]
+=== INVENT Schema
+
+The INVENT schema stored inventory data.
+
+```
+CREATE SCHEMA DEMO.INVENT ;
+SET SCHEMA DEMO.INVENT ;
+```
+
+[[supplier-table]]
+=== SUPPLIER Table
+
+```
+CREATE TABLE demo.invent.supplier
+( suppnum  NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, suppname CHARACTER (18)       NO DEFAULT NOT NULL
+, street   CHARACTER (22)       NO DEFAULT NOT NULL
+, city     CHARACTER (14)       NO DEFAULT NOT NULL
+, state    CHARACTER (12)       NO DEFAULT NOT NULL
+, postcode CHARACTER (10)       NO DEFAULT NOT NULL
+, PRIMARY KEY (suppnum)
+) ;
+
+CREATE INDEX xsuppnam ON supplier
+( suppname
+) ;
+
+INSERT INTO demo.invent.supplier VALUES
+  (   1, 'NEW COMPUTERS INC',    '1800 KING ST.',         'SAN FRANCISCO', 'CALIFORNIA',   '94112' )
+, (   2, 'DATA TERMINAL INC',    '2000 BAKER STREET',     'LAS VEGAS',     'NEVADA',       '66134' )
+, (   3, 'HIGH DENSITY INC',     '7600 EMERSON',          'NEW YORK',      'NEW YORK',     '10230' )
+, (   6, 'MAGNETICS INC',        '1000 INDUSTRY DRIVE',   'LEXINGTON',     'MASS',         '02159' )
+, (   8, 'ATTRACTIVE CORP',      '7777 FOUNTAIN WAY',     'CHICAGO',       'ILLINOIS',     '60610' )
+, (  10, 'LEVERAGE INC',         '6000 LINCOLN LANE',     'DENVER',        'COLORADO',     '80712' )
+, (  15, 'DATADRIVE CORP',       '100 MAC ARTHUR',        'DALLAS',        'TEXAS',        '75244' )
+, (  20, 'Macadam''S PC''s',     '106 River Road',        'New Orleans',   'Louisiana',    '67890' )
+, (  25, 'Schroeder''s Ltd',     '212 Strasse Blvd West', 'Hamburg',       'Rhode Island', '22222' )
+, (  30, 'O''Donnell''s Drives', '729 West Palm Beach ',  'San Antonio',   'Texas',        '78344' )
+, (  35, 'Mac''Murphys PC''s',   '93323 Alemeda',         'Menlo Park',    'California',   '94025' )
+, (  36, 'MAC''MURPHYS PCB''s',  '93323 Alemeda Suite B', 'Menlo Park',    'California',   '94025' )
+, (  90, 'laser jets inc',       '284 blue ridge way',    'levittown',     'penna.',       '09520' )
+, (  92, 'watercolors',          '84 north grand avenue', 'menlo park',    'california',   '94025' )
+, (  95, 'application do''ers',  '2846 yellowwood drive', 'wayland',       'mass',         '02158' )
+, (  99, 'terminals, inc.',      '2 longfellow way',      'heightstown',   'nj',           '08520' )
+, ( 186, '186 Disk Makers',      '186 Dis Way',           'Dat Way',       'Wisconsin',    '00186' )
+;
+
+UPDATE STATISTICS FOR TABLE demo.invent.supplier ON EVERY COLUMN;
+```
+
+[[partsupp-table]]
+=== PARTSUPP Table
+
+```
+CREATE TABLE demo.invent.partsupp
+( partnum      NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, suppnum      NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, partcost     NUMERIC (8, 2)       NO DEFAULT NOT NULL
+, qty_received NUMERIC (5) UNSIGNED DEFAULT 0  NOT NULL
+, PRIMARY KEY (partnum,suppnum)
+) ;
+
+CREATE INDEX XSUPORD ON partsupp
+( suppnum
+) ;
+
+CREATE VIEW demo.invent.view207
+( partnumber
+, partdescrpt
+, suppnumber
+, supplrname
+, partprice
+, qtyreceived
+)
+AS SELECT
+  x.partnum
+, partdesc
+, x.suppnum
+, suppname
+, partcost
+, qty_received
+FROM
+  demo.invent.partsupp x
+, demo.sales.parts p
+, demo.invent.supplier s
+WHERE x.partnum = p.partnum
+  AND x.suppnum = s.suppnum
+;
+
+CREATE VIEW demo.invent.view207n
+( partnumber
+, partdescrpt
+, suppnumber
+, supplrname
+, partprice
+, qtyreceived
+)
+AS SELECT
+  x.partnum
+, p.partdesc
+, s.suppnum
+, s.suppname
+, x.partcost
+, x.qty_received
+FROM demo.invent.supplier s
+LEFT JOIN demo.invent.partsupp x ON s.suppnum = x.suppnum
+LEFT JOIN demo.sales.parts p     ON x.partnum = p.partnum
+;
+
+CREATE VIEW demo.invent.viewcust
+( custnumber
+, cusname
+, ordernum
+)
+AS SELECT
+  c.custnum
+, c.custname
+, o.ordernum
+FROM demo.sales.customer c
+LEFT JOIN demo.sales.orders o ON c.custnum = o.custnum
+;
+
+CREATE VIEW demo.invent.viewcs AS SELECT
+  custname
+FROM demo.sales.customer
+UNION SELECT
+  suppname
+FROM demo.invent.supplier ;
+
+INSERT INTO demo.invent.partsupp VALUES
+  (  212,  1, 2000.00,  20 )
+, (  212,  3, 1900.00,  35 )
+, (  244,  1, 2400.00,  50 )
+, (  244,  2, 2200.00,  66 )
+, (  255,  1, 3300.00,  35 )
+, (  255,  3, 3000.00,  46 )
+, ( 2001,  1,  700.00, 100 )
+, ( 2001,  2,  750.00,  55 )
+, ( 2002,  1, 1000.00, 120 )
+, ( 2002,  6, 1100.00,  20 )
+, ( 2003,  1, 1300.00, 100 )
+, ( 2003,  2, 1400.00,  50 )
+, ( 2003, 10, 1450.00,  50 )
+, ( 2402,  1,  200.00,  35 )
+, ( 2403,  1,  300.00, 200 )
+, ( 2405,  1,  500.00,  40 )
+, ( 2405,  6,  450.00,  50 )
+, ( 3103,  1, 3200.00, 200 )
+, ( 3103, 15, 3300.00, 100 )
+, ( 3201,  1,  380.00,  36 )
+, ( 3205,  1,  425.00, 150 )
+, ( 3210,  6,  470.00,  10 )
+, ( 3210, 15,  450.00,  25 )
+, ( 4102,  6,   20.00, 115 )
+, ( 4102,  8,   19.00, 140 )
+, ( 4102, 15,   21.00,  30 )
+, ( 5100,  6,  100.00,  50 )
+, ( 5100,  8,  105.00,  40 )
+, ( 5100, 15,   95.00,  60 )
+, ( 5101,  8,  135.00,  33 )
+, ( 5101, 15,  125.00,  43 )
+, ( 5103,  8,  265.00,  20 )
+, ( 5103, 15,  250.00,  58 )
+, ( 5110,  1,  335.00, 100 )
+, ( 5110,  2,  350.00,  36 )
+, ( 5504,  2,   85.00,  10 )
+, ( 5504,  6,   75.00,  10 )
+, ( 5504, 15,   78.00,  10 )
+, ( 5505, 15,  200.00, 100 )
+, ( 6201,  1,  100.00, 110 )
+, ( 6301,  1,  150.00, 230 )
+, ( 6400,  1,  390.00,  50 )
+, ( 6401,  2,  500.00,  20 )
+, ( 6401,  3,  480.00,  38 )
+, ( 6500,  2,   60.00, 140 )
+, ( 6500,  3,   65.00,  32 )
+, ( 6603,  2,   25.00, 150 )
+, ( 7102, 10,  165.00, 100 )
+, ( 7301,  1,  300.00,  32 )
+;
+
+UPDATE STATISTICS FOR TABLE demo.invent.partsupp ON EVERY COLUMN;
+```
+
+[[partloc-table]]
+=== PARTLOC Table
+
+```
+CREATE TABLE demo.invent.partloc
+( loc_code    CHARACTER (3)        NO DEFAULT NOT NULL
+, partnum     NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL
+, qty_on_hand NUMERIC (7)          DEFAULT 0  NOT NULL
+, PRIMARY KEY (loc_code,partnum)
+) ;
+
+INSERT INTO demo.invent.partloc VALUES
+  ('A10', 2001,  800 )
+, ('A21',  255,   21 )
+, ('A34', 6201,    0 )
+, ('A35', 6301,    0 )
+, ('A36', 6400,   34 )
+, ('A66', 6603,  300 )
+, ('A67', 6401,  454 )
+, ('A78',  244,   43 )
+, ('A78', 5505,  100 )
+, ('A87',  212,   18 )
+, ('A88', 2403,  735 )
+, ('A88', 5504,   30 )
+, ('A94', 3205,  200 )
+, ('A98', 5110,  510 )
+, ('G11', 2002,   20 )
+, ('G34', 6201,  106 )
+, ('G35', 6301,  331 )
+, ('G36', 6400, 1034 )
+, ('G43', 5100,   77 )
+, ('G45', 4102,   69 )
+, ('G65', 3201,   36 )
+, ('G68', 6500, 1132 )
+, ('G76', 2405,   42 )
+, ('G76', 7301,   32 )
+, ('G78', 5505,    0 )
+, ('G87',  212,   20 )
+, ('G87', 3103,    0 )
+, ('G87', 3210,   44 )
+, ('G87', 2402,    0 )
+, ('G88', 2403,   32 )
+, ('G88', 5504,    0 )
+, ('G89', 5101,   86 )
+, ('G94', 3205,   59 )
+, ('G98', 5103,   28 )
+, ('G98', 5110,  136 )
+, ('P10', 2001,    0 )
+, ('P12', 2002,  200 )
+, ('P12', 2003,    0 )
+, ('P15', 2003,  200 )
+, ('P66', 6603,   40 )
+, ('P67', 6401,   54 )
+, ('P68', 6500,    0 )
+, ('P76', 7102,  200 )
+, ('P78',  244,   23 )
+, ('P87', 3103,  300 )
+;
+
+UPDATE STATISTICS FOR TABLE demo.invent.partloc ON EVERY COLUMN ;
+```



[48/50] [abbrv] incubator-trafodion git commit: Merge branch 'apache-master'

Posted by db...@apache.org.
Merge branch 'apache-master'


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

Branch: refs/heads/master
Commit: 56650c018ae8e641b859fed0ea9ea62dad3e2275
Parents: c86d238 ead1b40
Author: mashengchen <ma...@gmail.com>
Authored: Mon Mar 28 09:03:43 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Mon Mar 28 09:03:43 2016 +0000

----------------------------------------------------------------------

----------------------------------------------------------------------



[02/50] [abbrv] incubator-trafodion git commit: Update reinstate_orig

Posted by db...@apache.org.
Update reinstate_orig

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

Branch: refs/heads/master
Commit: 78abccb045df63cc502cd2eab5bc13b1718d94e5
Parents: 2155c3d
Author: mashengchen <ma...@gmail.com>
Authored: Tue Mar 1 09:41:52 2016 +0800
Committer: mashengchen <ma...@gmail.com>
Committed: Tue Mar 1 09:41:52 2016 +0800

----------------------------------------------------------------------
 core/sqf/src/seatrans/hbase-trx/reinstate_orig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/78abccb0/core/sqf/src/seatrans/hbase-trx/reinstate_orig
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/reinstate_orig b/core/sqf/src/seatrans/hbase-trx/reinstate_orig
index 4262a44..b97a957 100755
--- a/core/sqf/src/seatrans/hbase-trx/reinstate_orig
+++ b/core/sqf/src/seatrans/hbase-trx/reinstate_orig
@@ -19,7 +19,8 @@
 # under the License.
 #
 # @@@ END COPYRIGHT @@@
-##!/bin/sh
+#
+#!/bin/sh
 
 lv_fnames=`find -name "*.java.tmpl" | sed -e "s/\.tmpl$//" `
 


[33/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index f16d48b..217f96a 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -23,7 +23,7 @@
 /* -*-C++-*-
  *****************************************************************************
  *
- * File:         ex_lob.C
+ * File:         EXLOBaccess.cpp
  * Description:  class to store and retrieve LOB data.
  *               
  *               
@@ -47,25 +47,25 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
-#define SQ_USE_HDFS 1
 
-#ifdef SQ_USE_HDFS
+
+
 #include "hdfs.h"
 #include "jni.h"
-#endif 
+
 
 #include "ExpLOBstats.h"
 #include "ExpLOBaccess.h"
 #include "ExpLOBinterface.h"
-
+#include "ExpLOBexternal.h"
 #include "NAVersionedObject.h"
 #include "ComQueue.h"
 
 #include "NAMemory.h"
 #include <seabed/ms.h>
-#include <../../sqf/src/seabed/src/trans.h>
 #include <seabed/fserr.h>
 #include <curl/curl.h>
+#include <../../sqf/src/seabed/src/trans.h>
 extern int ms_transid_get(bool pv_supp,
                           bool pv_trace,
                           MS_Mon_Transid_Type *pp_transid,
@@ -79,15 +79,12 @@ ExLob::ExLob() :
     storage_(Lob_Invalid_Storage),
     dir_(string()),
     lobGlobalHeap_(NULL),
-
-    // fdDesc_(-1),
-    fdDesc_(NULL),
     fs_(NULL),
     fdData_(NULL),
     openFlags_(0)  
 {
     lobDataFile_[0] = '\0';
-    lobDescFile_[0] = '\0'; 
+    
 }
 
 ExLob::~ExLob()
@@ -97,10 +94,8 @@ ExLob::~ExLob()
       hdfsCloseFile(fs_, fdData_);
       fdData_ = NULL;
     }
-    if (fdDesc_) {
-      hdfsCloseFile(fs_, fdDesc_);
-      fdDesc_ = NULL;
-    }
+    
+    
     
     /*   
     Commenting this out. It is causing cores during hive access.
@@ -118,6 +113,7 @@ Ex_Lob_Error ExLob::initialize(char *lobFile, Ex_Lob_Mode mode,
                                char *dir, 
 			       LobsStorage storage,
                                char *hdfsServer, Int64 hdfsPort,
+                               char *lobLocation,
                                int bufferSize , short replication ,
                                int blockSize, Int64 lobMaxSize, ExLobGlobals *lobGlobals)
 {
@@ -126,7 +122,7 @@ Ex_Lob_Error ExLob::initialize(char *lobFile, Ex_Lob_Mode mode,
   struct timespec startTime;
   struct timespec endTime;
   Int64 secs, nsecs, totalnsecs;
-
+ 
   if (dir) 
     {
       if (dir_.empty()) 
@@ -136,12 +132,12 @@ Ex_Lob_Error ExLob::initialize(char *lobFile, Ex_Lob_Mode mode,
 
    
       snprintf(lobDataFile_, MAX_LOB_FILE_NAME_LEN, "%s/%s", dir_.c_str(), lobFile);
-      snprintf(lobDescFile_, MAX_LOB_FILE_NAME_LEN, "%s/%s.desc", dir_.c_str(), lobFile);
+      
     } 
   else 
     { 
       snprintf(lobDataFile_, MAX_LOB_FILE_NAME_LEN, "%s", lobFile);
-      snprintf(lobDescFile_, MAX_LOB_FILE_NAME_LEN, "%s.desc", lobFile);
+      
     }
 
   if (storage_ != Lob_Invalid_Storage) 
@@ -156,7 +152,7 @@ Ex_Lob_Error ExLob::initialize(char *lobFile, Ex_Lob_Mode mode,
 
   hdfsServer_ = hdfsServer;
   hdfsPort_ = hdfsPort;
-
+  lobLocation_ = lobLocation;
   clock_gettime(CLOCK_MONOTONIC, &startTime);
 
   if (lobGlobals->getHdfsFs() == NULL)
@@ -200,107 +196,94 @@ Ex_Lob_Error ExLob::initialize(char *lobFile, Ex_Lob_Mode mode,
 	}
       hdfsCloseFile(fs_, fdData_);
       fdData_ = NULL;
-      if (!lobGlobals->isHive())
-	{
-	  //Create the desc header file that holds info about the 
-	  //lob data file offsets etc.   
-	  fdDesc_ = hdfsOpenFile(fs_, lobDescFile_, O_WRONLY, bufferSize, replication, blockSize);
-	  if (!fdDesc_) 
-	    {
-	      return LOB_DESC_FILE_CREATE_ERROR;
-	    }
-	  //write empty header info into it. 
-	  ExLobDescHeader header(lobMaxSize);
-      
-	  Int64 numWritten = 0;
-	  numWritten = hdfsWrite(fs_, fdDesc_, (void *)&header, sizeof(ExLobDescHeader));
-	  if (numWritten <=0)
-	    return LOB_DATA_WRITE_ERROR;
-      
-      
-	  if (hdfsFlush(fs_, fdDesc_)) 
-	    return LOB_DATA_FLUSH_ERROR;
-	    
-	  hdfsCloseFile(fs_, fdDesc_);
-	  fdDesc_ = NULL;   
-	}
+     
     }
   lobGlobalHeap_ = lobGlobals->getHeap();    
   return LOB_OPER_OK;
     
 }
 
-Ex_Lob_Error ExLob::fetchCursor() 
+Ex_Lob_Error ExLob::fetchCursor(char *handleIn, Int32 handleLenIn, Int64 &outOffset, Int64 &outSize,NABoolean &isEOD, Int64 transId) 
 {
-    Ex_Lob_Error err; 
-
-    request_.setType(Lob_Req_Fetch_Cursor);
+  Ex_Lob_Error err = LOB_OPER_OK;
+  Int64 dummyParam;
+  int cliErr=0;
+  Int64 offset = 0;
+  Int64 size = 0;
+  lobCursors_it it = lobCursors_.find(string(handleIn, handleLenIn));
 
-    err = request_.send();
+   if (it == lobCursors_.end())
+   {
+      return LOB_CURSOR_NOT_OPEN;                         
+   }
 
-    if (err != LOB_OPER_OK) {
+   void *cliInterface = it->second.cliInterface_;
+   
+   
+    cliErr = SQL_EXEC_LOBcliInterface(handleIn, handleLenIn, 
+				     0, 0,
+                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
+                                     LOB_CLI_SELECT_FETCH, LOB_CLI_ExecImmed,
+                                     &offset, &size,
+                                     &dummyParam, &dummyParam, 
+				     &cliInterface,
+				     transId);
+    if (err != LOB_OPER_OK) 
+      {
        return err;
-    }
+      }
+    if (cliErr == 100 )
+      {
+        isEOD= TRUE;
+        cliErr = SQL_EXEC_LOBcliInterface(handleIn, handleLenIn, 
+				     NULL, NULL,
+                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
+                                     LOB_CLI_SELECT_CLOSE, LOB_CLI_ExecImmed,
+                                     &dummyParam, &dummyParam,
+                                     &dummyParam, &dummyParam, 
+				     &cliInterface,
+				     transId);
+        
+      }
+    else
+      {
+        outOffset = offset;
+        outSize = size;
+      }
 
-    err = request_.getError();
+  
 
     return err;
 }
 
-Ex_Lob_Error ExLob::delDesc(Int64 descNum) 
-{
-    Ex_Lob_Error err; 
-
-    request_.setType(Lob_Req_Del_Desc);
-    request_.setDescNumIn(descNum);
 
-    err = request_.send();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
-
-    err = request_.getError();
-
-    return err;
-}
 
-Ex_Lob_Error ExLob::getDesc(ExLobDesc &desc) 
+Ex_Lob_Error ExLob::getDesc(ExLobDesc &desc,char * handleIn, Int32 handleInLen, char *blackBox, Int32 *blackBoxLen, char *handleOut, Int32 &handleOutLen, Int64 transId) 
 {
-    Ex_Lob_Error err; 
-
-    request_.setType(Lob_Req_Get_Desc);
-
-    err = request_.send();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
-
-    request_.getDescOut(desc);
-    err = request_.getError();
+    Ex_Lob_Error err = LOB_OPER_OK; 
+    NABoolean multipleChunks = FALSE;
+    Int32 clierr = 0;
+    Int64 size,offset,dummyParam = 0;
+   
 
+     clierr = SQL_EXEC_LOBcliInterface(handleIn, 
+                                       handleInLen, 
+                                       blackBox, blackBoxLen,
+                                       handleOut, &handleOutLen,
+                                       LOB_CLI_SELECT_UNIQUE, LOB_CLI_ExecImmed,
+                                       &offset, &size,
+                                       &dummyParam, &dummyParam, 
+                                       0,
+                                       transId);
+     
+     if (clierr < 0) 
+       return LOB_DESC_READ_ERROR;
+    desc.setOffset(offset);
+    desc.setSize(size);
+  
     return err;
 }
 
-Ex_Lob_Error ExLob::putDesc(ExLobDesc &desc, Int64 descNum)
-{
-    Ex_Lob_Error err; 
-
-    request_.setType(Lob_Req_Put_Desc);
-    request_.setDescNumIn(descNum);
-    request_.putDescIn(desc);
-
-    err = request_.send();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
-
-    err = request_.getError();
-
-    return err;
-}
 
 Ex_Lob_Error ExLob::writeData(Int64 offset, char *data, Int32 size, Int64 &operLen)
 { 
@@ -642,10 +625,14 @@ Ex_Lob_Error ExLob::readExternalSourceFile(char *srcfile, char *&fileData, Int32
   return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::writeDesc(Int64 &sourceLen, char *source, LobsSubOper subOper, Int64 &descNumOut, Int64 &operLen, Int64 lobMaxSize)
+Ex_Lob_Error ExLob::writeDesc(Int64 &sourceLen, char *source, LobsSubOper subOper, Int64 &descNumOut, Int64 &operLen, Int64 lobMaxSize,Int64 lobMaxChunkMemSize,Int64 lobGCLimit, char * handleIn, Int32 handleInLen, char *blackBox, Int32 *blackBoxLen, char *handleOut, Int32 &handleOutLen, void *lobGlobals)
 {
-    Ex_Lob_Error err; 
+  Ex_Lob_Error err=LOB_OPER_OK; 
     Int64 dataOffset = 0;
+    Int64 outDescPartnKey = 0;
+    Int64 outDescSyskey = 0;
+    Int32 clierr = 0;
+
     // Calculate sourceLen for each subOper.
     if (subOper == Lob_File)
       {
@@ -656,25 +643,59 @@ Ex_Lob_Error ExLob::writeDesc(Int64 &sourceLen, char *source, LobsSubOper subOpe
     if (sourceLen <= 0 || sourceLen > lobMaxSize)
       {
 	return LOB_MAX_LIMIT_ERROR; //exceeded the size of the max lob size
+        //TBD trigger compaction
       }
-    err = allocateDesc((unsigned int)sourceLen, descNumOut, dataOffset, lobMaxSize);
+    err = allocateDesc((unsigned int)sourceLen, descNumOut, dataOffset, lobMaxSize, lobMaxChunkMemSize,handleIn, handleInLen, lobGCLimit,lobGlobals);
 
     operLen = 0; 
     if (err != LOB_OPER_OK)
       return err;
-
-    //send a message to mxlobsrvr to insert into the descriptor tables
-    request_.setType(Lob_Req_Allocate_Desc);
-    request_.getDesc().setSize(sourceLen);
-    request_.setDescNumOut(descNumOut);
-    request_.setDataOffset(dataOffset);
-    err = request_.send();
-    if (err != LOB_OPER_OK) {
-      return err;
+    
+   clierr = SQL_EXEC_LOBcliInterface(handleIn, 
+                                     handleInLen, 
+				     NULL, blackBoxLen,
+                                     handleOut, &handleOutLen,
+                                     LOB_CLI_INSERT, LOB_CLI_ExecImmed,
+                                     &dataOffset, &sourceLen,
+                                     &outDescPartnKey, &outDescSyskey, 
+				     0,
+				     0);
+    if (clierr < 0 ) {
+      return LOB_DESC_WRITE_ERROR;
     }
     return err;
 }
 
+
+Ex_Lob_Error ExLob::insertDesc(Int64 offset, Int64 size,  char *handleIn, Int32 handleInLen,  char *handleOut, Int32 &handleOutLen, char *blackBox, Int32 blackBoxLen,void *lobGlobals) 
+{
+  
+   Lng32 clierr;
+   Int64 dummyParam;
+   Int64 outDescSyskey = 0;
+   Int64 outDescPartnKey = 0;
+   handleOutLen = 0;
+   Int32 chunkNum = 1;
+ 
+   NABoolean foundUnused = FALSE;
+   
+   clierr = SQL_EXEC_LOBcliInterface(handleIn, 
+                                     handleInLen, 
+				     NULL, &chunkNum,
+                                     handleOut, &handleOutLen,
+                                     LOB_CLI_INSERT, LOB_CLI_ExecImmed,
+                                     &offset, &size,
+                                     &outDescPartnKey, &outDescSyskey, 
+				     0,
+				     0);
+ 
+   if (clierr < 0 ) {
+      return LOB_DESC_WRITE_ERROR;
+    }
+   return LOB_OPER_OK;
+}
+
+
 Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subOperation, Int64 tgtOffset,Int64 &operLen, Int64 lobMaxChunkMemSize)
 {
     Ex_Lob_Error err; 
@@ -692,8 +713,7 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
 	    err = readSourceFile(source, inputAddr, allocMemSize, readOffset);
 	    if (err != LOB_OPER_OK)
 	      return err;     
-	  } 
-   
+	  }    
 	else 
 	  { // in memory
 	   
@@ -723,10 +743,10 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
     return err;
 }
 
-Ex_Lob_Error ExLob::readToMem(char *memAddr, Int64 size,  Int64 &operLen)
+Ex_Lob_Error ExLob::readToMem(char *memAddr, Int64 size,  Int64 &operLen,char * handleIn, Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, Int64 transId)
 {
    Ex_Lob_Error err = LOB_OPER_OK; 
-
+   NABoolean multipleChunks = FALSE;
   
    int cliErr;
 
@@ -735,12 +755,19 @@ Ex_Lob_Error ExLob::readToMem(char *memAddr, Int64 size,  Int64 &operLen)
    Int64 sizeToRead = 0;
    
    
-   err = getDesc(desc);
+   err = getDesc(desc,handleIn,handleInLen,blackBox, &blackBoxLen,handleOut,handleOutLen,transId);
+   if (err != LOB_OPER_OK)
+     {	   
+       return err;
+     }
    sizeToRead = MINOF(size,desc.getSize());
    
-   if (getRequest()->getBlackBoxLen() == -1)
-     sizeToRead = size;
-   err = readDataToMem(memAddr, desc.getOffset(),sizeToRead, operLen);
+   if (blackBoxLen == -1)
+     {
+       sizeToRead = size;
+       multipleChunks = TRUE;
+     }
+   err = readDataToMem(memAddr, desc.getOffset(),sizeToRead, operLen, handleIn,handleInLen, multipleChunks,transId);
 
    return err;
 }
@@ -772,18 +799,20 @@ LobInputOutputFileType ExLob::fileType(char *ioFileName)
     else
       return LOCAL_FILE;
 }
-Ex_Lob_Error ExLob::readToFile(char *tgtFileName, Int64 tgtLength, Int64 &operLen, Int64 lobMaxChunkMemLen, Int32 fileflags)
+Ex_Lob_Error ExLob::readToFile(char *tgtFileName, Int64 tgtLength, Int64 &operLen, Int64 lobMaxChunkMemLen, Int32 fileflags,char *handleIn,Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, Int64 transId)
 {
   Ex_Lob_Error err = LOB_OPER_OK; 
   Int64 srcOffset = 0;
   Int64 srcLength = 0;
   LobInputOutputFileType tgtType = fileType(tgtFileName);
   ExLobDesc desc;
-  err = getDesc(desc);
+  NABoolean multipleChunks = FALSE;
+  err = getDesc(desc,handleIn,handleInLen,blackBox, &blackBoxLen,handleOut,handleOutLen,transId);
   if (err != LOB_OPER_OK)
     return err;
-  if (getRequest()->getBlackBoxLen() == -1)  // mxlobsrvr returned -1 indicating multiple chunks for this particular lob handle
+  if (blackBoxLen == -1)  // mxlobsrvr returned -1 indicating multiple chunks for this particular lob handle
     {
+      multipleChunks = TRUE;
       //the data retrieval in chunks is handled in readDataToMem.
     }
   else if (tgtLength <=0 )
@@ -797,19 +826,19 @@ Ex_Lob_Error ExLob::readToFile(char *tgtFileName, Int64 tgtLength, Int64 &operLe
     }
   if (tgtType == HDFS_FILE)
     {
-      err = readDataToHdfsFile(tgtFileName,  srcOffset , tgtLength,operLen, lobMaxChunkMemLen, fileflags);
+      err = readDataToHdfsFile(tgtFileName,  srcOffset , tgtLength,operLen, lobMaxChunkMemLen, fileflags,handleIn,handleInLen,multipleChunks,transId);
       if (err != LOB_OPER_OK)
 	return err;
     }
   else if(tgtType == CURL_FILE)
     {
-      err = readDataToExternalFile(tgtFileName, srcOffset, tgtLength, operLen, lobMaxChunkMemLen, fileflags);
+      err = readDataToExternalFile(tgtFileName, srcOffset, tgtLength, operLen, lobMaxChunkMemLen, fileflags,handleIn, handleInLen,multipleChunks,transId);
       if (err != LOB_OPER_OK)
 	return err;
     }
   else if (tgtType == LOCAL_FILE)
     { 
-      err = readDataToLocalFile(tgtFileName,srcOffset, tgtLength,operLen, lobMaxChunkMemLen, fileflags);
+      err = readDataToLocalFile(tgtFileName,srcOffset, tgtLength,operLen, lobMaxChunkMemLen, fileflags,handleIn,handleInLen,multipleChunks,transId);
       if (err != LOB_OPER_OK)
 	return err;
     }
@@ -819,12 +848,15 @@ Ex_Lob_Error ExLob::readToFile(char *tgtFileName, Int64 tgtLength, Int64 &operLe
   return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize,Int64 lobMaxChunkMemSize)
+Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize,Int64 lobMaxChunkMemSize, Int64 lobGCLimit, char *handleIn, Int32 handleInLen,  char * handleOut, Int32 &handleOutLen,void *lobGlobals)
 {
     Ex_Lob_Error err = LOB_OPER_OK;
     Int64 dummyParam;
     Int64 dataOffset=0;
     Int64 sourceLen = size;
+    Int32 clierr = 0;
+    Int32 chunkNum = 0;
+    Int64 outDescPartnKey, outDescSyskey = 0;
     if (so == Lob_File)
       {
 	err = statSourceFile(data, sourceLen); 
@@ -835,22 +867,21 @@ Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDes
       {
 	return LOB_MAX_LIMIT_ERROR; //exceeded the size of the max lob size
       }
-    err = allocateDesc((unsigned int)sourceLen, dummyParam, dataOffset, lobMaxSize);
+    err = allocateDesc((unsigned int)sourceLen, dummyParam, dataOffset, lobMaxSize,lobMaxChunkMemSize,handleIn, handleInLen,lobGCLimit,lobGlobals);
     if (err != LOB_OPER_OK)
       return err;
-    request_.setType(Lob_Req_Append);
-    request_.getDesc().setSize(sourceLen);
-    request_.setDataOffset(dataOffset);
-    request_.send();
-
-    err = request_.getError();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
-
-    int cliErr = request_.getCliError();
-    if (cliErr < 0 || cliErr == 100) { // some error or EOD.
+   
+    clierr = SQL_EXEC_LOBcliInterface(handleIn, handleInLen, 
+				      0, &chunkNum,
+                                      handleOut, &handleOutLen,
+                                      LOB_CLI_INSERT_APPEND, LOB_CLI_ExecImmed,
+                                      &dataOffset, &sourceLen,
+                                      &outDescPartnKey, &outDescSyskey, 
+				      0,
+				      0);
+    
+    
+    if (clierr < 0 || clierr == 100) { // some error or EOD.
        return LOB_DESC_APPEND_ERROR;
     }
 
@@ -864,20 +895,20 @@ Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDes
       return err;
     return LOB_OPER_OK;
 }
-Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize)
+Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize,char * handleIn, Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, void *lobGlobals)
 {
-   Ex_Lob_Error err; 
+   Ex_Lob_Error err=LOB_OPER_OK; 
    ExLobDesc desc;
-
+   int clierr = 0;
    operLen = 0;
 
    // get offset and input size from desc (the one that was just                           inserted into the descriptor handle table)
-   err = getDesc(desc);
-   if (err != LOB_OPER_OK)
-     return err;
+  
+   err = getDesc(desc,handleIn,handleInLen,blackBox, &blackBoxLen,handleOut,handleOutLen,0);
+   
 
-    int cliErr = request_.getCliError();
-    if (cliErr < 0 || cliErr == 100) { // some error or EOD.
+   
+    if (err !=LOB_OPER_OK) { // some error or EOD.
        return LOB_DESC_READ_ERROR;
     }
     
@@ -898,12 +929,15 @@ Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 head
       return err;
     return LOB_OPER_OK;
 }
-Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize)
+Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize, Int64 lobGCLimit, char *handleIn, Int32 handleInLen,  char *handleOut, Int32 &handleOutLen, void *lobGlobals)
 {
     Ex_Lob_Error err = LOB_OPER_OK;
     Int64 dummyParam;
     Int64 dataOffset = 0;
     Int64 sourceLen = size;
+    Int32 clierr = 0;
+    Int64 outDescPartnKey,outDescSyskey = 0;
+    Int32 chunkNum = 0;
     if (so == Lob_File)
       {
 	err = statSourceFile(data, sourceLen); 
@@ -914,24 +948,21 @@ Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDesc
       {
 	return LOB_MAX_LIMIT_ERROR; //exceeded the size of the max lob size
       }
-    err = allocateDesc((unsigned int)sourceLen, dummyParam, dataOffset, lobMaxSize);
+    err = allocateDesc((unsigned int)sourceLen, dummyParam, dataOffset, lobMaxSize, lobMaxChunkMemSize, handleIn, handleInLen, lobGCLimit,lobGlobals);
     if (err != LOB_OPER_OK)
       return err;
-    // send a message to mxlobsrvr to do an update into descriptor tables
-    request_.setType(Lob_Req_Update);
-    request_.getDesc().setSize(sourceLen);
-    request_.setDataOffset(dataOffset);
-
-    request_.send();
-
-    err = request_.getError();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
-
-    int cliErr = request_.getCliError();
-    if (cliErr < 0 || cliErr == 100) { // some error or EOD.
+  
+    clierr = SQL_EXEC_LOBcliInterface(handleIn, 
+                                      handleInLen, 
+				      0, &chunkNum,
+                                      handleOut, &handleOutLen,
+                                      LOB_CLI_UPDATE_UNIQUE, LOB_CLI_ExecImmed,
+                                      &dataOffset, &sourceLen,
+                                      &outDescPartnKey, &outDescSyskey, 
+				      0,
+				      0);
+    
+    if (clierr < 0 || clierr == 100) { // some error or EOD.
        return LOB_DESC_UPDATE_ERROR;
     }
     char *inputAddr = data;
@@ -946,18 +977,27 @@ Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDesc
     return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::delDesc()
+Ex_Lob_Error ExLob::delDesc(char *handleIn, Int32 handleInLen, Int64 transId)
 {
-    Ex_Lob_Error err;
-    Int64 dummyParam;
-
-    request_.setType(Lob_Req_Del_Desc);
+    Ex_Lob_Error err;   
+    Int64 offset=0;
+    Int64 dummyParam=0;  
+    Lng32 clierr=0;
 
-    request_.send();
-
-    err = request_.getError();
+    clierr = SQL_EXEC_LOBcliInterface(handleIn, handleInLen, 
+				      0, 0,
+                                      (char *)&dummyParam, (Lng32 *)&dummyParam,
+                                      LOB_CLI_DELETE, LOB_CLI_ExecImmed,
+                                      &dummyParam, &dummyParam,
+                                      &dummyParam, &dummyParam, 
+				      0,
+				      transId);
 
-    return err;
+    if (clierr < 0)
+      return LOB_DESC_FILE_DELETE_ERROR;
+    
+    return LOB_OPER_OK;
+ 
 }
 
 Ex_Lob_Error ExLob::purgeLob()
@@ -967,38 +1007,37 @@ Ex_Lob_Error ExLob::purgeLob()
        {
 	 return LOB_DATA_FILE_DELETE_ERROR;
        }
-     if (hdfsDelete(fs_, lobDescFile_, 0) != 0) 
-       {
-	 return LOB_DESC_FILE_DELETE_ERROR;
-       }
-
-
+    
     return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::openCursor(char *handleIn, Int64 handleInLen)
+Ex_Lob_Error ExLob::openCursor(char *handleIn, Int32 handleInLen,Int64 transId)
 {
     Ex_Lob_Error err;
     cursor_t cursor;
+    Int32 clierr;
+    Int64 dummyParam = 0;
+    void *cliInterface = NULL;
+   
+    clierr = SQL_EXEC_LOBcliInterface(handleIn, 
+                                      handleInLen,
+				      0, 0,
+                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
+                                     LOB_CLI_SELECT_CURSOR, LOB_CLI_ExecImmed,
+                                     &dummyParam, &dummyParam,
+                                     &dummyParam, &dummyParam, 
+				     &cliInterface,
+				     transId);
 
-    request_.setType(Lob_Req_Select_Cursor);
-
-    err = request_.send();
-
-    if (err != LOB_OPER_OK) {
-       return err;
+    if (clierr <0 ) {
+      return LOB_DESC_READ_ERROR;
     }
 
-    err = request_.getError();
-
-    if (err != LOB_OPER_OK) {
-       return err;
-    }
 
     cursor.bytesRead_ = -1;
     cursor.descOffset_ = -1;
     cursor.descSize_ = -1;
-    cursor.cliInterface_ = NULL; // used only in lob process
+    cursor.cliInterface_ = cliInterface; // used only in lob process
     cursor.eod_ = false;
     cursor.eor_ = false; 
     cursor.eol_ = false;
@@ -1101,7 +1140,7 @@ Ex_Lob_Error ExLob::openDataCursor(char *file, LobsCursorType type, Int64 range,
     return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int64 handleInLen, Int64 &operLen)
+Ex_Lob_Error ExLob::readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int32 handleInLen, Int64 &operLen,Int64 transId)
 {
     int dataOffset;
     Ex_Lob_Error result;
@@ -1127,7 +1166,7 @@ Ex_Lob_Error ExLob::readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int64 h
        return LOB_OPER_OK;
     }
 
-    result = readCursorData(tgt, tgtSize, cursor, operLen); // increments cursor
+    result = readCursorData(tgt, tgtSize, cursor, operLen, handleIn,handleInLen,transId); // increments cursor
         
     if (result != LOB_OPER_OK)
       return result;
@@ -1137,221 +1176,38 @@ Ex_Lob_Error ExLob::readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int64 h
     return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::readDataCursorSimple(char *file, char *tgt, Int64 tgtSize, 
-                                         Int64 &operLen, ExLobGlobals *lobGlobals)
-{
-    int dataOffset;
-    Ex_Lob_Error result = LOB_OPER_OK;
-    cursor_t *cursor;
-    ExLobCursor::bufferList_t::iterator c_it;
-    ExLobCursorBuffer *buf = NULL;
-    Int64 bytesToCopy = 0;
-    operLen = 0;
-    Int64 len;
-    char *target = tgt;
-    bool done = false;
-
-    struct timespec startTime;
-    struct timespec endTime;
 
-    lobCursorLock_.lock();
 
-    lobCursors_it it = lobCursors_.find(string(file, strlen(file)));
 
-    if (it == lobCursors_.end())
+Ex_Lob_Error ExLob::closeCursor(char *handleIn, Int32 handleInLen)
+{
+    lobCursors_it it = lobCursors_.find(string(handleIn, handleInLen));
+    if (it != lobCursors_.end())
     {
-       lobCursorLock_.unlock();
-       return LOB_CURSOR_NOT_OPEN;
+      lobCursors_.erase(it);
     }
-    else
-    {
-       cursor = &(it->second); 
-    } 
+    return LOB_OPER_OK;
+}
 
-    lobCursorLock_.unlock();
 
-    while ((operLen < tgtSize) && !done && !cursor->eol_)
-    {
-      lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
-      cursor->lock_.lock();
+Ex_Lob_Error ExLob::doSanityChecks(char *dir, LobsStorage storage,
+                                   Int32 handleInLen, Int32 handleOutLen, 
+                                   Int32 blackBoxLen)
+{
 
-      // if no buffers to read and is eor or eod, we are done.
-      // else wait for prefetch thread to wake us up. 
-      if (cursor->prefetchBufList_.size() == 0) {
-        if (cursor->eor_ || cursor->eod_) {
-          done = true;
-        } else {
-          cursor->bufferMisses_++;
-	  lobGlobals->traceMessage("wait on condition cursor",cursor,__LINE__);
-          cursor->lock_.wait();
-        }
-	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-        cursor->lock_.unlock();
-        continue;
-      } 
+#ifdef SQ_USE_HDFS
+    if (!fs_)
+      return LOB_HDFS_CONNECT_ERROR;
+#else
+    if (fdData_ == -1)
+      return LOB_DATA_FILE_OPEN_ERROR;
+#endif
 
-      // a buffer is available
-      c_it = cursor->prefetchBufList_.begin();
-      buf = *c_it;
-      lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-      cursor->lock_.unlock();
+    if (dir_.compare(dir) != 0)
+      return LOB_DIR_NAME_ERROR;
 
-      bytesToCopy = min(buf->bytesRemaining_, tgtSize - operLen);
-      memcpy(target, buf->data_ + buf->bytesUsed_, bytesToCopy);
-      target += bytesToCopy;
-      if (bytesToCopy == buf->bytesRemaining_) { // buffer is now empty
-        buf->bytesRemaining_ = -1;
-        buf->bytesUsed_ = -1;
-        lobGlobals->postfetchBufListLock_.lock();
-        lobGlobals->postfetchBufList_.push_back(buf);
-        lobGlobals->postfetchBufListLock_.unlock();
-	lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
-        cursor->lock_.lock();
-        c_it = cursor->prefetchBufList_.erase(c_it);
-	lobGlobals->traceMessage("signal condition cursor",cursor,__LINE__);
-        cursor->lock_.wakeOne(); // wake up prefetch thread if it was waiting for an empty buffer.
-	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-        cursor->lock_.unlock();
-      } else {
-        buf->bytesUsed_ += bytesToCopy;
-        buf->bytesRemaining_ -= bytesToCopy;
-      }
-      stats_.bytesPrefetched += bytesToCopy;
-      operLen += bytesToCopy;
-    } 
-
-    // update stats
-    stats_.bytesRead += operLen;
-    stats_.bytesToRead += tgtSize;
-    stats_.numReadReqs++;
-
-    return LOB_OPER_OK;
-}
-
-void ExLobCursor::emptyPrefetchList(ExLobGlobals *lobGlobals)
-{
-    ExLobCursor::bufferList_t::iterator c_it;
-    ExLobCursorBuffer *buf = NULL;
-
-    c_it = prefetchBufList_.begin();
-    while (c_it != prefetchBufList_.end())
-    {
-      buf = *c_it;
-      lobGlobals->postfetchBufListLock_.lock();
-      lobGlobals->postfetchBufList_.push_back(buf);
-      lobGlobals->postfetchBufListLock_.unlock();
-      c_it = prefetchBufList_.erase(c_it);
-    }
-}
-
-// Seems like this is currently unused. 
-// closeDataCusrorSimple takes care of destroying the cursor.But addign code
-// similar to closeDataCursorSimple for correctness in case it is used in future
-Ex_Lob_Error ExLob::deleteCursor(char *cursorName, ExLobGlobals *lobGlobals)
-{
-    cursor_t *cursor = NULL;
-
-    lobCursorLock_.lock();
-
-    lobCursors_it it = lobCursors_.find(string(cursorName, strlen(cursorName)));
-    if (it != lobCursors_.end())
-    {
-      cursor = &(it->second);
-      lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
-      cursor->lock_.lock();
-      cursor->emptyPrefetchList(lobGlobals);
-      lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-      cursor->lock_.unlock();
-      lobCursors_.erase(it);
-    }
-
-    lobCursorLock_.unlock();
-
-    return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::closeCursor(char *handleIn, Int64 handleInLen)
-{
-    lobCursors_it it = lobCursors_.find(string(handleIn, handleInLen));
-    if (it != lobCursors_.end())
-    {
-      lobCursors_.erase(it);
-    }
-    return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::closeDataCursorSimple(char *fileName, ExLobGlobals *lobGlobals)
-{
-    cursor_t *cursor = NULL;
-    Int64 secs = 0;
-    Int64 nsecs = 0;
-
-    lobCursorLock_.lock();
-
-    lobCursors_it it = lobCursors_.find(string(fileName, strlen(fileName)));
-    if (it != lobCursors_.end())
-    {
-      cursor = &(it->second);
-      lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
-      cursor->lock_.lock();
-
-      clock_gettime(CLOCK_MONOTONIC, &cursor->closeTime_);
-      secs = cursor->closeTime_.tv_sec - cursor->openTime_.tv_sec;
-      nsecs = cursor->closeTime_.tv_nsec - cursor->openTime_.tv_nsec;
-
-      if (cursor->eod_ || cursor->eor_) { // prefetch thread already done,
-        cursor->emptyPrefetchList(lobGlobals);
-	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-	cursor->lock_.unlock();
-        lobCursors_.erase(it);            // so erase it here. 
-        // no need to unlock as cursor object is gone.
-      } else {
-        cursor->eol_ = true;     // prefetch thread will do the eol rituals
-	lobGlobals->traceMessage("signal condition cursor",cursor,__LINE__);
-        cursor->lock_.wakeOne(); // wakeup prefetch thread
-	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
-        cursor->lock_.unlock();
-      }
-    }
-
-    lobCursorLock_.unlock();
-
-    if (nsecs < 0) {
-      secs--;
-      nsecs += NUM_NSECS_IN_SEC;
-    }
-    Int64 totalnsecs = (secs * NUM_NSECS_IN_SEC) + nsecs;
-    stats_.cursorElapsedTime += totalnsecs;
-
-    return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::print()
-{
-    Ex_Lob_Error err;
-    request_.setType(Lob_Req_Print);
-    err = request_.send();
-    return err;
-}
-
-Ex_Lob_Error ExLob::doSanityChecks(char *dir, LobsStorage storage,
-                                   Int64 handleInLen, Int64 handleOutLen, 
-                                   Int64 blackBoxLen)
-{
-
-#ifdef SQ_USE_HDFS
-    if (!fs_)
-      return LOB_HDFS_CONNECT_ERROR;
-#else
-    if (fdData_ == -1)
-      return LOB_DATA_FILE_OPEN_ERROR;
-#endif
-
-    if (dir_.compare(dir) != 0)
-      return LOB_DIR_NAME_ERROR;
-
-    if (storage_ != storage)
-      return LOB_STORAGE_TYPE_ERROR;
+    if (storage_ != storage)
+      return LOB_STORAGE_TYPE_ERROR;
 
     if (handleInLen > MAX_HANDLE_IN_LEN) {
       return LOB_HANDLE_IN_LEN_ERROR;
@@ -1368,75 +1224,199 @@ Ex_Lob_Error ExLob::doSanityChecks(char *dir, LobsStorage storage,
     return LOB_OPER_OK;
 }
 
-
-
-Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset, Int64 lobMaxSize)
+Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset, Int64 lobMaxSize, Int64 lobMaxChunkMemLen, char *handleIn, Int32 handleInLen, Int64 lobGCLimit, void *lobGlobals)
 {
+  NABoolean GCDone = FALSE;
     Ex_Lob_Error err = LOB_OPER_OK;
     Lng32 retval = 0;
     Int64 numRead = 0;
     Int64 numWritten = 0;
-
-    // TBD need a way to lock access to this file.    
+    dataOffset = 0;
+    Int64 dummyParam = 0;
+    if (size > lobMaxSize)
+      return LOB_MAX_LIMIT_ERROR;
     
     Int32 openFlags = O_RDONLY ;   
-    fdDesc_ = hdfsOpenFile(fs_, lobDescFile_, O_RDONLY, 0, 0,0);
-      if (!fdDesc_) {
-	hdfsCloseFile(fs_,fdDesc_);
-	fdDesc_ = NULL;
-	return LOB_DESC_FILE_OPEN_ERROR;
-      }
-      ExLobDescHeader header(lobMaxSize);
-    numRead = hdfsPread(fs_,fdDesc_, 0, (void *)&header, sizeof(ExLobDescHeader) );
-    if (numRead <=0)
-      {
-	return LOB_DESC_HEADER_READ_ERROR;
-      }
-    if (header.getAvailSize() >= size) {
-      descNum = header.getFreeDesc(); 
-
-      dataOffset = header.getDataOffset();
-      header.incFreeDesc();
-      header.decAvailSize(size);
-      header.incDataOffset(size);
-
-      hdfsCloseFile(fs_,fdDesc_);
-      fdDesc_ = NULL;
-      openFlags = O_WRONLY;
-      fdDesc_ = hdfsOpenFile(fs_,lobDescFile_,openFlags,0,0,0);
-      if (!fdDesc_) {
-	
-	return LOB_DESC_FILE_OPEN_ERROR;
-      }
-      numWritten = hdfsWrite(fs_,fdDesc_, (void *)&header, sizeof(ExLobDescHeader)) ;
-      if (numWritten <= 0)
-	{
-	  return LOB_DESC_HEADER_WRITE_ERROR;
+    fdData_ = hdfsOpenFile(fs_, lobDataFile_, O_RDONLY, 0, 0,0);
+      if (!fdData_) {
+	hdfsCloseFile(fs_,fdData_);
+	fdData_ = NULL;
+	return LOB_DATA_FILE_OPEN_ERROR;
       }
+      hdfsFileInfo *fInfo = hdfsGetPathInfo(fs_, lobDataFile_);
+       if (fInfo)
+         dataOffset = fInfo->mSize;
+
+      if (dataOffset > lobGCLimit) // 5 GB default
+         {
+           GCDone = TRUE;
+           /* Int32 rc = SQL_EXEC_LOBcliInterface(handleIn, handleInLen,
+                                               0,0,
+                                               (char *)dummyParam, (Lng32 *)&dummyParam,
+                                               LOB_CLI_PERFORM_LOB_GC, LOB_CLI_ExecImmed,
+                                               &dummyParam, &dummyParam,
+                                               &dummyParam, &dummyParam, 
+                                               NULL,
+                                               0); //don't pass transid */
+           Int32 rc = SQL_EXEC_LOB_GC_Interface(lobGlobals,handleIn,handleInLen,
+                                                hdfsServer_,hdfsPort_,
+                                                lobLocation_,
+                                                lobMaxChunkMemLen);
+           
+         }
+      if (GCDone) // recalculate the new offset 
+        fInfo = hdfsGetPathInfo(fs_, lobDataFile_);
+      if (fInfo)
+        dataOffset = fInfo->mSize;
 
-      
+
+      //Find the last offset in the file
+      // dataOffset = hdfsTell(fs_,fdData_);  //commenting out.hdfsTell always returns 0 !!
+     
+      return LOB_OPER_OK;    
+}
+Ex_Lob_Error ExLob::compactLobDataFile(ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries)
+{
+  Ex_Lob_Error rc = LOB_OPER_OK;
+  Int64 maxMemChunk = 1024*1024*1024; //1GB limit for intermediate buffer for transfering data
+  char * saveLobDataFile = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+6];
+  str_sprintf(saveLobDataFile, "%s_save",lobDataFile_);
+  char * tmpLobDataFile = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+5];
+  str_sprintf(tmpLobDataFile, "%s_tmp",lobDataFile_);
+
+  hdfsFS fs = hdfsConnect(hdfsServer_,hdfsPort_);
+  if (fs == NULL)
+    return LOB_DATA_FILE_OPEN_ERROR;
+  
+ 
+  hdfsFile  fdData = hdfsOpenFile(fs, lobDataFile_, O_RDONLY, 0, 0,0);
+  if (!fdData) 
+    {
+      hdfsCloseFile(fs,fdData);
+      fdData = NULL;
+      return LOB_DATA_FILE_OPEN_ERROR;
     }
-    else {
-      return LOB_DATA_FILE_FULL_ERROR;
+  
+  hdfsFile fdTemp = hdfsOpenFile(fs, tmpLobDataFile,O_WRONLY|O_CREAT,0,0,0);
+   if (!fdTemp) 
+    {
+      hdfsCloseFile(fs,fdTemp);
+      fdTemp = NULL;
+      return LOB_DATA_FILE_OPEN_ERROR;
     }
-    ExLobDesc desc(dataOffset, size, descNum);
 
-      hdfsCloseFile(fs_,fdDesc_);
-      fdDesc_=NULL;
-      openFlags = O_WRONLY| O_APPEND;
-      fdDesc_ = hdfsOpenFile(fs_,lobDescFile_,openFlags,0,0,0);
-      numWritten = hdfsWrite(fs_,fdDesc_, (void *)&desc, sizeof(ExLobDesc));
-      if (numWritten <= 0)
-	{
-	  err = LOB_DESC_WRITE_ERROR;
-	}
-      hdfsCloseFile(fs_,fdDesc_);
-      fdDesc_=NULL;
-     
-      // TBD need a way to unlock this hdfs file.
-    return err;
+   Int32 i = 0;
+   Int64 bytesRead = 0;
+   Int64 bytesWritten = 0;
+   Int64 size = 0;
+   Int64 chunkLen = 0;
+   char * tgt = NULL;
+   while (i < numEntries)
+     {
+       chunkLen = dcArray[i].getChunkLen();
+       if (chunkLen > maxMemChunk)
+         {
+           tgt = (char *)(getLobGlobalHeap())->allocateMemory(maxMemChunk);
+           while (chunkLen > maxMemChunk)
+             {             
+               bytesRead = hdfsPread(fs,fdData,dcArray[i].getCurrentOffset(),tgt,maxMemChunk);
+               if (bytesRead != maxMemChunk)
+                 {
+                   getLobGlobalHeap()->deallocateMemory(tgt);
+                   return LOB_DATA_READ_ERROR;
+                 }
+               bytesWritten = hdfsWrite(fs,fdTemp, tgt,maxMemChunk);
+               if (bytesWritten != size)
+                 {
+                   getLobGlobalHeap()->deallocateMemory(tgt);
+                   return LOB_TARGET_FILE_WRITE_ERROR;
+                 }
+               chunkLen -= maxMemChunk;
+             }
+          
+         }
+       else
+         {
+           tgt = (char *)(getLobGlobalHeap())->allocateMemory(chunkLen);
+            bytesRead = hdfsPread(fs,fdData,dcArray[i].getCurrentOffset(),tgt,chunkLen);
+               if (bytesRead != chunkLen)
+                 {
+                   getLobGlobalHeap()->deallocateMemory(tgt);
+                   return LOB_DATA_READ_ERROR;
+                 }
+               bytesWritten = hdfsWrite(fs,fdTemp, tgt,chunkLen);
+               if (bytesWritten != chunkLen)
+                 {
+                   getLobGlobalHeap()->deallocateMemory(tgt);
+                   return LOB_TARGET_FILE_WRITE_ERROR;
+                 }
+         }
+       if (hdfsFlush(fs, fdTemp)) {
+         return LOB_DATA_FLUSH_ERROR;
+       }
+       getLobGlobalHeap()->deallocateMemory(tgt);
+       i++;
+     }
+   hdfsCloseFile(fs,fdTemp);
+ hdfsCloseFile(fs,fdData);
+  
+   //Now save the data file and rename the tempfile to the original datafile
+
+   Int32 rc2 = hdfsRename(fs,lobDataFile_,saveLobDataFile);
+   if (rc2 == -1)
+     {
+       NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+       NADELETEBASIC(tmpLobDataFile,getLobGlobalHeap());
+       return LOB_DATA_FILE_WRITE_ERROR;
+     }
+   rc2 = hdfsRename(fs,tmpLobDataFile, lobDataFile_);
+   if (rc2 == -1)
+     {
+       NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+       NADELETEBASIC(tmpLobDataFile,getLobGlobalHeap());
+       return LOB_DATA_FILE_WRITE_ERROR;
+     }
+   NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+   NADELETEBASIC(tmpLobDataFile,getLobGlobalHeap());
+   return LOB_OPER_OK;
 }
 
+Ex_Lob_Error ExLob::restoreLobDataFile()
+{
+  Ex_Lob_Error rc = LOB_OPER_OK;
+  
+  
+  hdfsFS fs = hdfsConnect(hdfsServer_,hdfsPort_);
+  if (fs == NULL)
+    return LOB_DATA_FILE_OPEN_ERROR;
+   char * saveLobDataFile = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+6];
+   str_sprintf(saveLobDataFile, "%s_save",lobDataFile_);
+   Int32 rc2 = hdfsDelete(fs,lobDataFile_,FALSE);//ok to ignore error.
+   rc2 = hdfsRename(fs,saveLobDataFile, lobDataFile_);
+   if (rc2)
+     {
+       NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+       return LOB_OPER_ERROR; 
+     }
+   NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+   return rc;
+
+} 
+
+Ex_Lob_Error ExLob::purgeBackupLobDataFile()
+{
+  Ex_Lob_Error rc = LOB_OPER_OK;
+ 
+  hdfsFS fs = hdfsConnect(hdfsServer_,hdfsPort_);
+  if (fs == NULL)
+    return LOB_DATA_FILE_OPEN_ERROR;
+   char * saveLobDataFile = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+6];
+   str_sprintf(saveLobDataFile, "%s_save",lobDataFile_);
+   Int32 rc2 = hdfsDelete(fs,saveLobDataFile,FALSE);//ok to ignore error.
+   
+   NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+   return rc;
+}
 ///////////////////////////////////////////////////////////////////////////////
 // ExLobDescHeader definitions
 ///////////////////////////////////////////////////////////////////////////////
@@ -1471,7 +1451,7 @@ ExLobDesc::~ExLobDesc()
 {
 }
 
-Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen)
+Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen, char *handleIn, Int32 handleLenIn, Int64 transId)
 {
    ExLobDesc desc;
    Ex_Lob_Error err;
@@ -1482,23 +1462,26 @@ Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, I
    tOffset offset; 
    struct timespec startTime; 
    struct timespec endTime;
+   NABoolean isEOD=FALSE;
+   Int64 outOffset = 0;
+   Int64 outSize = 0;
 
    while ( (operLen < tgtSize) && !cursor.eod_ )
    {
     
       if (cursor.bytesRead_ == cursor.descSize_) // time to read next chunck
       {
-         err = fetchCursor();
+        err = fetchCursor(handleIn, handleLenIn,outOffset, outSize,isEOD,transId);
          if (err != LOB_OPER_OK) {
             return err;
          }
 
-         if (request_.getCliError() == 100) {
+         if (isEOD) {
             cursor.eod_ = true; // subsequent call will return 100 and close the cursor
             continue;
          } else {
-            cursor.descSize_ = request_.getDesc().getSize();
-            cursor.descOffset_ = request_.getDesc().getOffset();
+            cursor.descSize_ = outSize;
+            cursor.descOffset_ = outOffset;
             cursor.bytesRead_ = 0;
          }
       }
@@ -1538,7 +1521,7 @@ Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, I
       if (bytesRead == -1) {
          return LOB_DATA_READ_ERROR;
       } else if (bytesRead == 0) {
-         cursor.eod_ = true; 
+         cursor.eod_ = true;         
          continue;
       }
 
@@ -1552,92 +1535,29 @@ Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, I
    return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::readCursorDataSimple(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen)
-{
-   ExLobDesc desc;
-   Ex_Lob_Error err;
-   Int64 bytesAvailable = 0;
-   Int64 bytesToCopy = 0;
-   Int64 bytesRead = 0;
-   operLen = 0;
-   tOffset offset; 
-   struct timespec startTime; 
-   struct timespec endTime;
-   bool done = false;
-
-   if (!fdData_) {
-      return LOB_CURSOR_NOT_OPEN_ERROR;
-   }
-
-   if (cursor.bytesRead_ == -1) {  // starting
-      cursor.bytesRead_ = 0;
-   }
-
-   clock_gettime(CLOCK_MONOTONIC, &startTime);
-   
-   while ( (operLen < tgtSize) && !done )
-   {
-      //offset = cursor.descOffset_ + cursor.bytesRead_;
-      bytesToCopy = tgtSize - operLen;
-      offset = cursor.descOffset_ + cursor.bytesRead_;
-
-      // gets chunks of 64KB. Uses readDirect internally.
-      // bytesRead = hdfsPread(fs_, fdData_, offset, tgt, bytesToCopy);
-      bytesRead = hdfsRead(fs_, fdData_, tgt, bytesToCopy);
-
-      stats_.numHdfsReqs++;
-
-      if (bytesRead == -1) {
-         return LOB_DATA_READ_ERROR;
-      } else if (bytesRead == 0) {
-         done = true; 
-      }
-
-      cursor.bytesRead_ += bytesRead;
-      operLen += bytesRead;
-      tgt += bytesRead;
-   }
-
-   clock_gettime(CLOCK_MONOTONIC, &endTime);
-
-   Int64 secs = endTime.tv_sec - startTime.tv_sec;
-   Int64 nsecs = endTime.tv_nsec - startTime.tv_nsec;
-   if (nsecs < 0) {
-    secs--; 
-    nsecs += NUM_NSECS_IN_SEC;
-   }
-
-   Int64 totalnsecs = (secs * NUM_NSECS_IN_SEC) + nsecs;
-   stats_.CumulativeReadTime += totalnsecs;
 
-   return LOB_OPER_OK;
-}
 
 Ex_Lob_Error ExLob::readDataToMem(char *memAddr,
-                                  Int64 offset, Int64 size, Int64 &operLen)
+                                  Int64 offset, Int64 size, Int64 &operLen,
+                                  char *handleIn, Int32 handleLenIn, 
+                                  NABoolean multipleChunks, Int64 transId)
 
 { 
   Ex_Lob_Error err = LOB_OPER_OK;
   operLen = 0;
   Int64 bytesRead = 0;
-  NABoolean multipleChunks = FALSE;
  
-  if (getRequest()->getBlackBoxLen() == -1) // mxlobsrvr returned -1 indicating multiple chunks for this particular lob handle
+  if (multipleChunks) 
     {
-      multipleChunks = TRUE;
      
-      err = openCursor(getRequest()->getHandleIn(), 
-		       getRequest()->getHandleInLen());
+      err = openCursor(handleIn, 
+		       handleLenIn,transId);
       //now we can fetch the descriptors for each chunk
     }
-  else
-    if (err != LOB_OPER_OK)
-      return err;
    
-  int cliErr = request_.getCliError();
-  if (cliErr < 0 || cliErr == 100) {
-    return LOB_DESC_READ_ERROR;
-  }
+  if (err != LOB_OPER_OK)
+    return err;
+  
 
   if (fdData_)// we may have a stale handle. close and open to refresh 
     {
@@ -1665,22 +1585,19 @@ Ex_Lob_Error ExLob::readDataToMem(char *memAddr,
 				 memAddr, size)) == -1) {
 	  
 	return LOB_DATA_READ_ERROR;
-      }
-
-      
+      }      
       operLen = bytesRead;
       return LOB_OPER_OK;
     }
   else
     {
       //handle reading the multiple chunks like a cursor
-      err = readCursor(memAddr,size, getRequest()->getHandleIn(),
-		       getRequest()->getHandleInLen(), operLen);
-	 
-	 
+      err = readCursor(memAddr,size, handleIn,
+		       handleLenIn, operLen, transId);
+	 	 
       if (err==LOB_OPER_OK)
-	closeCursor(getRequest()->getHandleIn(), 
-		    getRequest()->getHandleInLen());
+	closeCursor(handleIn, 
+		    handleLenIn);
       else
 	return err;
     }
@@ -1689,7 +1606,7 @@ Ex_Lob_Error ExLob::readDataToMem(char *memAddr,
 
  
 
-Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 size, Int64 &writeOperLen, Int64 lobMaxChunkMemSize, Int32 fileflags)
+Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 size, Int64 &writeOperLen, Int64 lobMaxChunkMemSize, Int32 fileflags,char *handleIn,Int32 handleInLen, NABoolean multipleChunks,Int64 transId)
 { 
     Ex_Lob_Error err;
     Int64 operLen = 0;
@@ -1699,10 +1616,10 @@ Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 siz
     Int64 tgtOffset = 0;
     char *lobData = 0;
     Int64 chunkSize = 0;
-
+    
     if (srcLen <=0)
        return LOB_SOURCE_DATA_ALLOC_ERROR;
-    // open the targte file for writing 
+    // open the target file for writing 
     int filePerms = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
     int openFlags = O_RDWR ; // O_DIRECT needs mem alignment
     if (((LobTgtFileFlags)fileflags == Lob_Append_Or_Error ) ||
@@ -1731,15 +1648,16 @@ Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 siz
 	      return LOB_TARGET_FILE_OPEN_ERROR; 
 	  }
       }
-    if ((srcLen < lobMaxChunkMemSize) && (getRequest()->getBlackBoxLen() != -1)) // simple single I/O case
+    if ((srcLen < lobMaxChunkMemSize) && (multipleChunks ==FALSE)) // simple single I/O case
       {
+       
 	lobData = (char *) (getLobGlobalHeap())->allocateMemory(srcLen);
 
 	if (lobData == NULL) 
 	  {
 	    return LOB_SOURCE_DATA_ALLOC_ERROR;
 	  }
-	err = readDataToMem(lobData, srcOffset,srcLen,operLen);
+	err = readDataToMem(lobData, srcOffset,srcLen,operLen, handleIn,handleInLen, multipleChunks,transId);
 	if (err != LOB_OPER_OK)
 	  {
 	    getLobGlobalHeap()->deallocateMemory(lobData);
@@ -1756,8 +1674,8 @@ Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 siz
       }
     else // multiple chunks to read
       {
-	err = openCursor(getRequest()->getHandleIn(), 
-		     getRequest()->getHandleInLen());
+	err = openCursor(handleIn, 
+                         handleInLen,transId);
 	if (err != LOB_OPER_OK)
 	  return err;
 	while ( srcLen > 0)
@@ -1771,8 +1689,8 @@ Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 siz
 		return LOB_SOURCE_DATA_ALLOC_ERROR;
 	      }
 	    //handle reading the multiple chunks like a cursor
-	    err = readCursor(lobData,chunkSize, getRequest()->getHandleIn(),
-			     getRequest()->getHandleInLen(), operLen);
+	    err = readCursor(lobData,chunkSize, handleIn,
+			     handleInLen, operLen, transId);
 
 	    if ((err != LOB_OPER_OK) || (operLen != chunkSize))
 	      {
@@ -1790,15 +1708,15 @@ Ex_Lob_Error ExLob::readDataToLocalFile(char *fileName,  Int64 offset, Int64 siz
 	    srcLen -= chunkSize;
 	    tgtOffset += chunkSize;     
 	  }
-	closeCursor(getRequest()->getHandleIn(), 
-		    getRequest()->getHandleInLen());
+	closeCursor(handleIn, 
+		    handleInLen);
       }
     close(fdDestFile);
     return LOB_OPER_OK;
 }
 
 
-Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &writeOperLen, Int64 lobMaxChunkMemLen, Int32 fileflags)
+Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &writeOperLen, Int64 lobMaxChunkMemLen, Int32 fileflags,char *handleIn, Int32 handleInLen, NABoolean multipleChunks,Int64 transId)
 { 
   Ex_Lob_Error err;
   Int64 operLen = 0;
@@ -1809,6 +1727,7 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
   char *lobData = 0;
   Int64 chunkSize = 0;	
   hdfsFile  fdTgtFile;
+  
   // open and write to the target file
   int openFlags = O_WRONLY;
   if ((LobTgtFileFlags)fileflags == Lob_Append_Or_Error )
@@ -1844,7 +1763,7 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
 	}
     } 
 
-  if ((srcLen < lobMaxChunkMemLen) && (getRequest()->getBlackBoxLen() != -1)) // simple single I/O case
+  if ((srcLen < lobMaxChunkMemLen) && (multipleChunks ==FALSE)) // simple single I/O case
     {
       lobData = (char *) (getLobGlobalHeap())->allocateMemory(srcLen);
 
@@ -1852,7 +1771,7 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
 	{
 	  return LOB_SOURCE_DATA_ALLOC_ERROR;
 	}
-      err = readDataToMem(lobData, srcOffset,srcLen,operLen);
+      err = readDataToMem(lobData, srcOffset,srcLen,operLen,handleIn,handleInLen, multipleChunks,transId);
       if (err != LOB_OPER_OK)
 	{
 	  getLobGlobalHeap()->deallocateMemory(lobData);
@@ -1874,8 +1793,9 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
     }
   else
     {// multiple chunks to read
-      err = openCursor(getRequest()->getHandleIn(), 
-		       getRequest()->getHandleInLen());
+      err = openCursor(handleIn, 
+		       handleInLen,
+                       transId);
       if (err != LOB_OPER_OK)
 	return err;
       while ( srcLen > 0)
@@ -1888,13 +1808,13 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
 	      return LOB_SOURCE_DATA_ALLOC_ERROR;
 	    }
 	  //handle reading the multiple chunks like a cursor
-	  err = readCursor(lobData,chunkSize, getRequest()->getHandleIn(),
-			   getRequest()->getHandleInLen(), operLen);
+	  err = readCursor(lobData,chunkSize, handleIn,
+			   handleInLen, operLen, transId);
 
 	  if ((err != LOB_OPER_OK) || (operLen != chunkSize))
 	    {
 	      getLobGlobalHeap()->deallocateMemory(lobData);
-	      return err;
+	      return LOB_DATA_READ_ERROR;
 	    }
 	  writeOperLen += hdfsWrite(fs_,fdTgtFile,lobData, chunkSize);
 	  if (writeOperLen <= 0)
@@ -1911,8 +1831,8 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
 	  srcLen -= chunkSize;
 
 	}
-      closeCursor(getRequest()->getHandleIn(), 
-		  getRequest()->getHandleInLen());	    
+      closeCursor(handleIn, 
+		  handleInLen);	    
     }
   hdfsCloseFile(fs_, fdTgtFile);
   fdTgtFile=NULL;
@@ -1925,7 +1845,7 @@ Ex_Lob_Error ExLob::readDataToHdfsFile(char *tgtFileName,  Int64 offset, Int64 s
 
 
 
-Ex_Lob_Error ExLob::readDataToExternalFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &operLen,Int64 lobMaxChunkMemLen,Int32 fileflags)
+Ex_Lob_Error ExLob::readDataToExternalFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &operLen,Int64 lobMaxChunkMemLen,Int32 fileflags,char *handleIn,Int32 handleInLen, NABoolean multipleChunks,Int64 transId)
 { 
   //TBD
   return LOB_OPER_OK;
@@ -1954,975 +1874,1210 @@ Ex_Lob_Error ExLob::initStats()
     stats_.init();
     return LOB_OPER_OK;
 }
-void ExLobGlobals::traceMessage(const char *logMessage, ExLobCursor *cursor,
-                                int line)
-{
-  if ( threadTraceFile_ && logMessage)
-  {
-    fprintf(threadTraceFile_, 
-    "Thread: 0x%lx Line:  %d %s 0x%lx\n" ,
-       (unsigned long)pthread_self(), line, logMessage, 
-       (unsigned long) cursor);
-    fflush(threadTraceFile_);
-  }
-    
-}
-Ex_Lob_Error ExLobGlobals::performRequest(ExLobHdfsRequest *request)
-{
+//Main driver of any LOB related operation 
+
+Ex_Lob_Error ExLobsOper (
+			 char        *lobName,          // lob name
+			 char        *handleIn,         // input handle (for cli calls)
+			 Int32       handleInLen,       // input handle len
+			 char        *hdfsServer,       // server where hdfs fs resides
+			 Int64       hdfsPort,          // port number to access hdfs server
+			 char        *handleOut,        // output handle (for cli calls)
+			 Int32       &handleOutLen,     // output handle len
+			 Int64       descNumIn,         // input desc Num (for flat files only)
+			 Int64       &descNumOut,       // output desc Num (for flat files only)
+			 Int64       &retOperLen,       // length of data involved in this operation
+			 Int64       requestTagIn,      // only for checking status
+			 Int64       &requestTagOut,    // returned with every request other than check status
+			 Ex_Lob_Error  &requestStatus,  // returned req status
+			 Int64       &cliError,         // err returned by cli call
+			 char        *dir,              // directory in the storage
+			 LobsStorage storage,           // storage type
+			 char        *source,           // source (memory addr, filename, foreign lob etc)
+			 Int64       sourceLen,         // source len (memory len, foreign desc offset etc)
+			 Int64 cursorBytes,
+			 char *cursorId,
+			 LobsOper    operation,         // LOB operation
+			 LobsSubOper subOperation,      // LOB sub operation
+			 Int64       waited,            // waited or nowaited
+			 void        *&globPtr,         // ptr to the Lob objects. 
+			 Int64       transId,
+			 void        *blackBox,         // black box to be sent to cli
+			 Int32       blackBoxLen,       // length of black box
+			 Int64       lobMaxSize,
+			 Int64       lobMaxChunkMemSize,
+                         Int64       lobGCLimit,
+			 int         bufferSize ,
+			 short       replication ,
+			 int         blockSize,
+			 Lng32       openType)
+{ 
   Ex_Lob_Error err = LOB_OPER_OK;
-  ExLob *lobPtr;
-  ExLobCursorBuffer *buf;
-  ExLobCursor *cursor;
-  Int64 size;
-  NABoolean seenEOR = false;
-  NABoolean seenEOD = false;
-  ExLobCursor::bufferList_t::iterator c_it;
-  Int64 totalBufSize;
+  ExLob *lobPtr = NULL;
+  char fn[MAX_LOB_FILE_NAME_LEN];
+  struct timespec startTime;
+  struct timespec endTime;
+  Int64 secs, nsecs, totalnsecs;
+  ExLobPreOpen *preOpenObj;
+  ExLobGlobals *lobGlobals = NULL;
+  transId = 0;
+  retOperLen = 0;
+  ExLobDesc desc;
+    
+  lobMap_t *lobMap = NULL;
+  lobMap_it it;
 
-  switch (request->reqType_) 
-  {
-    case Lob_Hdfs_Cursor_Prefetch :
-      lobPtr = request->lobPtr_;
-      cursor = request->cursor_;
-      traceMessage("locking cursor",cursor,__LINE__);
-      cursor->lock_.lock();
-      while (!cursor->eod_ && !cursor->eor_ && !cursor->eol_) 
-      {
-        postfetchBufListLock_.lock();
-        c_it = postfetchBufList_.begin();
-        if (c_it != postfetchBufList_.end()) {
-          buf = *c_it;
-          postfetchBufList_.erase(c_it);
-          postfetchBufListLock_.unlock();
-	  traceMessage("unlocking cursor",cursor,__LINE__);
-          cursor->lock_.unlock();
-        } else { 
-          postfetchBufListLock_.unlock();
-          // there are no empty buffers. 
-          // if prefetch list already has the max, wait for one to free up.
-          totalBufSize =  cursor->prefetchBufList_.size() * cursor->bufMaxSize_;
-          if (totalBufSize > LOB_CURSOR_PREFETCH_BYTES_MAX) {
-	    traceMessage("wait on condition cursor",cursor,__LINE__);
-            cursor->lock_.wait();
-            char buffer2[2048];
-            sprintf(buffer2, "cursor->eod_ %d cursor->eor_ %d "
-                             "cursor->eol_ %d", cursor->eod_,
-                              cursor->eor_, cursor->eol_);
-            traceMessage(buffer2, cursor, __LINE__);
-            continue;
-          }
-          // create a new buffer
-	  traceMessage("unlocking cursor",cursor,__LINE__);
-          cursor->lock_.unlock();
-          buf = new (getHeap()) ExLobCursorBuffer();
-          buf->data_ = (char *) (getHeap())->allocateMemory( cursor->bufMaxSize_);
-          lobPtr->stats_.buffersUsed++;
-        }
-        size = min(cursor->bufMaxSize_, (cursor->maxBytes_ - cursor->bytesRead_ + (16 * 1024)));
-        if (buf->data_) {
-          lobPtr->readCursorDataSimple(buf->data_, size, *cursor, buf->bytesRemaining_);
-          buf->bytesUsed_ = 0;
-	  traceMessage("locking cursor",cursor,__LINE__);
-          cursor->lock_.lock();
-          if (size < (cursor->bufMaxSize_)) {
-            cursor->eor_ = true;
-	    seenEOR = true;
-          }
-          if (buf->bytesRemaining_) {
-            cursor->prefetchBufList_.push_back(buf);
-	    traceMessage("signal condition cursor",cursor,__LINE__);
-            cursor->lock_.wakeOne();
-	    traceMessage("unlocking cursor",cursor,__LINE__);
-            cursor->lock_.unlock();
-          } else {
-            cursor->eod_ = true;
-            seenEOD = true;
-	    traceMessage("signal condition cursor",cursor,__LINE__);
-            cursor->lock_.wakeOne();
-	    traceMessage("unlocking cursor",cursor,__LINE__);
-            cursor->lock_.unlock();
-            postfetchBufListLock_.lock();
-            postfetchBufList_.push_back(buf);
-            postfetchBufListLock_.unlock();
-          }
-        } else {
-          assert("data_ is null"); 
-        }
-	// Important! Break and do not access cursor object if we have reached
-	// end of data or range.
-	// The main thread could have destroyed the cursor 
-	// in ::closeDataCursorSimple
-	if (seenEOD || seenEOR)
-        {
-          char buffer2[2048];
-          sprintf(buffer2, "seenEOD %d seenEOR %d",
-                               seenEOD, seenEOR);
-          traceMessage(buffer2, cursor, __LINE__);
-          break;
-        }
-	traceMessage("locking cursor",cursor,__LINE__);
-	cursor->lock_.lock();
-      } // while
+  clock_gettime(CLOCK_MONOTONIC, &startTime);
 
-      if (!seenEOD && !seenEOR)
+  char *fileName = lobName;
+
+  if (globPtr == NULL)
+    {
+      if (operation == Lob_Init)
 	{
-          traceMessage("locking cursor",cursor,__LINE__);
-	  cursor->lock_.unlock();
-	  if (cursor->eol_) { // never reaches here ??  
-	    lobPtr->deleteCursor(cursor->name_, this);
-	  }
+	  globPtr = (void *) new ExLobGlobals();
+	  if (globPtr == NULL) 
+	    return LOB_INIT_ERROR;
+
+	  lobGlobals = (ExLobGlobals *)globPtr;
+
+	  err = lobGlobals->initialize(); 
+	  return err;
 	}
-      processPreOpens();
-      break;
+      else
+	{
+	  return LOB_GLOB_PTR_ERROR;
+	}
+    }
+  else
+    {
+      lobGlobals = (ExLobGlobals *)globPtr;
 
-    default:
-      request->error_ = LOB_HDFS_REQUEST_UNKNOWN;
-  }
+      lobMap = lobGlobals->getLobMap();
 
-  return LOB_OPER_OK;
-}
+      it = lobMap->find(string(fileName));
 
-Ex_Lob_Error ExLobDesc::print()
-{
-    printf("%4d %4d  %4d %4d %4d %4d %8d\n",
-           dataSize_, dataState_, tail_, prev_, next_, nextFree_, dataOffset_);
-    return LOB_OPER_OK;
-}
+      if (it == lobMap->end())
+	{
+	  //lobPtr = new (lobGlobals->getHeap())ExLob();
+	  lobPtr = new ExLob();
+	  if (lobPtr == NULL) 
+	    return LOB_ALLOC_ERROR;
 
-///////////////////////////////////////////////////////////////////////////////
-// ExLobGlobals definitions
-///////////////////////////////////////////////////////////////////////////////
+	  err = lobPtr->initialize(fileName, (operation == Lob_Create) ? EX_LOB_CREATE : EX_LOB_RW, dir, storage, hdfsServer, hdfsPort, dir,bufferSize, replication, blockSize,lobMaxSize,lobGlobals);
+	  if (err != LOB_OPER_OK)
+	    return err;
 
-ExLobGlobals::ExLobGlobals() :
-    lobMap_(NULL), 
-    fs_(NULL),
-    isCliInitialized_(FALSE),
-    isHive_(FALSE),
-    threadTraceFile_(NULL),
-    heap_(NULL)
-{
-  //initialize the log file
-  if (getenv("TRACE_HDFS_THREAD_ACTIONS"))
+	  lobMap->insert(pair<string, ExLob*>(string(fileName), lobPtr));
+	}
+      else
+	{
+	  lobPtr = it->second;
+        
+	}
+    }
+  /* 
+// **Note** This is code that needs to get called before sneding a request to the 
+//mxlobsrvr process. It's inactive code currently   
+  MS_Mon_Transid_Type transIdBig;
+  MS_Mon_Transseq_Type transStartId;
+  if (!lobGlobals->isHive())
     {
-      char logFileName[50]= "";
-      sprintf(logFileName,"trace_threads.%d",getpid());
-      threadTraceFile_ = fopen(logFileName,"a");
+      // get current transaction
+   
+      int transIdErr = ms_transid_get(false, false, &transIdBig, &transStartId);
+      // set the pass thru request object values in the lob
+    
+      lobPtr->getRequest()->setValues(lobPtr->getDescFileName(),
+                                     descNumIn, handleInLen, handleIn, storage,
+                                     transId, transIdBig, transStartId,
+                                     (char *)blackBox, blackBoxLen);
     }
-}
+  */
+  switch(operation)
+    {
+    case Lob_Create:
+      break;
 
-ExLobGlobals::~ExLobGlobals()
-{
-    ExLobCursor::bufferList_t::iterator c_it;
-    ExLobCursorBuffer *buf = NULL;
+    case Lob_InsertDesc:
+      err = lobPtr->writeDesc(sourceLen, source, subOperation, descNumOut, retOperLen, lobMaxSize, lobMaxChunkMemSize,lobGCLimit,handleIn,handleInLen,(char *)blackBox, &blackBoxLen,handleOut,handleOutLen,lobGlobals);
+      break;
 
-    preOpenListLock_.lock();
-    preOpenList_.clear();
-    preOpenListLock_.unlock();
+    case Lob_InsertData:
+      err = lobPtr->insertData(source, sourceLen, subOperation, descNumIn, retOperLen, lobMaxSize,lobMaxChunkMemSize,handleIn,handleInLen,(char *)blackBox, blackBoxLen,handleOut,handleOutLen,lobGlobals);
+      break;
 
-    
-    if (lobMap_) 
-      delete lobMap_;
+    case Lob_InsertDataSimple:
+      err = lobPtr->writeDataSimple(source, sourceLen, subOperation, retOperLen,
+				    bufferSize , replication , blockSize);
+      break;
 
-    for (int i=0; i<NUM_WORKER_THREADS; i++) {
-      enqueueShutdownRequest();
-    }
+    case Lob_Read:
+      if (subOperation == Lob_Memory)
+	err = lobPtr->readToMem(source,sourceLen,retOperLen,handleIn,handleInLen,(char *)blackBox, blackBoxLen,handleOut,handleOutLen,transId);
+      else if (subOperation == Lob_File)
+	err = lobPtr->readToFile(source, sourceLen, retOperLen, lobMaxChunkMemSize,  openType,handleIn,handleInLen,(char *)blackBox, blackBoxLen,handleOut,handleOutLen,transId);
+      else  
+	err = LOB_SUBOPER_ERROR;
+      break;
 
-    for (int i=0; i<NUM_WORKER_THREADS; i++) {
-      pthread_join(threadId_[i], NULL);
-    }
-    // Free the post fetch bugf list AFTER the worker threads have left to 
-    // avoid slow worker thread being stuck and master deallocating these 
-    // buffers and not consuming the buffers which could cause a  lock.
- 
-    postfetchBufListLock_.lock();
-    c_it = postfetchBufList_.begin();
-    while (c_it != postfetchBufList_.end()) {
-      buf = *c_it;
-      if (buf->data_) {
-        heap_->deallocateMemory( buf->data_);
-      }
-      c_it = postfetchBufList_.erase(c_it);
-    }
-    postfetchBufListLock_.unlock();
-    
-    //msg_mon_close_process(&serverPhandle);
-    if (threadTraceFile_)
-      fclose(threadTraceFile_);
-    threadTraceFile_ = NULL;
-}
+    case Lob_ReadDesc: // read desc only. Needed for pass thru.
+      err = lobPtr->getDesc(desc,handleIn,handleInLen,(char *)blackBox, &blackBoxLen,handleOut,handleOutLen,transId); 
+      retOperLen = 0;
+      break;
+    case Lob_OpenCursor:
+      err = lobPtr->openCursor(handleIn, handleInLen,transId);
+      break;
 
-Ex_Lob_Error ExLobGlobals::setServerPhandle()
-{
-    int nid;
-    
-    int err = msg_mon_get_my_info(&nid, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-    char server[12];
-    sprintf(server, "%s%d", "$ZLOBSRV", nid);
+    case Lob_OpenDataCursorSimple:  
+      if (openType == 1) { // preopen
+	sprintf(fn,"%s:%Lx:%s",lobPtr->getDataFileName(), (long long unsigned int)lobName, cursorId);
+	preOpenObj = new (lobGlobals->getHeap()) ExLobPreOpen(lobPtr, fn, descNumIn, sourceLen, cursorBytes, waited);
+	lobGlobals->addToPreOpenList(preOpenObj);
+      } else if (openType == 2) { // must open
+	sprintf(fn,"%s:%Lx:%s",lobPtr->getDataFileName(), (long long unsigned int)lobName, cursorId);
+	fileName = fn;
+	err = lobPtr->openDataCursor(fileName, Lob_Cursor_Simple, descNumIn, sourceLen, cursorBytes, waited, lobGlobals);
+      } else
+	err = LOB_SUBOPER_ERROR;
+      break;
 
-    int oid;
-    err = msg_mon_open_process(server, &serverPhandle, &oid);
+    case Lob_ReadCursor:
+      if ((subOperation == Lob_Memory) || (subOperation == Lob_Buffer))
+	err = lobPtr->readCursor(source, sourceLen, handleIn, handleInLen, retOperLen,transId);
+      else if (subOperation == Lob_File)
+	err = lobPtr->readCursor(source, -1, handleIn, handleInLen, retOperLen,transId);
+      else  
+	err = LOB_SUBOPER_ERROR;
+      break;
 
-    if (err != XZFIL_ERR_OK)
-      return LOB_SERVER_OPEN_ERROR;
+    case Lob_ReadDataCursorSimple:
+      sprintf(fn,"%s:%Lx:%s",lobPtr->getDataFileName(), (long long unsigned int)lobName, cursorId);
+      fileName = fn;       
+      err = lobPtr->readDataCursorSimple(fileName, source, sourceLen, retOperLen, lobGlobals);
+      break;
 
-    return LOB_OPER_OK;
-}
+    case Lob_CloseFile:
+      if (lobPtr->hasNoOpenCursors()) {
+	lobGlobals->traceMessage("Lob_CloseFile",NULL,__LINE__);
+	err = lobPtr->closeFile();
+	it = lobMap->find(string(lobName));
+	lobMap->erase(it);
+	delete lobPtr;
+	lobPtr = NULL;
+      }  
+      break;
 
-Ex_Lob_Error ExLobGlobals::resetServerPhandle()
-{
-   Ex_Lob_Error err;
+    case Lob_CloseCursor:
+      err = lobPtr->closeCursor(handleIn, handleInLen);
+      break;
 
-   msg_mon_close_process(&serverPhandle);
+    case Lob_CloseDataCursorSimple:
+      sprintf(fn,"%s:%Lx:%s",lobPtr->getDataFileName(), (long long unsigned int)lobName, cursorId);
+      fileName = fn;
+      err = lobPtr->closeDataCursorSimple(fileName, lobGlobals);
+      break;
 
-   err = setServerPhandle();
+    case Lob_Append:
+      if ((subOperation == Lob_Memory) ||(subOperation == Lob_Buffer))
+	err = lobPtr->append(source, sourceLen, subOperation, descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize,lobGCLimit,handleIn,handleInLen,handleOut,handleOutLen,lobGlobals);
+      else if (subOperation == Lob_File)
+	err = lobPtr->append(source, -1, subOperation, descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize,lobGCLimit,handleIn,handleInLen,handleOut,handleOutLen,lobGlobals);
+      else  
+	err = LOB_SUBOPER_ERROR;
+      break;
 
-   return err;
-}
+    case Lob_Update:
+      if ((subOperation == Lob_Memory)||(subOperation == Lob_Buffer))
+	err = lobPtr->update(source, sourceLen, subOperation, descNumIn, retOperLen, lobMaxSize, lobMaxChunkMemSize,lobGCLimit,handleIn,handleInLen,handleOut,handleOutLen,lobGlobals);
+      else if (subOperation == Lob_File)
+	err = lobPtr->update(source, -1, subOperation,descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize,lobGCLimit,handleIn,handleInLen,handleOut,handleOutLen,lobGlobals); 
+      else
+	err = LOB_SUBOPER_ERROR;
+      break;
 
-// called once per process
-Ex_Lob_Error ExLobGlobals::initialize()
-{
-    Ex_Lob_Error err = LOB_OPER_OK;
+    case Lob_Delete:
+      err = lobPtr->delDesc(handleIn, handleInLen,transId);
+      break;
 
-    lobMap_ = (lobMap_t *) new (getHeap())lobMap_t; // Leaving this allocated from system heap. Since this class contains hdfsFS unable to derive from LOB heap
-    if (lobMap_ == NULL)
-      return LOB_INIT_ERROR;
+    case Lob_Drop:
+      err = lobPtr->purgeLob();
+      it = lobMap->find(string(lobName));
+      lobMap->erase(it);
+      delete lobPtr;
+      lobPtr = NULL;
+      break;
 
-    
-    err = setServerPhandle();
-    
+    case Lob_Purge:
+      err = lobPtr->purgeLob();
+      it = lobMap->find(string(lobName));
+      lobMap->erase(it);
+      delete lobPtr;
+      lobPtr = NULL;
+      break;
 
-    // start the worker threads
-    startWorkerThreads();
 
-    return err;
-}
+    case Lob_Stats:
+      err = lobPtr->readStats(source);
+      lobPtr->initStats(); // because file may remain open across cursors
+      break;
 
-static void *workerThreadMain(void *arg)
-{
-   // parameter passed to the thread is an instance of the ExLobHdfs object
-   ExLobGlobals *glob = (ExLobGlobals *)arg;
+    case Lob_Empty_Directory:
+      lobPtr->initialize(fileName, EX_LOB_RW,
+			 dir, storage, hdfsServer, hdfsPort, dir,bufferSize, replication, blockSize);
+      err = lobPtr->emptyDirectory();
+      break;
 
-   glob->doWorkInThread();
+    case Lob_Cleanup:
+      delete lobGlobals;
+      break;
+    case Lob_PerformGC:
+      err = lobPtr->compactLobDataFile((ExLobInMemoryDescChunksEntry *)source,sourceLen);
+      break;
+    case Lob_RestoreLobDataFile:
+      err = lobPtr->restoreLobDataFile();
+      break;
+    case Lob_PurgeBackupLobDataFile:
+      err = lobPtr->purgeBackupLobDataFile();
+      break;
+    default:
+      err = LOB_OPER_ERROR;
+      break;
+    }
+  /*
+//**Note ** This code is needed to reinstate the master transaction after 
+// returning from the mxlobsrvr process. This is inactive code for now
+if (!lobGlobals->isHive() )
+    {
+      if (lobPtr)
+       // set the pass thru request object values from the lob
+       lobPtr->getRequest()->getValues(descNumOut, handleOutLen, handleOut, 
+                                       requestStatus, cliError,
+                                       (char *)blackBox, blackBoxLen);    // reinstate the transaction
+      if (TRANSID_IS_VALID(transIdBig)) {
+       ms_transid_reinstate(transIdBig, transStartId);
+      }
+    }
 
-   return NULL;
+  */
+  clock_gettime(CLOCK_MONOTONIC, &endTime);
+
+  secs = endTime.tv_sec - startTime.tv_sec;
+  nsecs = endTime.tv_nsec - startTime.tv_nsec;
+  if (nsecs < 0) {
+    secs--;
+    nsecs += NUM_NSECS_IN_SEC;
+  }
+  totalnsecs = (secs * NUM_NSECS_IN_SEC) + nsecs;
+  if (lobPtr && lobPtr->getStats())
+    lobPtr->getStats()->hdfsAccessLayerTime += totalnsecs; 
+       
+  return err;
 }
 
-Ex_Lob_Error ExLobGlobals::startWorkerThreads()
-{
-   int rc;
-   for (int i=0; i<NUM_WORKER_THREADS; i++) {
-     rc = pthread_create(&threadId_[i], NULL, workerThreadMain, this);
-     if (rc != 0)
-      return LOB_HDFS_THREAD_CREATE_ERROR;
-   }
-   
-   return LOB_OPER_OK;
+void cleanupLOBDataDescFiles(const char *lobHdfsServer,int lobHdfsPort,const char *lobHdfsLoc)
+{ 
+  int numExistingFiles=0;
+  hdfsFS fs;
+  fs = hdfsConnect(lobHdfsServer, lobHdfsPort);
+  if (fs == NULL)
+    return;
+  // Get this list of all data and desc files in the lob sotrage location
+  hdfsFileInfo *fileInfos = hdfsListDirectory(fs, lobHdfsLoc, &numExistingFiles);
+  if (fileInfos == NULL)
+    return ;
+  //Delete each one in a loop
+  for (int i = 0; i < numExistingFiles; i++)      
+    hdfsDelete(fs, fileInfos[i].mName, 0);
+    
+  // *Note* : delete the memory allocated by libhdfs for the file info array  
+  if (fileInfos)
+    {
+      hdfsFreeFileInfo(fileInfos, numExistingFiles);
+    }
 }
 
-///////////////////////////////////////////////////////////////////////////////
-// ExLobRequest definitions
-///////////////////////////////////////////////////////////////////////////////
 
-ExLobRequest::ExLobRequest() :
-    reqNum_(0),
-    descNumIn_(-1),
-    descNumOut_(-1),
-    handleInLen_(-1),
-    handleOutLen_(-1),
-    dataOffset_(-1),
-    type_(Lob_Req_Invalid),
-    storage_(Lob_Invalid_Storage),
-    operLen_(-1),
-    error_(LOB_INVALID_ERROR_VAL),
-    cliError_(-1),
-    status_(LOB_INVALID_ERROR_VAL),
-    transId_(0)
-{
-   TRANSID_SET_NULL(transIdBig_);
-}
+// The following methods are used for hive access
+/* 
+Main thread issues an open to open a range of 128 MB and wakes up a 
+worker thread. It doesn’t wait.It calls pre open on the next range. This is 
+done in method ::readDataCursorSimple.
 
-void ExLobRequest::setValues(char *descFileName, Int64 descNumIn, Int64 handleInLen, 
-                             char *handleIn, LobsStorage storage, Int64 transId,
-                             SB_Transid_Type transIdBig,
-                             SB_Transseq_Type transStartId,
-                             char *blackBox, Int64 blackBoxLen)
-{
-  
-    descNumIn_ = descNumIn;
-    handleInLen_ = handleInLen;
-    storage_ = storage;
-    strcpy(descFileName_, descFileName);
-    if (handleIn != NULL && handleInLen > 0) {
-       memcpy(handleIn_, handleIn, handleInLen);
-    }
-    cliError_ = -1;
-    error_ = LOB_INVALID_ERROR_VAL;
-    status_ = LOB_INVALID_ERROR_VAL;
+The worker threads do their work in ::doWorkInThread and ::performRequests, ::readCursorDataSimple.(note the  diff from the method the mainthread calls above) 
 
-    transId_ = transId;
-    transIdBig_ = transIdBig;
-    transStartId_ = transStartId;
-    blackBoxLen_ = blackBoxLen;
-    if (blackBox != NULL && blackBoxLen > 0) {
-       memcpy(blackBox_, blackBox, blackBoxLen);
-    }
-    
-}
+Main thread then issues a read. Since worker thread had already begun fetching 
+16KB buffers in (1), the main thread most likely will not need to wait and the 
+data will be ready. It keeps consuming the buffers, recycling them back into 
+postFetchBufList. 
+When done, the main thread closes the cursor(::closeDataCursorSimple). This is determined by whether we 
+have reached the end of range or the end of data for that file.
+The worker threads on the other hand  read 16KB of data and buffers them in a 
+prefetchBufList. It continues doing this until end of range is reached or the 
+buffer limit (128MB) has been reached. 
+*/
 
-void ExLobRequest::getValues(Int64 &descNumOut, Int64 &handleOutLen, 
-                             char *handleOut, Ex_Lob_Error &requestStatus, 
-                             Int64 &cliError,
-                             char *blackBox, Int64 &blackBoxLen)
+Ex_Lob_Error ExLob::readDataCursorSimple(char *file, char *tgt, Int64 tgtSize, 
+                                         Int64 &operLen, ExLobGlobals *lobGlobals)
 {
-  
-    descNumOut = descNumOut_;
-    handleOutLen = handleOutLen_;
-    requestStatus = error_;
-    cliError = cliError_;
-    if (handleOut != NULL && handleOutLen_ > 0) {
-       memcpy(handleOut, handleOut_, handleOutLen_);
-    }
-    blackBoxLen = blackBoxLen_;
-    if (blackBox != NULL && blackBoxLen_ > 0) {
-       memcpy(blackBox, blackBox_, blackBoxLen_);
-    }
-    // #endif
-}
+    int dataOffset;
+    Ex_Lob_Error result = LOB_OPER_OK;
+    cursor_t *cursor;
+    ExLobCursor::bufferList_t::iterator c_it;
+    ExLobCursorBuffer *buf = NULL;
+    Int64 bytesToCopy = 0;
+    operLen = 0;
+    Int64 len;
+    char *target = tgt;
+    bool done = false;
 
-ExLobRequest::~ExLobRequest()
-{
-}
+    struct timespec startTime;
+    struct timespec endTime;
 
-Ex_Lob_Error ExLobRequest::send()
-{
- 
+    lobCursorLock_.lock();
 
-    int msgid; 
-    int oid;
-    MS_Result_Type result;
-    short req_ctrl[BUFSIZ];
-    short rep_ctrl[BUFSIZ];
-    char *req_data = (char *)this;
-    ExLobRequest rep_data;
-    short req_data_len = sizeof(ExLobRequest);
-    short rep_data_max = sizeof(ExLobRequest);
-    int err=0;
-    int inx=0;
-    int retries = 3;
+    lobCursors_it it = lobCursors_.find(string(file, strlen(file)));
 
-    incrReqNum();
+    if (it == lobCursors_.end())
+    {
+       lobCursorLock_.unlock();
+       return LOB_CURSOR_NOT_OPEN;
+    }
+    else
+    {
+       cursor = &(it->second); 
+    } 
 
-    status_ = LOB_OPER_REQ_IN_PROGRESS;
+    lobCursorLock_.unlock();
 
-    do 
+    while ((operLen < tgtSize) && !done && !cursor->eol_)
     {
-       err = BMSG_LINK_(&serverPhandle,
-                        &msgid, 
-                        req_ctrl,
-                        (ushort) (inx &1),
-                        rep_ctrl,
-                        1,
-                        req_data,
-                        req_data_len,
-                        (char *)&rep_data, 
-                        rep_data_max,
-                        0,0,0,0); 
-       retries--;
-
-       err = BMSG_BREAK_(msgid, (short *) &result, &serverPhandle);
+      lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
+      cursor->lock_.lock();
 
-       if (err == XZFIL_ERR_PATHDOWN) {
-	 //lobGlobals->resetServerPhandle();
-       }
+      // if no buffers to read and is eor or eod, we are done.
+      // else wait for prefetch thread to wake us up. 
+      if (cursor->prefetchBufList_.size() == 0) {
+        if (cursor->eor_ || cursor->eod_) {
+          done = true;
+        } else {
+          cursor->bufferMisses_++;
+	  lobGlobals->traceMessage("wait on condition cursor",cursor,__LINE__);
+          cursor->lock_.wait();
+        }
+	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
+        cursor->lock_.unlock();
+        continue;
+      } 
 
-    } while ( (err == XZFIL_ERR_PATHDOWN) && (retries > 0) ); // 201 if lobserver got restared
+      // a buffer is available
+      c_it = cursor->prefetchBufList_.begin();
+      buf = *c_it;
+      lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
+      cursor->lock_.unlock();
 
-    status_ = LOB_OPER_REQ_DONE;
+      bytesToCopy = min(buf->bytesRemaining_, tgtSize - operLen);
+      memcpy(target, buf->data_ + buf->bytesUsed_, bytesToCopy);
+      target += bytesToCopy;
+      if (bytesToCopy == buf->bytesRemaining_) { // buffer is now empty
+        buf->bytesRemaining_ = -1;
+        buf->bytesUsed_ = -1;
+        lobGlobals->postfetchBufListLock_.lock();
+        lobGlobals->postfetchBufList_.push_back(buf);
+        lobGlobals->postfetchBufListLock_.unlock();
+	lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
+        cursor->lock_.lock();
+        c_it = cursor->prefetchBufList_.erase(c_it);
+	lobGlobals->traceMessage("signal condition cursor",cursor,__LINE__);
+        cursor->lock_.wakeOne(); // wake up prefetch thread if it was waiting for an empty buffer.
+	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
+        cursor->lock_.unlock();
+      } else {
+        buf->bytesUsed_ += bytesToCopy;
+        buf->bytesRemaining_ -= bytesToCopy;
+      }
+      stats_.bytesPrefetched += bytesToCopy;
+      operLen += bytesToCopy;
+    } 
 
-    if (err != XZFIL_ERR_OK)
-      return LOB_SEND_MSG_ERROR;
+    // update stats
+    stats_.bytesRead += operLen;
+    stats_.bytesToRead += tgtSize;
+    stats_.numReadReqs++;
 
-    memcpy(this, &rep_data, rep_data_max);
-  
     return LOB_OPER_OK;
 }
 
-void ExLobRequest::getDescOut(ExLobDesc &desc) 
-{ 
-   memcpy(&desc, &desc_, sizeof(ExLobDesc)); 
-}
-
-void ExLobRequest::putDescIn(ExLobDesc &desc) 
-{ 
-   memcpy(&desc_, &desc, sizeof(ExLobDesc)); 
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ExLobHdfs definitions
-///////////////////////////////////////////////////////////////////////////////
-#ifdef SQ_USE_HDFS
-
-ExLobLock::ExLobLock()
-    : bellRang_(false),
-      waiters_(0)
+Ex_Lob_Error ExLob::closeDataCursorSimple(char *fileName, ExLobGlobals *lobGlobals)
 {
-   pthread_mutexattr_t mutexAttr;
-   pthread_mutexattr_init( &mutexAttr );
-   pthread_mutex_init( &mutex_, &mutexAttr );
-   pthread_cond_init( &workBell_, NULL );
-}
+    cursor_t *cursor = NULL;
+    Int64 secs = 0;
+    Int64 nsecs = 0;
 
-ExLobLock::~ExLobLock()
-{
-   pthread_mutex_unlock( &mutex_ );
-   pthread_mutex_destroy(&mutex_);
-   pthread_cond_destroy(&workBell_);
-}
+    lobCursorLock_.lock();
 
-void ExLobLock::lock()
-{
-   pthread_mutex_lock( &mutex_ );
-}
+    lobCursors_it it = lobCursors_.find(string(fileName, strlen(fileName)));
+    if (it != lobCursors_.end())
+    {
+      cursor = &(it->second);
+      lobGlobals->traceMessage("locking cursor",cursor,__LINE__);
+      cursor->lock_.lock();
 
-void ExLobLock::unlock()
-{
-   pthread_mutex_unlock( &mutex_ );
-}
+      clock_gettime(CLOCK_MONOTONIC, &cursor->closeTime_);
+      secs = cursor->closeTime_.tv_sec - cursor->openTime_.tv_sec;
+      nsecs = cursor->closeTime_.tv_nsec - cursor->openTime_.tv_nsec;
 
-void ExLobLock::wakeOne()
-{
-   pthread_cond_signal(&workBell_);
-}
+      if (cursor->eod_ || cursor->eor_) { // prefetch thread already done,
+        cursor->emptyPrefetchList(lobGlobals);
+	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
+	cursor->lock_.unlock();
+        lobCursors_.erase(it);            // so erase it here. 
+        // no need to unlock as cursor object is gone.
+      } else {
+        cursor->eol_ = true;     // prefetch thread will do the eol rituals
+	lobGlobals->traceMessage("signal condition cursor",cursor,__LINE__);
+        cursor->lock_.wakeOne(); // wakeup prefetch thread
+	lobGlobals->traceMessage("unlocking cursor",cursor,__LINE__);
+        cursor->lock_.unlock();
+      }
+    }
 
-void ExLobLock::wakeAll()
-{
-   pthread_cond_broadcast(&workBell_);
-}
+    lobCursorLock_.unlock();
 
-void ExLobLock::wait()
-{
-    waiters_++;
-    pthread_cond_wait(&workBell_, &mutex_);
-    waiters_--;
-}
+    if (nsecs < 0) {
+      secs--;
+      nsecs += NUM_NSECS_IN_SEC;
+    }
+    Int64 totalnsecs = (secs * NUM_NSECS_IN_SEC) + nsecs;
+    stats_.cursorElapsedTime += totalnsecs;
 
-ExLobHdfsRequest::ExLobHdfsRequest(LobsHdfsRequestType reqType, hdfsFS fs, 
-                                   hdfsFile file, char *buffer, int size) :
-   reqType_(reqType),
-   fs_(fs),
-   file_(file),
-   buffer_(buffer),
-   size_(size)
-{
-  lobPtr_ = 0;
-  error_ = LOB_OPER_OK;
+    return LOB_OPER_OK;
 }
 
-ExLobHdfsRequest::ExLobHdfsRequest(LobsHdfsRequestType reqType, ExLobCursor *cursor) :
-   reqType_(reqType),
-   cursor_(cursor)
-{
-  buffer_=0;
-  lobPtr_=0;
-  fs_=0;
-  file_=0;
-  size_=0;
-  error_=LOB_OPER_OK;
-}
 
-ExLobHdfsRequest::ExLobHdfsRequest(LobsHdfsRequestType reqType, ExLob *lobPtr, ExLobCursor *cursor) :
-   reqType_(reqType),
-   lobPtr_(lobPtr),
-   cursor_(cursor)
+Ex_Lob_Error ExLobGlobals::performRequest(ExLobHdfsRequest *request)
 {
-  buffer_=0;
-  fs_=0;
-  file_=0;
-  size_=0;
-  error_=LOB_OPER_OK;
-}
+  Ex_Lob_Error err = LOB_OPER_OK;
+  ExLob *lobPtr;
+  ExLobCursorBuffer *buf;
+  ExLobCursor *cursor;
+  Int64 size;
+  NABoolean seenEOR = false;
+  NABoolean seenEOD = false;
+  ExLobCursor::bufferList_t::iterator c_it;
+  Int64 totalBufSize;
 
-ExLobHdfsRequest::ExLobHdfsRequest(LobsHdfsRequestType reqType) :
-   reqType_(reqType)
-{
+  switch (request->reqType_) 
+  {
+    case Lob_Hdfs_Cursor_Prefetch :
+      lobPtr = request->lobPtr_;
+      cursor = request->cursor_;
+      traceMessage("locking cursor",cursor,__LINE__);
+      cursor->lock_.lock();
+      while (!cursor->eod_ && !cursor->eor_ && !cursor->eol_) 
+      {
+        postfetchBufListLock_.lock();
+        c_it = postfetchBufList_.begin();
+        if (c_it != postfetchBufList_.end()) {
+          buf = *c_it;
+          postfetchBufList_.erase(c_it);
+          postfetchBufListLock_.unlock();
+	  traceMessage("unlocking cursor",cursor,__LINE__);
+          cursor->lock_.unlock();
+        } else { 
+          postfetchBufListLock_.unlock();
+          // there are no empty buffers. 
+          // if prefetch list already has the max, wait for one to free up.
+          totalBufSize =  cursor->prefetchBufList_.size() * cursor->bufMaxSize_;
+          if (totalBufSize > LOB_CURSOR_PREFETCH_BYTES_MAX) {
+	    traceMessage("wait on condition cursor",cursor,__LINE__);
+            cursor->lock_.wait();
+            char buffer2[2048];
+            sprintf(buffer2, "cursor->eod_ %d cursor->eor_ %d "
+                             "cursor->eol_ %d", cursor->eod_,
+                              cursor->eor_, cursor->eol_);
+            traceMessage(buffer2, cursor, __LINE__);
+            continue;
+          }
+          // create a new buffer
+	  traceMessage("unlocking cursor",cursor,__LINE__);
+          cursor->lock_.unlock();
+          buf = new (getHeap()) ExLobCursorBuffer();
+          buf->data_ = (char *) (getHeap())->allocateMemory( cursor->bufMaxSize_);
+          lobPtr->stats_.buffersUsed++;
+        }
+        size = min(cursor->bufMaxSize_, (cursor->maxBytes_ - cursor->bytesRead_ + (16 * 1024)));
+        if (buf->data_) {
+          lobPtr->readCursorDataSimple(buf->data_, size, *cursor, buf->bytesRemaining_);
+          buf->bytesUsed_ = 0;
+	  traceMessage("locking cursor",cursor,__LINE__);
+          cursor->lock_.lock();
+          if (size < (cursor->bufMaxSize_)) {
+            cursor->eor_ = true;
+	    seenEOR = true;
+          }
+          if (buf->bytesRemaining_) {
+            cursor->prefetchBufList_.push_back(buf);
+	    traceMessage("signal condition cursor",cursor,__LINE__);
+            cursor->lock_.wakeOne();
+	    traceMessage("unlocking cursor",cursor,__LINE__);
+            cursor->lock_.unlock();
+          } else {
+            cursor->eod_ = true;
+            seenEOD = true;
+	    traceMessage("signal condition cursor",cursor,__LINE__);
+            cursor->lock_.wakeOne();
+	    traceMessage("unlocking cursor",cursor,__LINE__);
+            cursor->lock_.unlock();
+            postfetchBufListLock_.lock();
+            postfetchBufList_.push_back(buf);
+            postfetchBufListLock_.unlock();
+          }
+        } else {
+          assert("data_ is null"); 
+        }
+	// Important! Break and do not access cursor object if we have reached
+	// end of data or range.
+	// The main thread could have destroyed the cursor 
+	// in ::closeDataCursorSimple
+	if (seenEOD || seenEOR)
+        {
+          char buffer2[2048];
+          sprintf(buffer2, "seenEOD %d seenEOR %d",
+                               seenEOD, seenEOR);
+          traceMessage(buffer2, cursor, __LINE__);
+          break;
+        }
+	traceMessage("locking cursor",cursor,__LINE__);
+	cursor->lock_.lock();
+      } // while
 
-  buffer_=0;
-  cursor_=0;
-  lobPtr_=0;
-  fs_=0;
-  file_=0;
-  size_=0;
-  error_=LOB_OPER_OK;
-}
+      if (!seenEOD && !seenEOR)
+	{
+          traceMessage("locking cursor",cursor,__LINE__);
+	  cursor->lock_.unlock();
+	  if (cursor->eol_) { // never reaches here ??  
+	    lobPtr->deleteCursor(cursor->name_, this);
+	  }
+	}
+      processPreOpens();
+      break;
 
-ExLobHdfsRequest::~ExLobHdfsRequest()
-{
+    default:
+      request->error_ = LOB_HDFS_REQUEST_UNKNOWN;
+  }
+
+  return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLobGlobals::enqueueRequest(ExLobHdfsRequest *request)
+
+
+Ex_Lob_Error ExLob::readCursorDataSimple(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen)
 {
-   char buffer2[2048];
-   sprintf(buffer2, "enqueue request %d", request->reqType_);
-   traceMessage(buffer2, NULL, __LINE__);
-   reqQueueLock_.lock();
-   reqQueue_.push_back(request);
-   reqQueueLock_.wakeOne();
-   reqQueueLock_.unlock();
+   ExLobDesc desc;
+   Ex_Lob_Error err;
+   Int64 bytesAvailable = 0;
+   Int64 bytesToCopy = 0;
+   Int64 bytesRead = 0;
+   operLen = 0;
+   tOffset offset; 
+   struct timespec startTime; 
+   struct timespec endTime;
+   bool done = false;
 
-   return LOB_OPER_OK;
-}
+   if (!fdData_) {
+      return LOB_CURSOR_NOT_OPEN_ERROR;
+   }
 
-Ex_Lob_Error ExLobGlobals::enqueuePrefetchRequest(ExLob *lobPtr, ExLobCursor *cursor)
-{// Leaving this allocated from system heap. Since this class contains hdfsFS unable to derive from LOB heap
-  ExLobHdfsRequest *request = new  ExLobHdfsRequest(Lob_Hdfs_Cursor_Prefetch, lobPtr, cursor);
-   
-   if (!request) {
-     // return error
+   if (cursor.bytesRead_ == -1) {  // starting
+      cursor.bytesRead_ = 0;
    }
 
-   enqueueRequest(request);
+   clock_gettime(CLOCK_MONOTONIC, &startTime);
+   
+   whil

<TRUNCATED>


[28/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED310
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED310 b/core/sql/regress/charsets/EXPECTED310
index 90eb60a..853faca 100644
--- a/core/sql/regress/charsets/EXPECTED310
+++ b/core/sql/regress/charsets/EXPECTED310
@@ -4905,7 +4905,10 @@ u1u1      u1u1
 >>create TRIGGER TRG1_cs310t90   before UPDATE on cs310t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UCS2_col2 = _ISO88591'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs310t90 values('Test1','Test1','Test1','Test1'), ('test111','test1111','test111','test1111');
 
@@ -4918,7 +4921,7 @@ u1u1      u1u1
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -4931,7 +4934,7 @@ test111                                                                   test11
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -4947,8 +4950,8 @@ test111                                                                   test11
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 
@@ -4962,8 +4965,8 @@ test222                                                                   test22
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 
@@ -4980,9 +4983,9 @@ test222                                                                   test22
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -4997,9 +5000,9 @@ test333                                                                   test33
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5008,11 +5011,17 @@ test333                                                                   test33
 >>--
 >>DROP TRIGGER TRG1_cs310t90;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs310t90   before UPDATE on cs310t90   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _ucs2'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs310t90 values('Test4','Test4','Test4','Test4'), ('test444','test4444','test444','test4444');
 
@@ -5025,10 +5034,10 @@ test333                                                                   test33
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5044,10 +5053,10 @@ test444                                                                   test44
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5066,11 +5075,11 @@ test444                                                                   test44
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5087,11 +5096,11 @@ test555                                                                   test55
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5111,12 +5120,12 @@ test555                                                                   test55
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Iso6                                                                      Test6                                                                     Test6                                 abc                                 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Iso6                                                                      Test6                                                                     Test6                                 Test6                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5134,12 +5143,12 @@ test666                                                                   test66
 UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-Iso3                                                                      abc                                                                       Test3                                 Test3                               
-Iso6                                                                      Test6                                                                     Test6                                 abc                                 
-Test1                                                                     abc                                                                       Test1                                 Iso1                                
-Test2                                                                     abc                                                                       Test2                                 UCS2                                
-Test4                                                                     Test4                                                                     Iso4                                  abc                                 
-Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+Iso3                                                                      Test3                                                                     Test3                                 Test3                               
+Iso6                                                                      Test6                                                                     Test6                                 Test6                               
+Test1                                                                     Test1                                                                     Test1                                 Iso1                                
+Test2                                                                     Test2                                                                     Test2                                 UCS2                                
+Test4                                                                     Test4                                                                     Iso4                                  Test4                               
+Test5                                                                     Test5                                                                     UCS5                                  Test5                               
 test111                                                                   test1111                                                                  test111                               test1111                            
 test222                                                                   test2222                                                                  test222                               test2222                            
 test333                                                                   test3333                                                                  test333                               test3333                            
@@ -5165,7 +5174,10 @@ test666                                                                   test66
 >>create TRIGGER TRG1_cs310t91   before UPDATE on cs310t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.UCS2_col2 = _ISO88591'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs310t91 values(1,'Test1','Test1','Test1','Test1'), (2,'test111','test1111','test111','test1111');
 
@@ -5178,7 +5190,7 @@ test666                                                                   test66
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5191,7 +5203,7 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
 
 --- 2 row(s) selected.
@@ -5207,9 +5219,9 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -5222,9 +5234,9 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
 
 --- 4 row(s) selected.
@@ -5240,11 +5252,11 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
 
 --- 6 row(s) selected.
@@ -5257,22 +5269,28 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
 
 --- 6 row(s) selected.
 >>--
 >>DROP TRIGGER TRG1_cs310t91;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>create TRIGGER TRG1_cs310t91   before UPDATE on cs310t91   REFERENCING NEW as TRG  FOR EACH ROW
 +>       set TRG.ISO_col2 = _ucs2'abc' ;
 
---- SQL operation complete.
+*** ERROR[3131] The statement just entered is currently not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
 >>--
 >>insert into cs310t91 values(7,'Test4','Test4','Test4','Test4'), (8,'test444','test4444','test444','test4444');
 
@@ -5285,13 +5303,13 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -5304,13 +5322,13 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
 
 --- 8 row(s) selected.
@@ -5326,15 +5344,15 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -5347,15 +5365,15 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
 
 --- 10 row(s) selected.
@@ -5371,17 +5389,17 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
-         11  Iso6                                                                      Test6                                                                     Test6                                 abc                                 
+         11  Iso6                                                                      Test6                                                                     Test6                                 Test6                               
          12  test666                                                                   test6666                                                                  test666                               test6666                            
 
 --- 12 row(s) selected.
@@ -5394,17 +5412,17 @@ PRKY         UCS2_COL1
 PRKY         UCS2_COL1                                                                 UCS2_COL2                                                                 ISO_COL1                              ISO_COL2
 -----------  ------------------------------------------------------------------------  ------------------------------------------------------------------------  ------------------------------------  ------------------------------------
 
-          1  Test1                                                                     abc                                                                       Test1                                 Iso1                                
+          1  Test1                                                                     Test1                                                                     Test1                                 Iso1                                
           2  test111                                                                   test1111                                                                  test111                               test1111                            
-          3  Test2                                                                     abc                                                                       Test2                                 UCS2                                
+          3  Test2                                                                     Test2                                                                     Test2                                 UCS2                                
           4  test222                                                                   test2222                                                                  test222                               test2222                            
-          5  Iso3                                                                      abc                                                                       Test3                                 Test3                               
+          5  Iso3                                                                      Test3                                                                     Test3                                 Test3                               
           6  test333                                                                   test3333                                                                  test333                               test3333                            
-          7  Test4                                                                     Test4                                                                     Iso4                                  abc                                 
+          7  Test4                                                                     Test4                                                                     Iso4                                  Test4                               
           8  test444                                                                   test4444                                                                  test444                               test4444                            
-          9  Test5                                                                     Test5                                                                     UCS5                                  abc                                 
+          9  Test5                                                                     Test5                                                                     UCS5                                  Test5                               
          10  test555                                                                   test5555                                                                  test555                               test5555                            
-         11  Iso6                                                                      Test6                                                                     Test6                                 abc                                 
+         11  Iso6                                                                      Test6                                                                     Test6                                 Test6                               
          12  test666                                                                   test6666                                                                  test666                               test6666                            
 
 --- 12 row(s) selected.


[10/50] [abbrv] incubator-trafodion git commit: not support hdp2_3, support next PR

Posted by db...@apache.org.
not support hdp2_3,support next PR


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

Branch: refs/heads/master
Commit: 38c9005ac81199c5d27d266ee5a0bd82cee2c27b
Parents: 0282210
Author: traf <tr...@aven01.novalocal>
Authored: Fri Mar 11 10:14:43 2016 +0000
Committer: traf <tr...@aven01.novalocal>
Committed: Fri Mar 11 10:14:43 2016 +0000

----------------------------------------------------------------------
 core/sqf/conf/install_features | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38c9005a/core/sqf/conf/install_features
----------------------------------------------------------------------
diff --git a/core/sqf/conf/install_features b/core/sqf/conf/install_features
index 15a1789..184670e 100644
--- a/core/sqf/conf/install_features
+++ b/core/sqf/conf/install_features
@@ -62,4 +62,5 @@
 # verify the hadoop distro versions are correct as well as 
 # perform some additional support for this.
 export CDH_5_3_HDP_2_2_SUPPORT="N"
+export HDP_2_3_SUPPORT="N"
 export CDH_5_4_SUPPORT="Y"


[17/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/client/Client.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/client/Client.java b/dcs/src/main/java/org/trafodion/dcs/rest/client/Client.java
deleted file mode 100644
index d21eb3a..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/client/Client.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-
-package org.trafodion.dcs.rest.client;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpVersion;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.params.HttpClientParams;
-import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A wrapper around HttpClient which provides some useful function and
- * semantics for interacting with the REST gateway.
- */
-public class Client {
-  public static final Header[] EMPTY_HEADER_ARRAY = new Header[0];
-
-  private static final Log LOG = LogFactory.getLog(Client.class);
-
-  private HttpClient httpClient;
-  private Cluster cluster;
-
-  private Map<String, String> extraHeaders;
-
-  /**
-   * Default Constructor
-   */
-  public Client() {
-    this(null);
-  }
-
-  /**
-   * Constructor
-   * @param cluster the cluster definition
-   */
-  public Client(Cluster cluster) {
-    this.cluster = cluster;
-    MultiThreadedHttpConnectionManager manager = 
-      new MultiThreadedHttpConnectionManager();
-    HttpConnectionManagerParams managerParams = manager.getParams();
-    managerParams.setConnectionTimeout(2000); // 2 s
-    managerParams.setDefaultMaxConnectionsPerHost(10);
-    managerParams.setMaxTotalConnections(100);
-    extraHeaders = new ConcurrentHashMap<String, String>();
-    this.httpClient = new HttpClient(manager);
-    HttpClientParams clientParams = httpClient.getParams();
-    clientParams.setVersion(HttpVersion.HTTP_1_1);
-  }
-
-  /**
-   * Shut down the client. Close any open persistent connections. 
-   */
-  public void shutdown() {
-    MultiThreadedHttpConnectionManager manager = 
-      (MultiThreadedHttpConnectionManager) httpClient.getHttpConnectionManager();
-    manager.shutdown();
-  }
-
-  /**
-   * @return the wrapped HttpClient
-   */
-  public HttpClient getHttpClient() {
-    return httpClient;
-  }
-
-  /**
-   * Add extra headers.  These extra headers will be applied to all http
-   * methods before they are removed. If any header is not used any more,
-   * client needs to remove it explicitly.
-   */
-  public void addExtraHeader(final String name, final String value) {
-    extraHeaders.put(name, value);
-  }
-
-  /**
-   * Get an extra header value.
-   */
-  public String getExtraHeader(final String name) {
-    return extraHeaders.get(name);
-  }
-
-  /**
-   * Get all extra headers (read-only).
-   */
-  public Map<String, String> getExtraHeaders() {
-    return Collections.unmodifiableMap(extraHeaders);
-  }
-
-  /**
-   * Remove an extra header.
-   */
-  public void removeExtraHeader(final String name) {
-    extraHeaders.remove(name);
-  }
-
-  /**
-   * Execute a transaction method given only the path. Will select at random
-   * one of the members of the supplied cluster definition and iterate through
-   * the list until a transaction can be successfully completed. The
-   * definition of success here is a complete HTTP transaction, irrespective
-   * of result code.  
-   * @param cluster the cluster definition
-   * @param method the transaction method
-   * @param headers HTTP header values to send
-   * @param path the properly urlencoded path
-   * @return the HTTP response code
-   * @throws IOException
-   */
-  public int executePathOnly(Cluster cluster, HttpMethod method,
-      Header[] headers, String path) throws IOException {
-    IOException lastException;
-    if (cluster.nodes.size() < 1) {
-      throw new IOException("Cluster is empty");
-    }
-    int start = (int)Math.round((cluster.nodes.size() - 1) * Math.random());
-    int i = start;
-    do {
-      cluster.lastHost = cluster.nodes.get(i);
-      try {
-        StringBuilder sb = new StringBuilder();
-        sb.append("http://");
-        sb.append(cluster.lastHost);
-        sb.append(path);
-        URI uri = new URI(sb.toString(), true);
-        return executeURI(method, headers, uri.toString());
-      } catch (IOException e) {
-        lastException = e;
-      }
-    } while (++i != start && i < cluster.nodes.size());
-    throw lastException;
-  }
-
-  /**
-   * Execute a transaction method given a complete URI.
-   * @param method the transaction method
-   * @param headers HTTP header values to send
-   * @param uri a properly urlencoded URI
-   * @return the HTTP response code
-   * @throws IOException
-   */
-  public int executeURI(HttpMethod method, Header[] headers, String uri)
-      throws IOException {
-    method.setURI(new URI(uri, true));
-    for (Map.Entry<String, String> e: extraHeaders.entrySet()) {
-      method.addRequestHeader(e.getKey(), e.getValue());
-    }
-    if (headers != null) {
-      for (Header header: headers) {
-        method.addRequestHeader(header);
-      }
-    }
-    long startTime = System.currentTimeMillis();
-    int code = httpClient.executeMethod(method);
-    long endTime = System.currentTimeMillis();
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(method.getName() + " " + uri + " " + code + " " +
-        method.getStatusText() + " in " + (endTime - startTime) + " ms");
-    }
-    return code;
-  }
-
-  /**
-   * Execute a transaction method. Will call either <tt>executePathOnly</tt>
-   * or <tt>executeURI</tt> depending on whether a path only is supplied in
-   * 'path', or if a complete URI is passed instead, respectively.
-   * @param cluster the cluster definition
-   * @param method the HTTP method
-   * @param headers HTTP header values to send
-   * @param path the properly urlencoded path or URI
-   * @return the HTTP response code
-   * @throws IOException
-   */
-  public int execute(Cluster cluster, HttpMethod method, Header[] headers,
-      String path) throws IOException {
-    if (path.startsWith("/")) {
-      return executePathOnly(cluster, method, headers, path);
-    }
-    return executeURI(method, headers, path);
-  }
-
-  /**
-   * @return the cluster definition
-   */
-  public Cluster getCluster() {
-    return cluster;
-  }
-
-  /**
-   * @param cluster the cluster definition
-   */
-  public void setCluster(Cluster cluster) {
-    this.cluster = cluster;
-  }
-
-  /**
-   * Send a HEAD request 
-   * @param path the path or URI
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response head(String path) throws IOException {
-    return head(cluster, path, null);
-  }
-
-  /**
-   * Send a HEAD request 
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param headers the HTTP headers to include in the request
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response head(Cluster cluster, String path, Header[] headers) 
-      throws IOException {
-    HeadMethod method = new HeadMethod();
-    try {
-      int code = execute(cluster, method, null, path);
-      headers = method.getResponseHeaders();
-      return new Response(code, headers, null);
-    } finally {
-      method.releaseConnection();
-    }
-  }
-
-  /**
-   * Send a GET request 
-   * @param path the path or URI
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(String path) throws IOException {
-    return get(cluster, path);
-  }
-
-  /**
-   * Send a GET request 
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(Cluster cluster, String path) throws IOException {
-    return get(cluster, path, EMPTY_HEADER_ARRAY);
-  }
-
-  /**
-   * Send a GET request 
-   * @param path the path or URI
-   * @param accept Accept header value
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(String path, String accept) throws IOException {
-    return get(cluster, path, accept);
-  }
-
-  /**
-   * Send a GET request 
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param accept Accept header value
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(Cluster cluster, String path, String accept)
-      throws IOException {
-    Header[] headers = new Header[1];
-    headers[0] = new Header("Accept", accept);
-    return get(cluster, path, headers);
-  }
-
-  /**
-   * Send a GET request
-   * @param path the path or URI
-   * @param headers the HTTP headers to include in the request, 
-   * <tt>Accept</tt> must be supplied
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(String path, Header[] headers) throws IOException {
-    return get(cluster, path, headers);
-  }
-
-  /**
-   * Send a GET request
-   * @param c the cluster definition
-   * @param path the path or URI
-   * @param headers the HTTP headers to include in the request
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response get(Cluster c, String path, Header[] headers) 
-      throws IOException {
-    GetMethod method = new GetMethod();
-    try {
-      int code = execute(c, method, headers, path);
-      headers = method.getResponseHeaders();
-      byte[] body = method.getResponseBody();
-      return new Response(code, headers, body);
-    } finally {
-      method.releaseConnection();
-    }
-  }
-
-  /**
-   * Send a PUT request
-   * @param path the path or URI
-   * @param contentType the content MIME type
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response put(String path, String contentType, byte[] content)
-      throws IOException {
-    return put(cluster, path, contentType, content);
-  }
-
-  /**
-   * Send a PUT request
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param contentType the content MIME type
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response put(Cluster cluster, String path, String contentType, 
-      byte[] content) throws IOException {
-    Header[] headers = new Header[1];
-    headers[0] = new Header("Content-Type", contentType);
-    return put(cluster, path, headers, content);
-  }
-
-  /**
-   * Send a PUT request
-   * @param path the path or URI
-   * @param headers the HTTP headers to include, <tt>Content-Type</tt> must be
-   * supplied
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response put(String path, Header[] headers, byte[] content) 
-      throws IOException {
-    return put(cluster, path, headers, content);
-  }
-
-  /**
-   * Send a PUT request
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param headers the HTTP headers to include, <tt>Content-Type</tt> must be
-   * supplied
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response put(Cluster cluster, String path, Header[] headers, 
-      byte[] content) throws IOException {
-    PutMethod method = new PutMethod();
-    try {
-      method.setRequestEntity(new ByteArrayRequestEntity(content));
-      int code = execute(cluster, method, headers, path);
-      headers = method.getResponseHeaders();
-      content = method.getResponseBody();
-      return new Response(code, headers, content);
-    } finally {
-      method.releaseConnection();
-    }
-  }
-
-  /**
-   * Send a POST request
-   * @param path the path or URI
-   * @param contentType the content MIME type
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response post(String path, String contentType, byte[] content)
-      throws IOException {
-    return post(cluster, path, contentType, content);
-  }
-
-  /**
-   * Send a POST request
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param contentType the content MIME type
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response post(Cluster cluster, String path, String contentType, 
-      byte[] content) throws IOException {
-    Header[] headers = new Header[1];
-    headers[0] = new Header("Content-Type", contentType);
-    return post(cluster, path, headers, content);
-  }
-
-  /**
-   * Send a POST request
-   * @param path the path or URI
-   * @param headers the HTTP headers to include, <tt>Content-Type</tt> must be
-   * supplied
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response post(String path, Header[] headers, byte[] content) 
-      throws IOException {
-    return post(cluster, path, headers, content);
-  }
-
-  /**
-   * Send a POST request
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @param headers the HTTP headers to include, <tt>Content-Type</tt> must be
-   * supplied
-   * @param content the content bytes
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response post(Cluster cluster, String path, Header[] headers, 
-      byte[] content) throws IOException {
-    PostMethod method = new PostMethod();
-    try {
-      method.setRequestEntity(new ByteArrayRequestEntity(content));
-      int code = execute(cluster, method, headers, path);
-      headers = method.getResponseHeaders();
-      content = method.getResponseBody();
-      return new Response(code, headers, content);
-    } finally {
-      method.releaseConnection();
-    }
-  }
-
-  /**
-   * Send a DELETE request
-   * @param path the path or URI
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response delete(String path) throws IOException {
-    return delete(cluster, path);
-  }
-
-  /**
-   * Send a DELETE request
-   * @param cluster the cluster definition
-   * @param path the path or URI
-   * @return a Response object with response detail
-   * @throws IOException
-   */
-  public Response delete(Cluster cluster, String path) throws IOException {
-    DeleteMethod method = new DeleteMethod();
-    try {
-      int code = execute(cluster, method, null, path);
-      Header[] headers = method.getResponseHeaders();
-      byte[] content = method.getResponseBody();
-      return new Response(code, headers, content);
-    } finally {
-      method.releaseConnection();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/client/Cluster.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/client/Cluster.java b/dcs/src/main/java/org/trafodion/dcs/rest/client/Cluster.java
deleted file mode 100644
index 51721d6..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/client/Cluster.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-
-package org.trafodion.dcs.rest.client;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * A list of 'host:port' addresses of HTTP servers operating as a single
- * entity, for example multiple redundant web service gateways.
- */
-public class Cluster {
-  protected List<String> nodes = 
-    Collections.synchronizedList(new ArrayList<String>());
-  protected String lastHost;
-
-  /**
-   * Constructor
-   */
-  public Cluster() {}
-
-  /**
-   * Constructor
-   * @param nodes a list of service locations, in 'host:port' format
-   */
-  public Cluster(List<String> nodes) {
-    nodes.addAll(nodes);
-  }
-
-  /**
-   * @return true if no locations have been added, false otherwise
-   */
-  public boolean isEmpty() {
-    return nodes.isEmpty();
-  }
-
-  /**
-   * Add a node to the cluster
-   * @param node the service location in 'host:port' format
-   */
-  public Cluster add(String node) {
-    nodes.add(node);
-    return this;
-  }
-
-  /**
-   * Add a node to the cluster
-   * @param name host name
-   * @param port service port
-   */
-  public Cluster add(String name, int port) {
-    StringBuilder sb = new StringBuilder();
-    sb.append(name);
-    sb.append(':');
-    sb.append(port);
-    return add(sb.toString());
-  }
-
-  /**
-   * Remove a node from the cluster
-   * @param node the service location in 'host:port' format
-   */
-  public Cluster remove(String node) {
-    nodes.remove(node);
-    return this;
-  }
-
-  /**
-   * Remove a node from the cluster
-   * @param name host name
-   * @param port service port
-   */
-  public Cluster remove(String name, int port) {
-    StringBuilder sb = new StringBuilder();
-    sb.append(name);
-    sb.append(':');
-    sb.append(port);
-    return remove(sb.toString());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/client/Response.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/client/Response.java b/dcs/src/main/java/org/trafodion/dcs/rest/client/Response.java
deleted file mode 100644
index 025eb2f..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/client/Response.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-
-package org.trafodion.dcs.rest.client;
-
-import org.apache.commons.httpclient.Header;
-
-/**
- * The HTTP result code, response headers, and body of a HTTP response.
- */
-public class Response {
-  private int code;
-  private Header[] headers;
-  private byte[] body;
-
-  /**
-   * Constructor
-   * @param code the HTTP response code
-   */
-  public Response(int code) {
-    this(code, null, null);
-  }
-
-  /**
-   * Constructor
-   * @param code the HTTP response code
-   * @param headers the HTTP response headers
-   */
-  public Response(int code, Header[] headers) {
-    this(code, headers, null);
-  }
-
-  /**
-   * Constructor
-   * @param code the HTTP response code
-   * @param headers the HTTP response headers
-   * @param body the response body, can be null
-   */
-  public Response(int code, Header[] headers, byte[] body) {
-    this.code = code;
-    this.headers = headers;
-    this.body = body;
-  }
-
-  /**
-   * @return the HTTP response code
-   */
-  public int getCode() {
-    return code;
-  }
-
-  /**
-   * @return the HTTP response headers
-   */
-  public Header[] getHeaders() {
-    return headers;
-  }
-
-  public String getHeader(String key) {
-    for (Header header: headers) {
-      if (header.getName().equalsIgnoreCase(key)) {
-        return header.getValue();
-      }
-    }
-    return null;
-  }
-
-  /**
-   * @return the value of the Location header
-   */
-  public String getLocation() {
-    return getHeader("Location");
-  }
-
-  /**
-   * @return true if a response body was sent
-   */
-  public boolean hasBody() {
-    return body != null;
-  }
-
-  /**
-   * @return the HTTP response body
-   */
-  public byte[] getBody() {
-    return body;
-  }
-
-  /**
-   * @param code the HTTP response code
-   */
-  public void setCode(int code) {
-    this.code = code;
-  }
-
-  /**
-   * @param headers the HTTP response headers
-   */
-  public void setHeaders(Header[] headers) {
-    this.headers = headers;
-  }
-
-  /**
-   * @param body the response body
-   */
-  public void setBody(byte[] body) {
-    this.body = body;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/model/ServerModel.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/model/ServerModel.java b/dcs/src/main/java/org/trafodion/dcs/rest/model/ServerModel.java
deleted file mode 100644
index e254eca..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/model/ServerModel.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Scanner;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Simple representation of an DCS instance.
- */
-@XmlRootElement(name = "DcsStatus")
-public class ServerModel implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Represents a DcsMaster server.
-     */
-    public static class DcsMaster {
-        private String hostName;
-        private String listenerPort;
-        private String listenerPortRange;
-        private String startTimestamp;
-        private List<DcsServer> dcsServerList = new ArrayList<DcsServer>();
-
-        /**
-         * Default constructor
-         */
-        public DcsMaster() {
-        }
-
-        /**
-         * Constructor
-         * 
-         * @param hostName
-         *            the host name
-         * @param listenerPort
-         *            the port its listening on
-         * @param listenerPortRange
-         *            the listener port range
-         * @param startTimestamp
-         *            the start timestamp
-         */
-        public DcsMaster(String hostName, String listenerPort,
-                String listenerPortRange, String startTimestamp) {
-            this.hostName = hostName;
-            this.listenerPort = listenerPort;
-            this.listenerPortRange = listenerPortRange;
-            this.startTimestamp = startTimestamp;
-        }
-
-        /**
-         * @return the host name
-         */
-        @XmlAttribute
-        public String getHostName() {
-            return hostName;
-        }
-
-        /**
-         * @return the listener port number
-         */
-        @XmlAttribute
-        public String getListenerPort() {
-            return listenerPort;
-        }
-
-        /**
-         * @return the listener port range
-         */
-        @XmlAttribute
-        public String getListenerPortRange() {
-            return listenerPortRange;
-        }
-
-        /**
-         * @return the start time
-         */
-        @XmlAttribute
-        public String getStartTimestamp() {
-            return startTimestamp;
-        }
-
-        /**
-         * Add a DcsServer to the list
-         * 
-         * @param znode
-         *            the znode name
-         */
-        public DcsServer addDcsServer(String znode, String data) {
-            Scanner scn = new Scanner(znode);
-            scn.useDelimiter(":");
-            String hostName = scn.next();// host name
-            String instance = scn.next();// instance
-            String infoPort = scn.next();// info port
-            String startTimestamp = scn.next();
-            scn.close();
-            ServerModel.DcsServer dcsServer = new ServerModel.DcsServer(
-                    hostName, instance, infoPort, startTimestamp);
-            dcsServerList.add(dcsServer);
-            return dcsServer;
-        }
-
-        /**
-         * @param index
-         *            the index
-         * @return the DcsServer name
-         */
-        public DcsServer getDcsServer(int index) {
-            return dcsServerList.get(index);
-        }
-
-        /**
-         * @return the list of DcsServer
-         */
-        @XmlElement(name = "DcsServer")
-        public List<DcsServer> getDcsServer() {
-            return dcsServerList;
-        }
-    }
-
-    /**
-     * Represents a DcsServer server.
-     */
-    public static class DcsServer {
-        // from znode, no data
-        private String hostName;
-        private String instance;
-        private String infoPort;
-        private String startTimestamp;
-        private List<TrafodionServer> trafServerList = new ArrayList<TrafodionServer>();
-
-        /**
-         * Default constructor
-         */
-        public DcsServer() {
-        }
-
-        /**
-         * Constructor
-         * 
-         * @param hostName
-         *            the host name
-         * @param instance
-         *            the instance number
-         * @param infoPort
-         *            the port
-         * @param startTimestamp
-         *            the start timestamp
-         */
-        public DcsServer(String hostName, String instance, String infoPort,
-                String startTimestamp) {
-            this.hostName = hostName;
-            this.instance = instance;
-            this.infoPort = infoPort;
-            this.startTimestamp = startTimestamp;
-        }
-
-        /**
-         * @return the host name
-         */
-        @XmlAttribute
-        public String getHostName() {
-            return hostName;
-        }
-
-        /**
-         * @return the instance number
-         */
-        @XmlAttribute
-        public String getInstance() {
-            return instance;
-        }
-
-        /**
-         * @return the listener port range
-         */
-        @XmlAttribute
-        public String getInfoPort() {
-            return infoPort;
-        }
-
-        /**
-         * @return the start timestamp
-         */
-        @XmlAttribute
-        public String getStartTimestamp() {
-            return startTimestamp;
-        }
-
-        /**
-         * Add a TrafodionServer to the list
-         * 
-         * @param znode
-         *            the znode name
-         * @param data
-         *            the data
-         */
-        public void addTrafodionServer(String znode, String data) {
-            Scanner scn = new Scanner(znode);
-            scn.useDelimiter(":");
-            String hostName = scn.next();// host name
-            String instance = scn.next();// DcsServer's instance ID
-            String trafInstance = scn.next();// Traf server's instance ID
-            scn.close();
-            scn = new Scanner(data);
-            scn.useDelimiter(":");
-            String state = scn.next();// state
-            String timestamp = scn.next();// last updated timestamp
-            String dialogueId = scn.next();// dialogue id
-            String nid = scn.next();// node id
-            String pid = scn.next();// process id
-            String processName = scn.next();// process name
-            String ipAddress = scn.next();// server ip address
-            String port = scn.next();// server port
-            String clientHostName = scn.next();// client host name
-            String clientIpAddress = scn.next();// client ip address
-            String clientPort = scn.next();// client port
-            String clientAppl = scn.next();// client application name
-            scn.close();
-
-            if (this.hostName.equalsIgnoreCase(hostName)
-                    && this.instance.equalsIgnoreCase(instance))
-                trafServerList.add(new ServerModel.TrafodionServer(hostName,
-                        instance, trafInstance, state, timestamp, dialogueId,
-                        nid, pid, processName, ipAddress, port, clientHostName,
-                        clientIpAddress, clientPort, clientAppl));
-        }
-
-        /**
-         * @param index
-         *            the index
-         * @return the TrafodionServer
-         */
-        public TrafodionServer getTrafodionServer(int index) {
-            return trafServerList.get(index);
-        }
-
-        /**
-         * @return the list of Trafodion servers
-         */
-        @XmlElement(name = "TrafodionServer")
-        public List<TrafodionServer> getTrafodionServer() {
-            return trafServerList;
-        }
-    }
-
-    /**
-     * Represents a TrafodionServer server.
-     */
-    public static class TrafodionServer {
-        // from znode
-        private String hostName;
-        private String dcsInstance;
-        private String instance;
-        // from data
-        private String state;
-        private String timestamp;
-        private String dialogueId;
-        private String nid;
-        private String pid;
-        private String processName;
-        private String ipAddress;
-        private String port;
-        private String clientHostName;
-        private String clientIpAddress;
-        private String clientPort;
-        private String clientAppl;
-
-        /**
-         * Default constructor
-         */
-        public TrafodionServer() {
-        }
-
-        /**
-         * Constructor
-         * 
-         * @param hostName
-         *            the host name
-         */
-        public TrafodionServer(String hostName, String dcsInstance,
-                String instance, String state, String timestamp,
-                String dialogueId, String nid, String pid, String processName,
-                String ipAddress, String port, String clientHostName,
-                String clientIpAddress, String clientPort, String clientAppl) {
-            this.hostName = hostName;
-            this.dcsInstance = dcsInstance;
-            this.instance = instance;
-            this.state = state;
-            this.timestamp = timestamp;
-            this.dialogueId = dialogueId;
-            this.nid = nid;
-            this.pid = pid;
-            this.processName = processName;
-            this.ipAddress = ipAddress;
-            this.port = port;
-            this.clientHostName = clientHostName;
-            this.clientIpAddress = clientIpAddress;
-            this.clientPort = clientPort;
-            this.clientAppl = clientAppl;
-        }
-
-        /**
-         * @return the server's host name
-         */
-        @XmlAttribute
-        public String getHostName() {
-            return hostName;
-        }
-
-        /**
-         * @return the DCS server's instance ID
-         */
-        @XmlAttribute
-        public String getDcsInstance() {
-            return dcsInstance;
-        }
-
-        /**
-         * @return the Trafodion server's instance number
-         */
-        @XmlAttribute
-        public String getInstance() {
-            return instance;
-        }
-
-        /**
-         * @return the server state
-         */
-        @XmlAttribute
-        public String getState() {
-            return state;
-        }
-
-        /**
-         * @return the server timestamp
-         */
-        @XmlAttribute
-        public String getTimestamp() {
-            return timestamp;
-        }
-
-        /**
-         * @return the dialogueId
-         */
-        @XmlAttribute
-        public String getDialogueId() {
-            return dialogueId;
-        }
-
-        /**
-         * @return the node Id
-         */
-        @XmlAttribute
-        public String getNid() {
-            return nid;
-        }
-
-        /**
-         * @return the process Id
-         */
-        @XmlAttribute
-        public String getPid() {
-            return pid;
-        }
-
-        /**
-         * @return the process name
-         */
-        @XmlAttribute
-        public String getProcessName() {
-            return processName;
-        }
-
-        /**
-         * @return the server's IP address
-         */
-        @XmlAttribute
-        public String getIpAddress() {
-            return ipAddress;
-        }
-
-        /**
-         * @return the server's port number
-         */
-        @XmlAttribute
-        public String getPort() {
-            return port;
-        }
-
-        /**
-         * @return the connected client's host name
-         */
-        @XmlAttribute
-        public String getClientHostName() {
-            return clientHostName;
-        }
-
-        /**
-         * @return the the connected client's IP address
-         */
-        @XmlAttribute
-        public String getClientIpAddress() {
-            return clientIpAddress;
-        }
-
-        /**
-         * @return the connected client's port number
-         */
-        @XmlAttribute
-        public String getClientPort() {
-            return clientPort;
-        }
-
-        /**
-         * @return the connected client's application name
-         */
-        @XmlAttribute
-        public String getClientAppl() {
-            return clientAppl;
-        }
-    }
-
-    /**
-     * Default constructor
-     */
-    public ServerModel() {
-    }
-
-    private DcsMaster dcsMaster = null;
-
-    /**
-     * Add a DcsMaster
-     * 
-     * @param znode
-     *            the znode
-     */
-    public DcsMaster addDcsMaster(String znode, String data) {
-        Scanner scn = new Scanner(znode);
-        scn.useDelimiter(":");
-        String hostName = scn.next();// host name
-        String listenerPort = scn.next();// listener port
-        String listenerPortRange = scn.next();
-        String startTimestamp = scn.next();
-        scn.close();
-        dcsMaster = new ServerModel.DcsMaster(hostName, listenerPort,
-                listenerPortRange, startTimestamp);
-        return dcsMaster;
-    }
-
-    /**
-     * @return the DCS Master server
-     */
-    @XmlElement(name = "DcsMaster")
-    public DcsMaster getDcsMaster() {
-        return dcsMaster;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        /*
-         * if (!dcsMaster.isEmpty()) { //sb.append(String.format(
-         * "%d DcsMaster server(s), %d DcsServer server(s)\n\n"
-         * ,dcsMaster.size(), dcsMaster.getDcsServer().size());
-         * //sb.append(liveNodes.size()); //sb.append(" live servers\n"); for
-         * (DcsMaster aServer: dcsMaster) { sb.append("    ");
-         * sb.append(node.name); sb.append(' '); sb.append(node.startCode);
-         * sb.append("\n        requests="); sb.append(node.requests);
-         * sb.append(", regions="); sb.append(node.regions.size());
-         * sb.append("\n        heapSizeMB="); sb.append(node.heapSizeMB);
-         * sb.append("\n        maxHeapSizeMB="); sb.append(node.maxHeapSizeMB);
-         * sb.append("\n\n"); for (Node.Region region: node.regions) {
-         * sb.append("        "); sb.append(Bytes.toString(region.name));
-         * sb.append("\n            stores="); sb.append(region.stores);
-         * sb.append("\n            storefiless=");
-         * sb.append(region.storefiles);
-         * sb.append("\n            storefileSizeMB=");
-         * sb.append(region.storefileSizeMB);
-         * sb.append("\n            memstoreSizeMB=");
-         * sb.append(region.memstoreSizeMB);
-         * sb.append("\n            storefileIndexSizeMB=");
-         * sb.append(region.storefileIndexSizeMB);
-         * sb.append("\n            readRequestsCount=");
-         * sb.append(region.readRequestsCount);
-         * sb.append("\n            writeRequestsCount=");
-         * sb.append(region.writeRequestsCount);
-         * sb.append("\n            rootIndexSizeKB=");
-         * sb.append(region.rootIndexSizeKB);
-         * sb.append("\n            totalStaticIndexSizeKB=");
-         * sb.append(region.totalStaticIndexSizeKB);
-         * sb.append("\n            totalStaticBloomSizeKB=");
-         * sb.append(region.totalStaticBloomSizeKB);
-         * sb.append("\n            totalCompactingKVs=");
-         * sb.append(region.totalCompactingKVs);
-         * sb.append("\n            currentCompactedKVs=");
-         * sb.append(region.currentCompactedKVs); sb.append('\n'); }
-         * sb.append('\n'); } }
-         */
-        return sb.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/model/VersionModel.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/model/VersionModel.java b/dcs/src/main/java/org/trafodion/dcs/rest/model/VersionModel.java
deleted file mode 100644
index 3d3bebe..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/model/VersionModel.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-/**
- * Copyright 2007 The Apache Software Foundation
- *
- * 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.
- */
-package org.trafodion.dcs.rest.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.servlet.ServletContext;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.trafodion.dcs.rest.RESTServlet;
-
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-
-/**
- * A representation of the collection of versions of the REST gateway software
- * components.
- * <ul>
- * <li>restVersion: REST gateway revision</li>
- * <li>jvmVersion: the JVM vendor and version information</li>
- * <li>osVersion: the OS type, version, and hardware architecture</li>
- * <li>serverVersion: the name and version of the servlet container</li>
- * <li>jerseyVersion: the version of the embedded Jersey framework</li>
- * </ul>
- */
-@XmlRootElement(name="Version")
-public class VersionModel implements Serializable {
-
-  private static final long serialVersionUID = 1L;
-
-  private String restVersion;
-  private String jvmVersion;
-  private String osVersion;
-  private String serverVersion;
-  private String jerseyVersion;
-
-  /**
-   * Default constructor. Do not use.
-   */
-  public VersionModel() {}
-  
-  /**
-   * Constructor
-   * @param context the servlet context
-   */
-	public VersionModel(ServletContext context) {
-	  restVersion = RESTServlet.VERSION_STRING;
-	  jvmVersion = System.getProperty("java.vm.vendor") + ' ' +
-      System.getProperty("java.version") + '-' +
-      System.getProperty("java.vm.version");
-	  osVersion = System.getProperty("os.name") + ' ' +
-      System.getProperty("os.version") + ' ' +
-      System.getProperty("os.arch");
-	  serverVersion = context.getServerInfo();
-	  jerseyVersion = ServletContainer.class.getPackage()
-      .getImplementationVersion();
-	}
-
-	/**
-	 * @return the REST gateway version
-	 */
-	@XmlAttribute(name="REST")
-	public String getRESTVersion() {
-    return restVersion;
-  }
-
-	/**
-	 * @return the JVM vendor and version
-	 */
-  @XmlAttribute(name="JVM")
-  public String getJVMVersion() {
-    return jvmVersion;
-  }
-
-  /**
-   * @return the OS name, version, and hardware architecture
-   */
-  @XmlAttribute(name="OS")
-  public String getOSVersion() {
-    return osVersion;
-  }
-
-  /**
-   * @return the servlet container version
-   */
-  @XmlAttribute(name="Server")
-  public String getServerVersion() {
-    return serverVersion;
-  }
-
-  /**
-   * @return the version of the embedded Jersey framework
-   */
-  @XmlAttribute(name="Jersey")
-  public String getJerseyVersion() {
-    return jerseyVersion;
-  }
-
-  /**
-   * @param version the REST gateway version string
-   */
-  public void setRESTVersion(String version) {
-    this.restVersion = version;
-  }
-
-  /**
-   * @param version the OS version string
-   */
-  public void setOSVersion(String version) {
-    this.osVersion = version;
-  }
-
-  /**
-   * @param version the JVM version string
-   */
-  public void setJVMVersion(String version) {
-    this.jvmVersion = version;
-  }
-
-  /**
-   * @param version the servlet container version string
-   */
-  public void setServerVersion(String version) {
-    this.serverVersion = version;
-  }
-
-  /**
-   * @param version the Jersey framework version string
-   */
-  public void setJerseyVersion(String version) {
-    this.jerseyVersion = version;
-  }
-
-  /* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-	  StringBuilder sb = new StringBuilder();
-	  sb.append("rest ");
-	  sb.append(restVersion);
-	  sb.append(" [JVM: ");
-	  sb.append(jvmVersion);
-	  sb.append("] [OS: ");
-	  sb.append(osVersion);
-	  sb.append("] [Server: ");
-	  sb.append(serverVersion);
-	  sb.append("] [Jersey: ");
-    sb.append(jerseyVersion);
-	  sb.append("]\n");
-	  return sb.toString();
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadListModel.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadListModel.java b/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadListModel.java
deleted file mode 100644
index 9aecf14..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadListModel.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-package org.trafodion.dcs.rest.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hadoop.conf.Configuration;
-import org.trafodion.dcs.util.DcsConfiguration;
-import org.trafodion.dcs.Constants;
-
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
-* @@@ 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 @@@
- */
-@XmlRootElement(name="Workloads")
-public class WorkloadListModel {
-	private static final long serialVersionUID = 1L;
-	private List<WorkloadModel> workloads = new ArrayList<WorkloadModel>();
-	private static int refreshSeconds;
-	/**
-	 * Default constructor
-	 */
-	public WorkloadListModel() {
-		Configuration conf = DcsConfiguration.create();
-		refreshSeconds = conf.getInt("dcs.rest.refresh.seconds",5);
-	}
-
-	/**
-	 * Add the workload to the list
-	 * @param workload the workload model
-	 */
-	public void add(WorkloadModel workload) {
-		workloads.add(workload);
-	}
-	
-	/**
-	 * @param index the index
-	 * @return the workload model
-	 */
-	public WorkloadModel get(int index) {
-		return workloads.get(index);
-	}
-
-	/**
-	 * @return the workloads
-	 */
-	public List<WorkloadModel> getWorkloads() {
-		return workloads;
-	}
-
-	/**
-	 * @param workloads the list of workloads
-	 */
-	public void setWorkloads(List<WorkloadModel> workloads) {
-		this.workloads = workloads;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		/*
-		sb.append("<html>\n");
-		sb.append("<head>\n");
-		sb.append("<title>DCS (Data Connectivity Services)</title>\n");
-		if(refreshSeconds > 0)
-			sb.append("<meta http-equiv=\"refresh\" content=\"5\">\n");
-		sb.append("</head>\n");
-		sb.append("<body>\n");
-		//
-		sb.append("<table border=\"1\">\n");
-		sb.append("<tr>\n");	
-		sb.append("<th>Type</th>\n");
-		sb.append("<th>Znode</th>\n");
-		sb.append("<th>Data</th>\n");		
-		sb.append("</tr>\n");
-
-		for(WorkloadModel aWorkload : workloads) {
-			sb.append(aWorkload.toString());
-			sb.append('\n');
-		}
-
-		sb.append("</table>\n");
-		sb.append("</body>\n");
-		sb.append("</html>\n");
-		*/
-		
-		
-		sb.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
-		sb.append("<html>\n");
-		sb.append("<head>\n");
-		sb.append("<meta http-equiv=\"Content-Type\" content=\"text/html\"; charset=ISO-8859-1\">\n");
-		sb.append("<title>(DCS) Data Connectivity Services</title>\n");
-		sb.append("<style type=\"text/css\">\n"); 
-		sb.append("  * { padding: 0; margin: 0; }\n");
-		sb.append("  table.dcs {\n"); 
-		sb.append("    font-family: verdana, arial, helvetica, sans-serif;\n");
-		sb.append("    font-size: 11px;\n");
-		sb.append("    cellspacing: 0;\n");
-		sb.append("    border-collapse: collapse;\n"); 
-		sb.append("    width: 535px;\n");    
-		sb.append("    }\n");
-		sb.append("  table.dcs td {\n"); 
-		sb.append("    border-left: 1px solid #999;\n"); 
-		sb.append("    border-top: 1px solid #999;\n"); 
-		sb.append("    padding: 2px 4px;\n");
-		sb.append("    }\n");
-		sb.append("  table.dcs tr:first-child td {\n");
-		sb.append("    border-top: none;\n");
-		sb.append("  }\n");
-		sb.append("  table.dcs th { \n");
-		sb.append("    border-left: 1px solid #999;\n");
-		sb.append("    padding: 2px 4px;\n");
-		sb.append("    background: #6b6164;\n");
-		sb.append("    color: white;\n");
-		sb.append("    font-variant: small-caps;\n");
-	    sb.append("    }\n");
-		sb.append("  table.dcs td { background: #eee; overflow: hidden; }\n");
-		  
-		sb.append("  div.scrollableContainer {\n"); 
-		sb.append("    position: relative;\n"); 
-		sb.append("    width: 750px;\n"); 
-		sb.append("    padding-top: 2em;\n"); 
-		sb.append("    margin: 40px;\n");    
-		sb.append("    border: 1px solid #999;\n");
-		sb.append("    background: #6b6164;\n");
-		sb.append("    }\n");
-		sb.append("  div.scrollingArea {\n"); 
-		sb.append("    height: 240px;\n"); 
-		sb.append("    overflow: auto;\n"); 
-		sb.append("    }\n");
-		 
-		sb.append("  table.scrollable thead tr {\n");
-		sb.append("    left: -1px; top: 0;\n");
-		sb.append("    position: absolute;\n");
-		sb.append("    }\n");
-		 
-		sb.append("  table.dcs .type  div { width: 100px; }\n");
-		sb.append("  table.dcs .znode div { width: 100px; }\n");
-		sb.append("  table.dcs .data  div { width: 100px; }\n");
-		 
-		sb.append("</style>\n");
-		sb.append("</head>\n");
-		sb.append("<body>\n");
-		 
-		sb.append("<div class=\"scrollableContainer\">\n");
-		  sb.append("<div class=\"scrollingArea\">\n");
-		  	sb.append("<table class=\"dcs scrollable\">\n");
-		  	  sb.append("<thead>\n");
-		  			sb.append("<tr>\n");
-		  	      sb.append("<th><div class=\"type\">Type</div></th>\n");
-		  	      sb.append("<th><div class=\"znode\">Znode</div></th>\n");
-		  	      sb.append("<th><div class=\"data\">Data</div></th>\n");
-		  			        sb.append("</tr>\n");
-		  		    sb.append("</thead>\n");
-		  		    sb.append("<tbody>\n");
-		  		  
-		  		for(WorkloadModel aWorkload : workloads) {
-		  			sb.append("<tr>\n");
-		  			sb.append(aWorkload.toString());
-		  			sb.append("</tr>\n");
-		  		  }
-
-		            sb.append("</tbody>\n");
-		  	sb.append("</table>\n");
-			sb.append("</div>\n");
-		sb.append("</div>\n");
-		sb.append("<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js\"></script>\n");
-		sb.append("<script type=\"text/javascript\">\n"); 
-		  sb.append("$(document).ready(function() {\n");
-		    sb.append("$(\".scrollingArea\").height( $(window).height()-100 );\n");
-		    sb.append("$(window).resize(function() { $(\".scrollingArea\").height( $(window).height()-100 ); } );\n");
-		  sb.append("});\n");
-		sb.append("</script>\n");
-		sb.append("</body>\n");
-		sb.append("</html>\n");
-		return sb.toString();
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadModel.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadModel.java b/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadModel.java
deleted file mode 100644
index 1f67edc..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/model/WorkloadModel.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-package org.trafodion.dcs.rest.model;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.text.DateFormat;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
-* @@@ 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 @@@
- */
-@XmlRootElement(name="workload")
-public class WorkloadModel implements Serializable {
-	private static final long serialVersionUID = 1L;
-	
-	private String type;
-	private String znode;
-	private String data;
-
-	/**
-	 * Default constructor
-	 */
-	public WorkloadModel() {}
-
-	/**
-	 * Constructor
-	 * @param type
-	 * @param znode
-	 * @param data
-	 */
-	public WorkloadModel(String type,String znode,String data) {
-		super();
-		this.type = type;
-		this.znode = znode;
-		this.data = data;
-	}
-	
-	/**
-	 * @return the type
-	 */
-	@XmlAttribute
-	public String getType() {
-		return type;
-	}
-
-	/**
-	 * @param value the type to set
-	 */
-	public void setType(String value) {
-		this.type = value;
-	}
-	
-	/**
-	 * @return the znode
-	 */
-	@XmlAttribute
-	public String getZnode() {
-		return znode;
-	}
-
-	/**
-	 * @param value the znode to set
-	 */
-	public void setZnode(String value) {
-		this.znode = value;
-	}
-	
-	/**
-	 * @return the data
-	 */
-	@XmlAttribute
-	public String getData() {
-		return data;
-	}
-
-	/**
-	 * @param value the value to set
-	 */
-	public void setData(String value) {
-		this.data = value;
-	}
-
-    @Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		/*
-		sb.append("<td>" + type + "</td>\n");
-		sb.append("<td>" + znode + "</td>\n");
-		sb.append("<td>" + data + "</td>\n");
-		sb.append("</tr>\n");
-		*/
-		sb.append("<td><div class=\"type\">" + type + "</div></td>\n");  
-		sb.append("<td><div class=\"znode\">" + znode + "</div></td>\n");
-		sb.append("<td><div class=\"data\">" + data + "</div></td>\n"); 
-		return sb.toString();
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/provider/JAXBContextResolver.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/provider/JAXBContextResolver.java b/dcs/src/main/java/org/trafodion/dcs/rest/provider/JAXBContextResolver.java
deleted file mode 100644
index aa3b965..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/provider/JAXBContextResolver.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-package org.trafodion.dcs.rest.provider;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBContext;
-
-import org.trafodion.dcs.rest.model.ServerModel;
-import org.trafodion.dcs.rest.model.VersionModel;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONJAXBContext;
-
-/**
-* @@@ 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 @@@
- */
-@Provider
-public class JAXBContextResolver implements ContextResolver<JAXBContext> {
-
-	private final JAXBContext context;
-
-	private final Set<Class<?>> types;
-
-	private final Class<?>[] cTypes = {
-      ServerModel.class,
- 	  VersionModel.class
-	};
-
-	@SuppressWarnings("unchecked")
-  public JAXBContextResolver() throws Exception {
-		this.types = new HashSet<Class<?>>(Arrays.asList(cTypes));
-		this.context = new JSONJAXBContext(JSONConfiguration.natural().build(),
-		  cTypes);
-	}
-
-	@Override
-	public JAXBContext getContext(Class<?> objectType) {
-		return (types.contains(objectType)) ? context : null;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/provider/producer/PlainTextMessageBodyProducer.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/provider/producer/PlainTextMessageBodyProducer.java b/dcs/src/main/java/org/trafodion/dcs/rest/provider/producer/PlainTextMessageBodyProducer.java
deleted file mode 100644
index 5cf1431..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/provider/producer/PlainTextMessageBodyProducer.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-
-package org.trafodion.dcs.rest.provider.producer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-
-import org.trafodion.dcs.rest.RestConstants;
-
-/**
-* @@@ 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 @@@
- */
-@Provider
-@Produces(RestConstants.MIMETYPE_TEXT)
-public class PlainTextMessageBodyProducer 
-  implements MessageBodyWriter<Object> {
-
-  private ThreadLocal<byte[]> buffer = new ThreadLocal<byte[]>();
-
-  @Override
-  public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2,
-      MediaType arg3) {
-    return true;
-  }
-
-	@Override
-	public long getSize(Object object, Class<?> type, Type genericType,
-			Annotation[] annotations, MediaType mediaType) {
-    byte[] bytes = object.toString().getBytes(); 
-	  buffer.set(bytes);
-    return bytes.length;
-	}
-
-	@Override
-	public void writeTo(Object object, Class<?> type, Type genericType,
-			Annotation[] annotations, MediaType mediaType,
-			MultivaluedMap<String, Object> httpHeaders, OutputStream outStream)
-			throws IOException, WebApplicationException {
-    byte[] bytes = buffer.get();
-		outStream.write(bytes);
-    buffer.remove();
-	}	
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.html
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.html b/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.html
deleted file mode 100644
index 76545ae..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!-- @@@ 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 @@@                                                           -->
-<head>
-	<link type="text/css" href="datatables/css/jquery.dataTables_themeroller.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_page.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_table_jui.css" rel="stylesheet" />
-	<link type="text/css" href="jquery-ui/jquery-ui.css" rel="stylesheet" />	
-	<script type="text/javascript" src="js/lib/jquery-1.11.0.js"></script>
-	<script type="text/javascript" src="datatables/js/jquery.dataTables.js"></script>
-	
-</head>
-
-	<div id="progress">
-	<p><span style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 18px;">Fetching repository data ...</p>
-	<img src="img/ajax-loader.gif"/>
-	</div>
-	<div id="aggr-query-stats"></div>
-
-<script type="text/javascript">
-$(document).ready(function(){
-	document.body.style.cursor = 'wait';
-    $('#aggr-query-stats').html('').css('color','black');
-    var jqxhr = $.getJSON('aggr_querystats.jsp',function(result){
-    	
-    var keys;
-    $.each(result, function(i, data){
-      keys = Object.keys(data);
-	});
-    
-    var sb = '<table class="display1" id="aggr-query-stats-table" style="font-size:small"><thead><tr>';
-    for (var r=0,len=keys.length; r<len; r++) {
-      sb += '<th><b></b>' + keys[r] + '</th>';
-    }
-    sb += '</tr></thead><tbody> </tbody></table>';
-    $('#aggr-query-stats').html( sb );
-    
-	var aoColumns = [];
-	var aaData = [];
-	
-	$.each(result, function(i, data){
-	var rowData = [];
-	  $.each(keys, function(k, v) {
-	    rowData.push(data[v]);
-	  });
-	  aaData.push(rowData);
-	});
-
-	// add needed columns
-	$.each(keys, function(k, v) {
-		obj = new Object();
-		obj.sTitle = v;
-		aoColumns.push(obj);
-	});
-	
-	 $('#aggr-query-stats-table').dataTable({"bProcessing": true,"bJQueryUI": true,"sPaginationType": "full_numbers","aaData": aaData, "aoColumns" : aoColumns });
-	 
-		var elem = document.getElementById('progress');
-		elem.parentNode.removeChild(elem);
-		document.body.style.cursor = 'default';
-	
-    });
-	
-	jqxhr.fail(function(){
-		$('#aggr-query-stats').html( jqxhr.responseText ).css('color','red');
-		var elem = document.getElementById('progress');
-		elem.parentNode.removeChild(elem);
-		document.body.style.cursor = 'default';
-	});
-  });
-</script>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.jsp
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.jsp b/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.jsp
deleted file mode 100644
index ff80698..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/aggr_querystats.jsp
+++ /dev/null
@@ -1,85 +0,0 @@
-<%--
-/**
- * @@@ 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 @@@     
- */
---%>
-<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
-<%@ page contentType="text/html;charset=UTF-8"
-  import="java.io.*"
-  import="java.util.*"
-  import="java.sql.*"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.trafodion.dcs.master.DcsMaster"
-  import="org.trafodion.dcs.util.DcsConfiguration"
-  import="org.trafodion.dcs.Constants"
-  import="org.trafodion.dcs.util.Bytes"
-  import="org.trafodion.dcs.util.JdbcT4Util"
-  import="org.codehaus.jettison.json.JSONArray"
-  import="org.codehaus.jettison.json.JSONException"
-  import="org.codehaus.jettison.json.JSONObject"
- %>
-<% 
-  java.sql.Connection connection = null;
-  java.sql.Statement stmt = null;
-  java.sql.ResultSet rs = null;
-  
-  try {
-      DcsMaster master = (DcsMaster)getServletContext().getAttribute(DcsMaster.MASTER);
-      Configuration conf = master.getConfiguration();
-      boolean readOnly = conf.getBoolean("dcs.master.ui.readonly", false);
-      String masterServerName = master.getServerName();
-      int masterInfoPort = master.getInfoPort();
-      String trafodionHome = master.getTrafodionHome();
-      boolean trafodionLogs = conf.getBoolean(Constants.DCS_MASTER_TRAFODION_LOGS, Constants.DEFAULT_DCS_MASTER_TRAFODION_LOGS);
-      String queryText = conf.get(Constants.TRAFODION_REPOS_METRIC_QUERY_AGGR_TABLE_QUERY,Constants.DEFAULT_TRAFODION_REPOS_METRIC_QUERY_AGGR_TABLE_QUERY);
-      JSONArray metricQueryAggrJson = null;
-      JdbcT4Util jdbcT4Util = master.getServerManager().getJdbcT4Util();
-      connection = jdbcT4Util.getConnection();
-      stmt = connection.createStatement();
-      rs = stmt.executeQuery(queryText);
-      metricQueryAggrJson = jdbcT4Util.convertResultSetToJSON(rs);
-      response.setContentType("application/json");
-      response.getWriter().print(metricQueryAggrJson);
-  } catch (SQLException e) {
-      SQLException nextException = e;
-      StringBuilder sb = new StringBuilder();
-      do {
-          sb.append(nextException.getMessage());
-          sb.append("\nSQLState   " + nextException.getSQLState());
-          sb.append("\nError Code " + nextException.getErrorCode());
-      } while ((nextException = nextException.getNextException()) != null);
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(sb.toString());
-   } catch (Exception e) {
-      response.setContentType("text/plain");
-      response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-      response.getWriter().print(e.getMessage());
-   } finally {
-      if (rs != null)
-        rs.close();
-      if (stmt != null)
-        stmt.close();
-      if (connection != null)
-        connection.close();
-   }
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/explain.html
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/explain.html b/dcs/src/main/resources/dcs-webapps/master/explain.html
deleted file mode 100644
index d8ddd12..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/explain.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!-- @@@ 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 @@@                                                           -->
-
-<head>
-	<link type="text/css" href="css/base.css" rel="stylesheet" />
-	<link type="text/css" href="css/Spacetree.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/jquery.dataTables_themeroller.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_page.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_table_jui.css" rel="stylesheet" />
-	<link type="text/css" href="jquery-ui/jquery-ui.css" rel="stylesheet" />	
-	<script type="text/javascript" src="js/lib/jquery-1.11.0.js"></script>
-	<script type="text/javascript" src="jquery-ui/jquery-ui.js"></script>
-	<script type="text/javascript" src="datatables/js/jquery.dataTables.js"></script>
-	<script type="text/javascript" src="js/lib/jit.js"></script>
-	<script type="text/javascript" src="js/ExplainPlanView.js"></script>
-</head>
-<div id="hpdsm-workload-summary-page" class="hp-page">
-	<h1>Query</h1>
-	<div id="hpdsm-whiteboard-query" class="hp-panel-contents">
-		<textarea id="query-text" class="hpdsm-whiteboard-query-area" name="TextMessage" spellcheck="false" placeholder="Enter a SQL query..." rows="5" style="width: 		95%;color:black;font-size:14px;"></textarea>
-		<br>
-		<button id="explainQuery" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Explain</span></button>
-		<button id="executeQuery" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Execute</span></button>
-		<button id="setControlStmts" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Options</span></button>
-	</div>
-	<br/>
-	<h1>Result</h1>
-	<img id="loadingImg" src="img/ajax-loader.gif"/>
-	<div id="hpdsm-1">
-		<div id="query-result-container" dtName=''></div>
-		<div id="infovis"></div> 
-		<label id="errorText" style="color:red"></label>
-	</div>
-
-</div>
-<div id="dialog-form" title="Control Options" style="display:none; height:500px;width:100%">
-  <form onsubmit="return false">
-	  <label for="controlStmts">Control Statements : </label>
-	  <textarea id="controlStmts" rows="9" cols="450" placeholder="control statements separated by semi-colon" style="width:450px"/>
- 
-	  <!-- Allow form submission with keyboard without duplicating the dialog button -->
-	  <input type="submit" tabindex="-1" style="position:absolute; top:-1000px">
-  </form>
-</div>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/queryPlan.jsp
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/queryPlan.jsp b/dcs/src/main/resources/dcs-webapps/master/queryPlan.jsp
deleted file mode 100644
index 51f74ce..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/queryPlan.jsp
+++ /dev/null
@@ -1,77 +0,0 @@
-<%--
-/**
- * @@@ 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 @@@     
- */
---%>
-<%@ page contentType="text/html;charset=UTF-8"
-  import="java.io.*"
-  import="java.util.*"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.trafodion.dcs.master.DcsMaster"
-  import="org.trafodion.dcs.util.DcsConfiguration"
-  import="org.trafodion.dcs.Constants"
-  import="org.trafodion.dcs.util.Bytes"
-  import="org.codehaus.jettison.json.JSONArray"
-  import="org.codehaus.jettison.json.JSONException"
-  import="org.codehaus.jettison.json.JSONObject"
-  import="org.trafodion.dcs.master.QueryPlanModel"
-  import="org.trafodion.dcs.master.QueryPlanResponse"
-  import="org.codehaus.jackson.JsonGenerationException"
-  import="org.codehaus.jackson.map.JsonMappingException"
-  import="org.codehaus.jackson.map.ObjectMapper"
- %>
-<% 
-  try {
-      DcsMaster master = (DcsMaster)getServletContext().getAttribute(DcsMaster.MASTER);
-      Configuration conf = master.getConfiguration();
-  
-      BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
-      String json = "";
-      if(br != null) {
-          json = br.readLine();
-      }
-  
-      JSONObject jsonObject = new JSONObject(json);
-      String sQuery = jsonObject.getString("sQuery");
-      String sControlStmts = jsonObject.getString("sControlStmts");
-  
-      if(sQuery == null || sQuery.trim().length() < 1) {
-          response.setContentType("text/plain");
-          response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-          response.getWriter().print("The query text cannot be empty");
-          return;
-      }
- 
-      QueryPlanModel qpm = new QueryPlanModel();
-      qpm.GeneratePlan(master.getServerManager().getJdbcT4Util(),sQuery, sControlStmts);
-      QueryPlanResponse qpr = qpm.getQueryPlanResponse();
-      ObjectMapper mapper = new ObjectMapper();
-      JSONObject queryPlanJson = null;
-      queryPlanJson = new JSONObject(mapper.writeValueAsString(qpr));
-      response.setContentType("application/json");
-      response.getWriter().print(queryPlanJson);
-  } catch (Exception e) {
-       response.setContentType("text/plain");
-       response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
-       response.getWriter().print(e.getMessage());
-  }
-  %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/resources/dcs-webapps/master/querystats.html
----------------------------------------------------------------------
diff --git a/dcs/src/main/resources/dcs-webapps/master/querystats.html b/dcs/src/main/resources/dcs-webapps/master/querystats.html
deleted file mode 100644
index d7f2fdb..0000000
--- a/dcs/src/main/resources/dcs-webapps/master/querystats.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!-- @@@ 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 @@@                                                           -->
-<head>
-	<link type="text/css" href="datatables/css/jquery.dataTables_themeroller.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_page.css" rel="stylesheet" />
-	<link type="text/css" href="datatables/css/demo_table_jui.css" rel="stylesheet" />
-	<link type="text/css" href="jquery-ui/jquery-ui.css" rel="stylesheet" />	
-	<script type="text/javascript" src="js/lib/jquery-1.11.0.js"></script>
-	<script type="text/javascript" src="datatables/js/jquery.dataTables.js"></script>
-	
-</head>
-
-	<div id="progress">
-	<p><span style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 18px;">Fetching repository data ...</p>
-	<img src="img/ajax-loader.gif"/>
-	</div>
-	<div id="query-stats"></div>
-
-<script type="text/javascript">
-$(document).ready(function(){
-	document.body.style.cursor = 'wait';
-	$('#query-stats').html('').css('color','black');
-    var jqxhr = $.getJSON('querystats.jsp',function(result){
-    	
-    var keys;
-    $.each(result, function(i, data){
-      keys = Object.keys(data);
-	});
-    
-    var sb = '<table class="display1" id="query-stats-table" style="font-size:small"><thead><tr>';
-    for (var r=0,len=keys.length; r<len; r++) {
-      sb += '<th><b></b>' + keys[r] + '</th>';
-    }
-    sb += '</tr></thead><tbody> </tbody></table>';
-    $('#query-stats').html( sb );
-    
-	var aoColumns = [];
-	var aaData = [];
-	
-	$.each(result, function(i, data){
-	var rowData = [];
-	  $.each(keys, function(k, v) {
-	    rowData.push(data[v]);
-	  });
-	  aaData.push(rowData);
-	});
-
-	// add needed columns
-	$.each(keys, function(k, v) {
-		obj = new Object();
-		obj.sTitle = v;
-		aoColumns.push(obj);
-	});
-	
-	 $('#query-stats-table').dataTable({"bProcessing": true,"bJQueryUI": true,"sPaginationType": "full_numbers","aaData": aaData, "aoColumns" : aoColumns });
-	 
-		var elem = document.getElementById('progress');
-		elem.parentNode.removeChild(elem);
-		document.body.style.cursor = 'default';
-	
-    });
-	
-	jqxhr.fail(function(){
-		$('#query-stats').html( jqxhr.responseText ).css('color','red');
-		var elem = document.getElementById('progress');
-		elem.parentNode.removeChild(elem);
-		document.body.style.cursor = 'default';
-	});
-
-  });
-</script>


[15/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/schema_controls.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/schema_controls.adoc b/docs/cqd_reference/src/asciidoc/_chapters/schema_controls.adoc
index 0112b9a..0f84bb0 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/schema_controls.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/schema_controls.adoc
@@ -28,12 +28,34 @@
 
 This section describes CQDs that are used for schema controls.
 
+[[catalog]]
+== Catalog
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Specifies the default catalog name for all DDL and DML statements.
+| *Values*                    | Any valid ANSI name, including delimited names. +
+ +
+The default is *'TRAFODION'*.
+| *Usage*                     | Trafodion tables must be in a catalog called TRAFODION. If you mostly access Hive or native HBase tables,
+then the catalog could be changed to HIVE or HBASE respectively. +
+ +
+The default setting is overridden by any catalog name specified in a SQL statement.
+| *Production Usage*          | Yes.
+| *Impact*                    | Not applicable.
+| *Level*                     | Any.
+| *Conflicts/Synergies*       | Alternately you can use the SET CATALOG statement.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
 [[schema]]
 == Schema
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Influencing Query Plans 
 | *Description*               | Sets the default schema for the session. 
 | *Values*                    | SQL identifier. +
  +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/table_definition.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/table_definition.adoc b/docs/cqd_reference/src/asciidoc/_chapters/table_definition.adoc
new file mode 100644
index 0000000..0a93dce
--- /dev/null
+++ b/docs/cqd_reference/src/asciidoc/_chapters/table_definition.adoc
@@ -0,0 +1,142 @@
+////
+/**
+* @@@ 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 @@@
+  */
+////
+
+[[table_definition]]
+= Table Definition
+
+This section describes CQDs that are used for table definition
+
+[[auto-query-retry-warnings]]
+== ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allow Trafodion tables to be created with NULLABLE columns in the PRIMARY or STORE BY key.
+| *Values*                    | *'ON'* or *'OFF'* +
+ +
+The default value is *'OFF'*.
+| *Usage*                     | Allows NULLABLE columns to be included in the PRIMARY or STORE BY key for Trafodion tables. 
+This CQD must be set prior to creating the table. It is not necessary to specify this CQD during DML operations on the table. +
+ +
+When performing UPDATE STATISTICS with SAMPLE option on such tables, this CQD must be set so that an appropriate sample table can be created.
+| *Production Usage*          | Please consult with the Trafodion community.
+| *Impact*                    | Two bytes are added to the key for each nullable column.
+| *Level*                     | Session.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hbase-block-size]]
+== HBASE_BLOCK_SIZE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Allow Trafodion tables to be created with specified HBase block size.
+| *Values*                    | Positive integer. +
+ +
+The default value is *'65536'*.
+| *Usage*                     | The value of this attribute is passed on to HBase when a Trafodion table is created in HBase. 
+See the https://hbase.apache.org/book.html[Apache HBase(TM) Reference Guide] for usage information .
+| *Production Usage*          | Yes.
+| *Impact*                    | The impact depends on the type of table access. Choose a block size that is appropriate 
+for how the table is primarily accessed.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hive-default-charset]]
+== HIVE_DEFAULT_CHARSET
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Defines what character set the columns of Hive tables should have.
+| *Values*                    | 
+*'ISO88591'* or *'UTF8'* +
+ +
+Default: *'UTF8'*
+| *Usage*                     | Set this to ISO88591 when reading from Hive tables with ISO8859-1 data.
+| *Production Usage*          | Yes.
+| *Impact*                    | Not applicable.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hive-file-charset]]
+== HIVE_FILE_CHARSET
+
+[cols="25%h,75%"]
+|===
+| *Description*               | For certain character sets that are not supported in Trafodion, you can specify the character set here
+causing Trafodion to automatically convert the data to the character set specified in the HIVE_DEFAULT_CHARSET CQD. +
+ +
+This feature is currently supported only for *'GBK'*, and only if HIVE_DEFAULT_CHARSET is set to *'UTF8'*.
+| *Values*                    | 
+empty or *'GBK'* +
+ +
+Default: empty
+| *Usage*                     | Leave this blank, unless you want to access GBK data in Hive tables.
+| *Production Usage*          | Yes.
+| *Impact*                    | Not applicable.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Only applicable if HIVE_DEFAULT_CHARSET is set to *'UTF8'*.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+
+<<<
+[[hive-max-string-length]]
+== HIVE_MAX_STRING_LENGTH
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Hive columns of type STRING have a maximum length in Trafodion, which you can specify with this CQD. +
+ +
+*NOTE* For UTF-8 data, this length is specified in bytes, not UTF-8 characters.
+| *Values*                    | 
+1-n. +
+ +
+Default: 32000.
+| *Usage*                     | Set this to the lowest possible value to improve system performance.
+| *Production Usage*          | Yes.
+| *Impact*                    | Not applicable.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | Not applicable.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/transactions.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/transactions.adoc b/docs/cqd_reference/src/asciidoc/_chapters/transactions.adoc
index 5f590fb..6a18aab 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/transactions.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/transactions.adoc
@@ -33,7 +33,6 @@ This section describes CQDs that are used for transaction control and locking.
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Transaction Control and Locking
 | *Description*               | Specifies the default transaction isolation level that queries use.
 | *Values*                    | *'READ UNCOMMITTED'*, *'READ COMMITTED'*, *'REPEATABLE READ'*, or *'SERIALIZABLE'*. +
  +
@@ -76,7 +75,6 @@ then its value is used as the isolation level for updates and DDL statements. UP
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Transaction Control and Locking
 | *Description*               | Specifies the default transaction isolation level for these update operations: INSERT, UPDATE, or DELETE.
 | *Values*                    | *'READ UNCOMMITTED'*, *'READ COMMITTED'*, *'REPEATABLE READ'*, or *'SERIALIZABLE'*. +
  +
@@ -86,7 +84,7 @@ The default value is *'READ COMMITTED'* (ANSI).
 | *Impact*                    | When set, this CQD prevents users from doing any of these update operations: INSERT, UPDATE, or DELETE.
 | *Level*                     | Service.
 | *Conflicts/Synergies*       | Works with the ISOLATION_LEVEL setting. Both settings are READ COMMITTED by default.
-ISOLATION_LEVEL can be set to READ UNCOMMITTED. This CQD still remains READ COMMITTED. You can change it to READ UNCOMMITED to prevent queries
+ISOLATION_LEVEL can be set to READ UNCOMMITTED. This CQD still remains READ COMMITTED. You can change it to READ UNCOMMITTED to prevent queries
 running at the service level to not perform any updates.
 | *Real Problem Addressed*    | Not applicable.
 | *Introduced In Release*     | Trafodion 1.3.0.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/_chapters/update_stats.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/_chapters/update_stats.adoc b/docs/cqd_reference/src/asciidoc/_chapters/update_stats.adoc
index 51c0204..9695e3f 100644
--- a/docs/cqd_reference/src/asciidoc/_chapters/update_stats.adoc
+++ b/docs/cqd_reference/src/asciidoc/_chapters/update_stats.adoc
@@ -31,7 +31,6 @@
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Update Statistics and Reorg
 | *Description*               | When performing update statistics with the NECESSARY keyword or with automation, this is
 the number of minutes that are allowed to have elapsed since a histogram was marked as read for it to be regenerated. +
  +
@@ -48,7 +47,7 @@ However, if a table is not used frequently, then this CQD influences how frequen
  +
 A smaller setting reduces the number of histograms being updated if there are many tables that have not been used within that interval.
 A larger setting updates histogram for many more tables that are not being accessed that often.
-| *Production Usage*          | Not applicable.
+| *Production Usage*          | Consult the Trafodion community.
 | *Impact*                    | Influences the number of histograms that need to be regenerated and therefore the time it takes for
 update statistics automation to regenerate histograms for all the tables that so qualify.
 | *Level*                     | System.
@@ -67,7 +66,6 @@ This CQD qualifies the histogram to be regenerated; it is the maximum time since
 
 [cols="25%h,75%"]
 |===
-| *Category*                  | Update Statistics and Reorg
 | *Description*               | Sets the minimum rows that need to be in a table before sampling is used to update statistics for that table.
 If a table has a fewer rows than the value of this CQD, then the SAMPLE option is silently ignored when performing update statistics.
 | *Values*                    | 1 through max unsigned integer. +
@@ -76,7 +74,7 @@ The default value is 10000.
 | *Usage*                     | Influences for what tables sampling is used for histogram statistics generation. If the setting is smaller,
 then more tables qualify for sampling. If the setting is larger, then fewer tables qualify for sampling. Sampling can result in faster update
 statistics run times. But for smaller tables, it can also result in poor histogram accuracy which could result in poor query plans. 
-| *Production Usage*          | Not applicable.
+| *Production Usage*          | Consult the Trafodion community.
 | *Impact*                    | Setting this CQD to a smaller value means that sampling is used for tables with fewer rows, when the SAMPLE option is
 specified as part of update statistics. This can result in less accurate histograms and poor query plans, because the sample size may be too small to
 generate good estimates for histograms. +
@@ -90,3 +88,28 @@ However, these tables may also have more accurate histograms.
 | *Deprecated In Release*     | Not applicable.
 |===
 
+<<<
+[[ustat-min-rowcount-for-low-sample]]
+== USTAT_MIN_ROWCOUNT_FOR_LOW_SAMPLE
+
+[cols="25%h,75%"]
+|===
+| *Description*               | Defines the behavior of the UPDATE STATISTICS utility. It places a lower limit on the number of sample rows that will be used when sampling. +
+ +
+If the number of rows in the table is less than this value and sampling is used, then the sample size used will be that specified by
+the <<hist-default-sample-min,HIST_DEFAULT_SAMPLE_MIN>> CQD. (which defaults to 10,000).
+| *Values*                    | This CQD may take on any integer value greater than zero. +
+ +
+The default for this CQD is *1,000,000*.
+| *Usage*                     | Prevents accidental use of too-small samples when generating statistics on tables. If sample sizes are too small,
+then histogram statistics will be less accurate, leading to potentially less efficient query plans.
+| *Production Usage*          | Consult the Trafodion community.
+| *Impact*                    | Setting this CQD to lower values may result in smaller sample sizes for small tables.
+This may slightly improve UPDATE STATISTICS run time, but at the cost of potentially less efficient queries.
+| *Level*                     | System.
+| *Conflicts/Synergies*       | <<hist-default-sample-min,HIST_DEFAULT_SAMPLE_MIN>> effects the behavior of this CQD.
+| *Real Problem Addressed*    | Not applicable.
+| *Introduced In Release*     | Trafodion 1.3.0.
+| *Deprecated In Release*     | Not applicable.
+|===
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/cqd_reference/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/cqd_reference/src/asciidoc/index.adoc b/docs/cqd_reference/src/asciidoc/index.adoc
index f67e482..9de403c 100644
--- a/docs/cqd_reference/src/asciidoc/index.adoc
+++ b/docs/cqd_reference/src/asciidoc/index.adoc
@@ -61,9 +61,12 @@ specific language governing permissions and limitations under the License.
 include::asciidoc/_chapters/about.adoc[]
 include::asciidoc/_chapters/introduction.adoc[]
 include::asciidoc/_chapters/query_plans.adoc[]
+include::asciidoc/_chapters/query_execution.adoc[]
 include::asciidoc/_chapters/histograms.adoc[]
 include::asciidoc/_chapters/transactions.adoc[]
 include::asciidoc/_chapters/runtime_controls.adoc[]
 include::asciidoc/_chapters/schema_controls.adoc[]
+include::asciidoc/_chapters/table_definition.adoc[]
 include::asciidoc/_chapters/update_stats.adoc[]
 include::asciidoc/_chapters/operational_controls.adoc[]
+include::asciidoc/_chapters/debugging.adoc[]

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/pom.xml
----------------------------------------------------------------------
diff --git a/docs/load_transform/pom.xml b/docs/load_transform/pom.xml
index ef00fd5..d54b0e8 100644
--- a/docs/load_transform/pom.xml
+++ b/docs/load_transform/pom.xml
@@ -234,15 +234,15 @@
                   - target/docs/<version>/<document> contains the PDF version and the web book. The web book is named index.html
                 --> 
                 <!-- Copy the PDF file to its target directories -->
-                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/load_transform_guide/Trafodion_Load_Transform_Guide.pdf" />
-                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/${project.version}/load_transform_guide/Trafodion_Load_Transform_Guide.pdf" />
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/load_transform/Trafodion_Load_Transform_Guide.pdf" />
+                <copy file="${basedir}/target/index.pdf" tofile="${basedir}/../target/docs/${project.version}/load_transform/Trafodion_Load_Transform_Guide.pdf" />
                 <!-- Copy the Web Book files to their target directories -->
-                <copy todir="${basedir}/../target/docs/load_transform_guide">
+                <copy todir="${basedir}/../target/docs/load_transform">
                   <fileset dir="${basedir}/target/site">
                     <include name="**/*.*"/>  <!--All sub-directories, too-->
                   </fileset>
                 </copy>
-                <copy todir="${basedir}/../target/docs/${project.version}/load_transform_guide">
+                <copy todir="${basedir}/../target/docs/${project.version}/load_transform">
                   <fileset dir="${basedir}/target/site">
                     <include name="**/*.*"/>  <!--All sub-directories, too-->
                   </fileset>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/about.adoc b/docs/load_transform/src/asciidoc/_chapters/about.adoc
index 4ef4bd0..f15fd04 100644
--- a/docs/load_transform/src/asciidoc/_chapters/about.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/about.adoc
@@ -32,17 +32,19 @@ The information herein is complementary to the following Trafodion documentation
 * http://trafodion.apache.org/docs/odb/index.html[Trafodion odb User Guide]
 
 == Intended Audience
-This guide targets anyone wanting to load data into a Trafodion database. You need to have the
-following skill sets to make full of the information in this guide:
+This guide targets anyone wanting to load data into a Trafodion database. 
+
+You need to have skills in the following areas to make full use of the information in this guide:
 
 * SQL DDL and DML.
-* Install and configure Linux software.
+* Installation and configuration of Linux software.
 * Trafodion administration.
 * Depending on your data source, Java and/or Hadoop ecosystem usage.
 
 == New and Changed Information
 This is a new guide.
 
+<<<
 == Notation Conventions
 This list summarizes the notation conventions for syntax presentation in this manual.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/bulk_load.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/bulk_load.adoc b/docs/load_transform/src/asciidoc/_chapters/bulk_load.adoc
index 03f1385..46593b5 100644
--- a/docs/load_transform/src/asciidoc/_chapters/bulk_load.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/bulk_load.adoc
@@ -46,30 +46,31 @@ You copy data between two Trafodion tables by using the appropriate SELECT state
 === Example
 
 ```
+LOAD INTO target_table SELECT * FROM source_table WHERE custkey >= 1000 ;
 ```
 
 [[bulk-load-data-from-hdfs-files]]
 == Load Data From HDFS Files
 
-You can copy your data into an HDFS folder and then create an external Hive tables with the correct fields that
-you point to the HDFS folder containing the data. You can also specify a WHERE clause on the source data as a filter.
+You copy your data (local or remote) into an HDFS folder. Then, you create an external Hive table (with correct fields) that points
+to the HDFS folder containing the data. You may also specify a WHERE clause on the source data as a filter, if needed.
 See the https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-ExternalTables[External Tables]
 page on the https://cwiki.apache.org/confluence/display/Hive[Hive Wiki] for more information.
 
-When Hive tables are accessed through Trafodion columns with integral, string, and char types are accessible.
+Trafodion can access columns in Hive tables having integer, string and char types.
 See the https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types[LanguageManual Types]
 page on the https://cwiki.apache.org/confluence/display/Hive[Hive Wiki] for the data types available in Hive.
 
 Overall, you do the following:
 
-1. Export the data on the remote cluster.
-2. Transport files to Trafodion cluster via FTP, scp, or some other method.
+1. Export the data on the local or remote cluster.
+2. If applicable, transport files to Trafodion cluster via FTP, scp, or some other method.
 3. Use LOAD referencing HIVE external tables.
 
 === Example
 
-
-NEED A DESCRIPTION OF THE USE CASE, THE LOAD FILE, AND ITS LAYOUT.
+You have a customer-demographics in a text file, which you need to load into Trafodion.
+The columns are separated by `|`.
 
 Do the following:
 
@@ -141,12 +142,12 @@ Task: POPULATE INDEX Status: Ended ET: 00:00:05.262
 [[bulk-load-data-from-hive-tables]]
 == Load Data From Hive Tables
 
-You can import data from Hive using the TrafCI or sqlci command interface. Do the following:
+You can import data from Hive using the trafci or sqlci command interface. Do the following:
 
 1. Set these required Control Query Defaults (CQDs) to improve load performance:
 +
 ```
-CQD HIVE_MAX_STRING_LENGTH '1000'; // if the widest column is 1KB
+CQD HIVE_MAX_STRING_LENGTH '1000'; -- if the widest column is 1KB
 ```
 +
 This setting is required if there are time-related column types in the target Trafodion table.
@@ -162,10 +163,10 @@ LOAD WITH NO POPULATE INDEXES INTO trafodion.sch.demo SELECT * FROM hive.hive.de
 ```
 
 See the http://trafodion.incubator.apache.org/docs/sql_reference/index.html#load_statement[Trafodion SQL Reference Manual].
-for the completed syntax of the LOAD statement.
+for the complete syntax of the LOAD statement.
 
-If multiple invocations of the LOAD statement are used to incrementally load sets of data to a single target table, then several HFiles
-for each partition of the target table are created. This causes inefficient access during SELECT queries and may also cause a compaction
+If you use multiple LOAD statements to incrementally load sets of data into a single target table, then several HFiles are created
+for each partition of the target table. This causes inefficient access during SELECT queries and may also cause a compaction
 to be triggered based on the policies configured in the HBase settings.
 
 To avoid this issue, it is good practice to perform a major compaction on a table that has been the target of more than two LOAD statements
@@ -184,8 +185,6 @@ NOTE: The `major_compact` command returns immediately since it's not waited. Typ
 >> CQD HIVE_MAX_STRING_LENGTH '1000' ;
 >> CQD ALLOW_INCOMPATIBLE_ASSIGNMENT 'on' ;
 >> LOAD WITH NO POPULATE INDEXES INTO trafodion.sch.demo SELECT * FROM hive.hive.demo ;
-
-<NEED MORE HERE, INCLUDING CREATING THE TRAFODION TABLE AND WHAT TO DO ABOUT INDEXES>
 ```
 
 [[bulk-load-data-from-external-databases]]
@@ -243,7 +242,8 @@ export JAVA_OPTIONS=-Dmapred.child.java.opts=\-Djava.security.egd=file:/dev/uran
 ==== List All Oracle Tables
 
 ```
-sqoop list-tables --driver oracle.jdbc.OracleDriver --connect jdbc:oracle:thin:@<Oracle host name>:<port>/<database>
+sqoop list-tables --driver oracle.jdbc.OracleDriver 
+--connect jdbc:oracle:thin:@<Oracle host name>:<port>/<database>
 --username <user-name> --password <password>
 ```
 
@@ -279,9 +279,12 @@ which does not exist in the data itself.
 
 === Example
 
-ADD EXAMPLE HERE.
-
 ```
+sqoop import --connect jdbc:oracle:thin:@localhost:1521/orcl
+--username trafdemo --password traf123 --table CUSTOMER
+--split-by CUSTNUM --hive-import --create-hive-table
+--hive-table customers --hive-overwrite --null-string ''
+--null-non-string '' --hive-drop-import-delims--verbose
 ```
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/introduction.adoc b/docs/load_transform/src/asciidoc/_chapters/introduction.adoc
index 2bbc3e1..05e0cd5 100644
--- a/docs/load_transform/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/introduction.adoc
@@ -36,19 +36,21 @@ There are two methods used to load data into a Trafodion table. Both methods can
 | *Bulk Load* | Large data volumes +
 Stage data and load in the batches | Trafodion Bulk Loader
 | *Trickle Load* | Small data volumes +
-Insert data at it arrives | odb tool +
-ETL tool or custom ODBC/JDBC application
+Insert data as it arrives | ETL tool +
+Custom ODBC/JDBC application +
+User-Defined Functions +
+odb Tool
 |===
 
 These two methods use four types of SQL insert statements
 
 * *Bulk Load*
-** http://trafodion.apache.org/docs/sql_reference/index.html#load_statement[LOAD]
+** http://trafodion.incubator.apache.org/docs/sql_reference/index.html#load_statement[LOAD]
 
 * *Trickle Load*
 ** http://trafodion.incubator.apache.org/docs/sql_reference/index.html#insert_statement[INSERT]
-** http://trafodion.apache.org/docs/sql_reference/index.html#upsert_statement[UPSERT]
-** http://trafodion.apache.org/docs/sql_reference/index.html#upsert_statement[UPSERT USING LOAD]
+** http://trafodion.incubator.apache.org/docs/sql_reference/index.html#upsert_statement[UPSERT]
+** http://trafodion.incubator.apache.org/docs/sql_reference/index.html#upsert_statement[UPSERT USING LOAD]
 
 The http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
 provides syntax descriptions for these statements.
@@ -62,6 +64,7 @@ The data source defines what type of load approach and method you use:
 ** _Native HBase Tables_: Direct load.
 ** _Disparate Data Source_: Write Java/C++ UDF to read data from source and pass rows to LOAD.
 
+<<<
 * *Trickle Load* (odb utility)
 ** _Text Files_: Direct access
 ** _pipes_: Via `stdin`
@@ -72,6 +75,7 @@ For more information, refer to:
 * <<bulk-load,Bulk Load>>
 * <<trickle-load, Trickle Load>>
 
+<<<
 [[introduction-insert-types]]
 === Insert Types
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/tables_indexes.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/tables_indexes.adoc b/docs/load_transform/src/asciidoc/_chapters/tables_indexes.adoc
index 71ea7f7..a9f8f78 100644
--- a/docs/load_transform/src/asciidoc/_chapters/tables_indexes.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/tables_indexes.adoc
@@ -60,6 +60,7 @@ The number of partitions must also be specified during table creation. You choos
 cluster and the expected size of the table. A salted table can split if more data is added to it than initially estimated. If this
 happens, then more than one partition having rows with the same salt value, which may result in suboptimal execution plans for the table.
 
+<<<
 You can also choose not to salt Trafodion tables. This is similar to range partitioning in a traditional database. The number of partitions
 grows with the size of the table, and range boundaries are determined by HBase based on the specified split policy.
 
@@ -71,18 +72,11 @@ when compared to a Hive table with equivalent data since HBase stores the key se
 
 HBase provides several types of encoding to avoid storing the same key value to disk for every column in the row. HBase also supports various
 types of compression of the entire data block, regardless whether it is encoded or not.
-
 See http://hbase.apache.org/book.html#compression[Appendix E: Compression and Data Block Encoding In HBase] in the
-http://hbase.apache.org/book.html[Apache HBase Reference Guide] for a comparison of various compression and encoding algorithms. 
-
-For a discussion on the space savings achieved by various types of encoding and compression schemes, please see the
-https://blogs.apache.org/hbase/category/General["The Effect of ColumnFamily, RowKey and KeyValue Design on HFile Size"] HBase blog entry,
-dated Friday April 11, 2014. 
-
-The performance of an algorithm is also a relevant factor when deciding on the type of compression. For more information, see slides 6, 7, 
-and 8 of Govind Kamat's and Sumeet Singh's presentation,
-http://www.slideshare.net/Hadoop_Summit/kamat-singh-june27425pmroom210cv2["Compression Options in Hadoop - A Tale of Tradeoffs"].
-
+http://hbase.apache.org/book.html[Apache HBase Reference Guide] for a comparison of various compression and encoding algorithms. Use the
+information in the http://hbase.apache.org/book.html#data.block.encoding.types[Which Compressor or Data Block Encoder To Use] section to 
+determine the best compression technique for your tables.
+<<<
 [[create-trafodion-tables-and-indexes]]
 == Create Tables and Indexes 
 
@@ -204,5 +198,3 @@ using ON EXISTING COLUMNS. Note that using ON NECESSARY COLUMNS will only identi
 requested by the optimizer but do not exist. The current implementation of automation does not know which existing histograms might be stale.
 
 
-
-LocalWords:  c7

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc b/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
index 3d3bd1b..4991619 100644
--- a/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
@@ -472,14 +472,14 @@ In addition, you need to convert the date format and replace all occurrences of
 
 The following map file accomplishes these goals:
 
-***
+```
 $ cat test/load_map/ml1.map +
-# Map file to load TRAFODION.MFTEST.FRIENDS from friends.dat +
-ID:seq:1                  # Inserts into ID column a sequence starting from 1 +
-NAME:4:REPLACE:Lucia:Lucy # Loads field #4 into NAME and replace all occurrences of Lucia with Lucy +
-AGE:2                     # Loads field #2 (they start from zero) into AGE +
+# Map file to load TRAFODION.MFTEST.FRIENDS from friends.dat
+ID:seq:1                  # Inserts into ID column a sequence starting from 1 
+NAME:4:REPLACE:Lucia:Lucy # Loads field #4 into NAME and replace all occurrences of Lucia with Lucy
+AGE:2                     # Loads field #2 (they start from zero) into AGE
 BDATE:6:DCONV:d.b.y       # Loads field #6 into BDATE converting date format from dd mmm yyyy
-***
+```
 
 Load as follows:
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/load_transform/src/asciidoc/_chapters/troubleshoot.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/troubleshoot.adoc b/docs/load_transform/src/asciidoc/_chapters/troubleshoot.adoc
index 112b0ee..77624ec 100644
--- a/docs/load_transform/src/asciidoc/_chapters/troubleshoot.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/troubleshoot.adoc
@@ -112,8 +112,8 @@ you can specify the default attribute, USE_HIVE_SOURCE. This causes the Hive tab
 
 NOTE: The name of the Hive table must use the Trafodion table name as its prefix.
 For example, if the Trafodion table is TRAFODION.SCH.DEMO, then the Hive 
-table name can be DEMO_SRC. In this case, set the attribute as follows: 
-+
+table name can be DEMO_SRC. In this case, set the attribute as follows: +
+ +
 ```
 CONTROL QUERY DEFAULT USE_HIVE_SOURCE '_SRC' ;
 CREATE INDEX demo_ix ON sch.demo(name) ;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/sql_reference/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/about.adoc b/docs/sql_reference/src/asciidoc/_chapters/about.adoc
index de3dcb8..0cc63d6 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/about.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/about.adoc
@@ -87,9 +87,7 @@ Trafodion SQL statements.
 Management System (RMS) and describes the RMS counters that are returned.
 | <<OLAP_Functions,OLAP Functions>>                               | Describes specific on line analytical processing functions.
 | <<Reserved_Words,Appendix A: Reserved Words>>                   | Lists the words that are reserved in Trafodion SQL.
-| <<Control_Query_Default,Appendix B: Control Query Default (CQD) Attributes>> |
-Describes the Control Query Default (CQD) attributes that are supported in a Trafodion SQL environment.
-| <<Limits,Appendix C: Limits>>                                  | Describes limits in Trafodion SQL.
+| <<Limits,Appendix B: Limits>>                                  | Describes limits in Trafodion SQL.
 |===
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/sql_reference/src/asciidoc/_chapters/cqds.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/cqds.adoc b/docs/sql_reference/src/asciidoc/_chapters/cqds.adoc
deleted file mode 100644
index c96d125..0000000
--- a/docs/sql_reference/src/asciidoc/_chapters/cqds.adoc
+++ /dev/null
@@ -1,329 +0,0 @@
-////
-/**
-* @@@ 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 @@@
-  */
-////
-
-<<<
-<<<
-[[cqd_attributes]]
-= Control Query Default (CQD) Attributes
-
-This section describes CQDs that are used to override system-level
-default settings.
-
-[[hive_environment_cqds]]
-== Hive Environment CQDs
-
-[[hive_max_string_length]]
-=== HIVE_MAX_STRING_LENGTH
-
-[cols="25%h,75%"]
-|===
-| Category                    | Hive
-| Description                 | Maximum supported string length for the _string_ data type in Hive. All
-string columns in Hive tables get converted to VARCHAR(_n_ BYTES)
-CHARACTER SET UTF8, with _n_ being the value of this CQD.
-| Values                      | The default value is 32000.
-|===
-
-<<<
-[[managing_histograms]]
-== Managing Histograms
-
-[[cache_histograms_refresh_interval]]
-=== CACHE_HISTOGRAMS_REFRESH_INTERVAL
-
-[cols="25%h,75%"]
-|===
-| Category                    | Histograms
-| Description                 | Defines the time interval after which timestamps for cached histograms
-are checked to be refreshed.
-| Values                      | Unsigned integer. Unit is seconds. +
- +
-The default value is '3600' (1 hour).
-| Usage       | Histogram statistics are cached so that the compiler can avoid access to
-the metadata tables, thereby reducing compile times. The time stamp of
-the tables are checked against those of the cached histograms at an
-interval specified by this CQD, in order to see if the cached histograms
-need to be refreshed. +
- +
-You can increase the interval to reduce the impact on compile times as
-long as you do not need to obtain fresh statistics more frequently in
-order to improve query performance. It may
- +
-be that the default interval is too long and you would rather refresh
-the statistics more frequently than the default one hour, in order to
-improve query performance at the cost of increased compile times.
- +
-This setting depends on how frequently you are updating statistics on
-tables. There is no point in refreshing statistics frequently when
-statistics are not being updated during that time. On the other hand if
-you are updating statistics, or generating them for the first time on
-freshly loaded tables frequently enough, and you want these to be picked
-up immediately by the compiler because you have seen this to have a
-dramatic impact on plan quality, then you can make the refresh more
-frequent.
-| Production Usage            | Not applicable.
-| Impact                      | Longer histogram refresh intervals can improve compile times. However,
-the longer the refresh interval the more obsolete the histograms. That
-could result in poor performance for queries that could leverage
-recently updated statistics.
-| Level                       | System or Service Not applicable
-| Addressing the Real Problem | Not applicable.
-|===
-
-<<<
-[[hist_no_stats_refresh_interval]]
-=== HIST_NO_STATS_REFRESH_INTERVAL
-
-[cols="25%h,75%"]
-|===
-| Category                    | Histograms
-| Description                 | Defines the time interval after which the fake histograms in the cache should be refreshed unconditionally.
-| Values                      | Integer. Unit is seconds. +
- +
-The default value is '3600' (1 hour).
-| Usage                       | Histogram statistics are "fake" when update statistics is not being run,
-but instead the customer is updating the histogram tables directly with
-statistics to guide the optimizer. This may be done if the data in the
-table is very volatile (such as for temporary tables), update statistics
-is not possible because of constant flush and fill of the table
-occurring, and statistics are manually set to provide some guidance to
-the optimizer to generate a good plan.
- +
-If these fake statistics are updated constantly to reflect the data
-churn, this default can be set to 0. This would ensure that the
-histograms with fake statistics are not cached, and are always
-refreshed. If these fake statistics are set and not touched again, then
-this interval could be set very high.
-| Production Usage            | Not applicable.
-| Impact                      | Setting a high interval improves compilation time. However, if statistics are being updated, the compiler may be working with obsolete
-histogram statistics, potentially resulting in poorer plans.
-| Level                       | Service.
-| Conflicts/Synergies         | Not applicable.
-| Addressing the Real Problem | Not applicable.
-|===
-
-[[hist_prefetch]]
-=== HIST_PREFETCH
-
-[cols="25%h,75%"]
-|===
-| Category                    | Histograms
-| Description                 | Influences the compiler to pre-fetch the histograms and save them in cache.
-| Values                      | 'ON'    Pre-fetches the histograms. +
-'OFF'   Does not pre-fetch the histograms. +
- +
- The default value is 'ON'.
-| Usage                       | You may want to turn this off if you don't want to pre-fetch a large number of histograms, many of which may not be used.
-| Production Usage            | Not applicable.
-| Impact                      | Though it makes compilation time faster, it may result in the histogram cache to be filled with histograms that may never be used.
-| Level                       | System or Service.
-| Conflicts/Synergies         | Use this CQD with CACHE_HISTOGRAMS. If CACHE_HISTOGRAMS is OFF, then this CQD has no effect.
-| Addressing the Real Problem | Not applicable.
-|===
-
-[[hist_rowcount_requiring_stats]]
-=== HIST_ROWCOUNT_REQUIRING_STATS
-
-[cols="25%h,75%"]
-|===
-| Category                    | Histograms
-| Description                 | Specifies the minimum row count for which the optimizer needs histograms, in order to compute better cardinality estimates. The
-optimizer does not issue any missing statistics warnings for tables whose size is smaller than the value of this CQD.
-| Values                      | Integer. +
- +
-The default value is '50000'.
-| Usage                       | Use this CQD to reduce the number of statistics warnings.
-| Production Usage            | Not applicable.
-| Impact                      | Missing statistics warnings are not displayed for smaller tables, which in most cases don't impact plan quality much.
-However, there may be some exceptions where missing statistics on small tables could result in less than optimal plans.
-| Level                       | System
-| Conflicts/Synergies         | Use this CQD with HIST_MISSING_STATS_WARNING_LEVEL. If the warning level CQD is 0, then this CQD does not have any effect. Also, for tables
-having fewer rows than set in this CQD, no warnings are displayed irrespective of the warning level.
-| Addressing the Real Problem | Not applicable.
-|===
-
-<<<
-[[optimizer]]
-== Optimizer
-
-[[join_order_by_user]]
-=== JOIN_ORDER_BY_USER
-
-[cols="25%h,75%"]
-|===
-| Category                    | Influencing Query Plans
-| Description                 | Enables or disables the join order in which the optimizer joins the tables to be the sequence of the tables in the FROM clause of the query.
-| Values                      | 'ON'   Join order is forced. +
- +
-'OFF'   Join order is decided by the optimizer. +
- +
-The default value is 'OFF'.
-| Usage                       | When set to ON, the optimizer considers only execution plans that have the join order matching the sequence of the tables in the FROM clause.
-| Production Usage            | This setting is to be used only for forcing a desired join order that was not generated by default by the optimizer. It can be used as a
-workaround for query plans with inefficient join order.
-| Impact                      | Because you are in effect forcing the optimizer to use a plan that joins the table in the order specified in the FROM clause,
-the plan generated may not be the optimal one.
-| Level                       | Query
-| Conflicts/Synergies         | Not applicable.
-| Addressing the Real Problem | Not applicable.
-|===
-
-[[mdam_scan_method]]
-=== MDAM_SCAN_METHOD
-
-[cols="25%h,75%"]
-|===
-| Category                    | Influencing Query Plans
-| Description                 | Enables or disables the Multi-Dimensional Access Method.
-| Values                      | 'ON'    MDAM is considered. +
-'OFF'   MDAM is disabled. +
- +
-The default value is 'ON'.
-| Usage                       | In certain situations, the optimizer might choose MDAM inappropriately, causing poor performance.
-In such situations you may want to turn MDAM OFF for the query it is effecting.
-| Production Usage            | Not applicable.
-| Impact                      | Table scans with predicates on non-leading clustering key column(s) could benefit from MDAM access method if
-the leading column(s) has a small number of distinct values. Turning MDAM off results in a longer scan time for such queries.
-| Level                       | Set this CQD at the query level when MDAM is not working efficiently for a specific query.
-However, there may be cases (usually a defect) where a larger set of queries is being negatively impacted by MDAM.
-In those cases you may want to set it at the service or system level.
-| Conflicts/Synergies         | Not applicable.
-| Addressing the Real Problem | Not applicable.
-|===
-
-[[subquery_unnesting]]
-=== SUBQUERY_UNNESTING
-
-[cols="25%h,75%"]
-|===
-| Category                    | Influencing Query Plans
-| Description                 | Controls the optimizer's ability to transform nested sub-queries into regular join trees.
-| Values                      | 'ON'    Subquery un-nesting is considered. +
-'OFF'   Subquery un-nesting is disabled. +
- +
-The default value is 'ON'.
-| Usage                       | Use this control to disable subquery un-nesting in the rare situation when un-nesting results in an inefficient query execution plan.
-| Production usage            | Not applicable.
-| Impact                      | In general, subquery un-nesting results in more efficient execution plans for queries with nested sub-queries.
-Use only as a workaround for observed problems due to un-nesting.
-| Level                       | Query
-| Conflicts/Synergies         | Not applicable.
-| Addressing the Real Problem | Not applicable.
-|===
-
-<<<
-[[managing_schemas]]
-== Managing Schemas
-
-[[schema]]
-=== SCHEMA
-
-[cols="25%h,75%"]
-|===
-| Category                    | Schema controls
-| Description                 | Sets the default schema for the session.
-| Values                      | SQL identifier. +
- +
-The default is SEABASE. 
-| Usage                       | A SET SCHEMA statement, or a CONTROL QUERY DEFAULT SCHEMA statement, can be used to override the default schema name.
-| Production Usage            | It is a convenience so you do not have to type in two-part names.
-| Impact                      | Not applicable.
-| Level                       | Any.
-| Conflicts/Synergies         | Alternately you can use the SET SCHEMA statement.
-| Addressing the Real Problem | Not applicable.
-|===
-
-<<<
-[[transaction_control_and_locking]]
-== Transaction Control and Locking
-
-[[block_to_prevent_halloween]]
-=== BLOCK_TO_PREVENT_HALLOWEEN
-
-[cols="25%h,75%"]
-|===
-| Category                    | Runtime controls
-| Description                 | A self-referencing insert is one which inserts into a target table and
-also scans from the same target table as part of the query that produces
-rows to be inserted. Inconsistent results are produced by the insert
-statement if the statement scans rows which have been inserted by the
-same statement. This is sometimes called the "Halloween problem."
-Trafodion prevents the Halloween problem using one of two methods: 1)
-the blocking method uses a SORT operation to ensure all rows have been
-scanned before any are inserted, or 2) the disk process (ESAM) locks
-method tracks the rows which have already been inserted and the SCAN
-operator skips these rows. +
- +
-The compiler chooses the blocking method in cases in which static
-analysis of the plan indicates that the disk process locks method cannot
-be used. However, the compiler does not evaluate one condition that
-would prevent the use of the disk process locks method: the AUTOCOMMIT
-setting in which the statement is executed. Instead the compiler assumes
-that the statement is executed with the default setting for AUTOCOMMIT,
-'ON'. If AUTOCOMMIT is set to 'OFF' and self-referencing insert
-statement which uses the disk process locks method is executed, then a
-runtime error (SQLCODE 8107) is raised. +
- +
-This CQD is used to force the compiler to use the blocking method to
-prevent error 8107.
-| Values                       | 'OFF'   The compiler is free to choose which method to use to prevent the Halloween problem. +
-'ON'    The compiler is forced to use the blocking method. +
- +
-The default value is 'ON'.
-| Usage                        | Change this default to 'ON' if error 8107 is raised for a self-referencing insert statement which is
-executed in a session with AUTOCOMMIT set to 'OFF'.
-| Production Usage             | Not applicable.
-| Impact                       | Using the 'ON' value in conditions that require it allows successful completion of the insert statement.
-Using the 'ON' value when not required can decrease performance of some self-referencing insert statements.
-| Level                        | If self-referencing insert statements which execute with AUTOCOMMIT 'OFF' can be restricted to a service level,
-then this default should be set to 'ON' only for that service level. Otherwise the setting should be made for the system.
-| Conflicts/Synergies          | Not applicable.
-| Addressing the Real Problem  | Not applicable.
-|===
-
-<<<
-[[upd_ordered]]
-=== UPD_ORDERED
-
-[cols="25%h,75%"]
-|===
-| Category                    | Influencing Query Plans
-| Description                 | Controls whether rows should be inserted, updated, or deleted in clustering key order.
-| Values                      | 'ON'    The optimizer generates and considers plans where the rows are inserted, updated, or deleted in clustering key order. +
-'OFF'   The optimizer does not generate plans where the rows must be inserted, updated, or deleted in clustering key order.
- +
-The default value is 'ON'.
-| Usage                       | Inserting, updating or deleting rows in the clustering key order is most efficient and highly recommended. Turning this CQD OFF may result in
-saving the data sorting cost but at the expense of having less efficient random I/O Insert/Update/Delete operations. +
- +
-If you know that the data is already sorted in clustering key order, or is mostly in clustering key order,
-so that it would not result in random I/O, you could set this CQD to OFF.
-| Production Usage            | Not applicable.
-| Impact                      | If turned OFF, the system may perform large number of inefficient Random I/Os when performing Insert/Update/Delete operations.
-| Level                       | Query
-| Conflicts/Synergies         | Not applicable.
-| Addressing the Real Problem | Not applicable.
-|===
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/sql_reference/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/introduction.adoc b/docs/sql_reference/src/asciidoc/_chapters/introduction.adoc
index ea73f2a..2badda6 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/introduction.adoc
@@ -71,7 +71,8 @@ You can use Trafodion SQL statements to read, update, and create HBase tables.
 * <<trafodion_sql_tables_versus_native_hbase_tables,Trafodion SQL Tables Versus Native HBase Tables>>
 * <<supported_sql_statements_with_hbase_tables,Supported SQL Statements With HBase Tables>>
 
-For a list of Control Query Default (CQD) settings for the HBase environment, see <<HBase_Environment_CQDs,HBase Environment CQDs>>.
+For a list of Control Query Default (CQD) settings for the HBase environment, see the
+http://trafodion.incubator.apache.org/docs/cqd_reference/index.hmtl[Trafodion Control Query Default (CQD) Reference Guide].
 
 [[ways_to_access_hbase_tables]]
 === Ways to Access HBase Tables
@@ -223,7 +224,8 @@ You can use Trafodion SQL statements to access Hive tables.
 * <<type_mapping_from_hive_to_trafodion_sql,Type Mapping From Hive to Trafodion SQL>>
 * <<supported_sql_statements_with_hive_tables,Supported SQL Statements With Hive Tables>>
 
-For a list of Control Query Default (CQD) settings for the Hive environment, see <<Hive_Environment_CQDs,Hive Environment CQDs>>.
+For a list of Control Query Default (CQD) settings for the Hive environment, see the
+http://trafodion.incubator.apache.org/docs/cqd_reference/index.hmtl[Trafodion Control Query Default (CQD) Reference Guide].
 
 [[ansi_names_for_hive_tables]]
 === ANSI Names for Hive Tables
@@ -239,7 +241,7 @@ This example should work if a Hive table named `T` has already been defined:
 ```
 set schema hive.hive;
 
-cqd hive_max_string_length '20'; -- creates a more readable display
+CQD HIVE_MAX_STRING_LENGTH '20'; -- creates a more readable display
 select * from t; -- implicit table name
 
 set schema trafodion.seabase;
@@ -267,7 +269,8 @@ Trafodion performs the following data-type mappings:
 | `timestamp`           | `timestamp(6)`^2^
 |===
 
-1. The value `_n_` is determined by `CQD HIVE_MAX_STRING_LENGTH`. See <<hive_environment_cqds,Hive Environment CQDs>>.
+1. The value `_n_` is determined by `CQD HIVE_MAX_STRING_LENGTH`. See the
+http://trafodion.incubator.apache.org/docs/cqd_reference/index.hmtl[Trafodion Control Query Default (CQD) Reference Guide].
 2. Hive supports timestamps with nanosecond resolution (precision of 9). Trafodion SQL supports only microsecond resolution (precision 6).
 
 [[supported_sql_statements_with_hive_tables]]

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
index 80ce893..2a33dcc 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
@@ -1086,7 +1086,7 @@ control-default-option is:
 * `_attribute_`
 +
 is a character string that represents an attribute name. For descriptions of these attributes,
-see <<Control_Query_Default_Attributes,Control Query Default (CQD) Attributes>>.
+see the http://trafodion.incubator.apache.org/docs/cqd_reference/index.html[Trafodion Control Query Default (CQD) Reference Guide].
 
 * `_attr-value_`
 +
@@ -7444,8 +7444,8 @@ see the <<control_query default_statement,Control Query Default Statement>>.
 * `_attribute-name_[, MATCH {FULL | PARTIAL }]`
 +
 displays only the defaults that match, either fully or partially, the _attribute_ used in CONTROL QUERY DEFAULT
-statements. The match is not case-sensitive. For descriptions of these attributes, see
-<<control_query_default_attributes,CONTROL QUERY (CQD) DEFAULT Attributes>>.
+statements. The match is not case-sensitive. For descriptions of these attributes, see the
+http://trafodion.incubator.apache.org/docs/cqd_reference/index.html[Trafodion Control Query Default (CQD) Reference Guide].
 +
 MATCH FULL specifies that _attribute-name_ must be the same as the attribute name used in a control query default
 statement. match partial specifies that _attribute-name_ must be included in the attribute name used in a control

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/sql_reference/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/index.adoc b/docs/sql_reference/src/asciidoc/index.adoc
index f874749..0d8f81e 100644
--- a/docs/sql_reference/src/asciidoc/index.adoc
+++ b/docs/sql_reference/src/asciidoc/index.adoc
@@ -72,7 +72,6 @@ include::asciidoc/_chapters/sql_functions_and_expressions.adoc[]
 include::asciidoc/_chapters/olap_functions.adoc[]
 include::asciidoc/_chapters/runtime_stats.adoc[]
 include::asciidoc/_chapters/reserved_words.adoc[]
-include::asciidoc/_chapters/cqds.adoc[]
 include::asciidoc/_chapters/limits.adoc[]
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/src/site/markdown/documentation.md
----------------------------------------------------------------------
diff --git a/docs/src/site/markdown/documentation.md b/docs/src/site/markdown/documentation.md
index 720f8cf..a3848eb 100644
--- a/docs/src/site/markdown/documentation.md
+++ b/docs/src/site/markdown/documentation.md
@@ -16,40 +16,46 @@ This page provides links to the per-release Trafodion documentation.
 
 # Latest
 
-Document                                       | Formats
------------------------------------------------|-----------------------------------
-Trafodion Client Installation Guide            | [Web Book](docs/client_install/index.html),[PDF](docs/client_install/Trafodion_Client_Installation_Guide.pdf)
-Trafodion Command Interface Guide              | [Web Book](docs/command_interface/index.html),[PDF](docs/command_interface/Trafodion_Command_Interface_Guide.pdf)
-Trafodion Database Connectivity Services Guide | [Web Book](docs/dcs_reference/index.html),[API](docs/dcs_reference/apidocs/index.html)
-Trafodion Messages Guide                       | [Web Book](docs/messages_guide/index.html),[PDF](docs/messages_guide/Trafodion_Messages_Guide.pdf)
-Trafodion odb User Guide                       | [Web Book](docs/odb/index.html),[PDF](docs/odb/Trafodion_odb_User_Guide.pdf)
-Trafodion Provisioning Guide                   | [Web Book](docs/provisioning_guide/index.html),[PDF](docs/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
-Trafodion REST Server Reference Guide          | [Web Book](docs/rest_reference/index.html),[API](docs/rest_reference/apidocs/index.html)
-Trafodion SQL Reference Manual                 | [Web Book](docs/sql_reference/index.html),[PDF](docs/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
+Document                                              | Formats
+------------------------------------------------------|-----------------------------------
+Trafodion Client Installation Guide                   | [Web Book](docs/client_install/index.html),[PDF](docs/client_install/Trafodion_Client_Installation_Guide.pdf)
+Trafodion Command Interface Guide                     | [Web Book](docs/command_interface/index.html),[PDF](docs/command_interface/Trafodion_Command_Interface_Guide.pdf)
+Trafodion Control Query Default (CQD) Reference Guide | [Web Book](docs/cqd_reference/index.html),[PDF](docs/cqd_interface/Trafodion_CQD_Reference_Guide.pdf)
+Trafodion Database Connectivity Services Guide        | [Web Book](docs/dcs_reference/index.html),[API](docs/dcs_reference/apidocs/index.html)
+Trafodion Load and Transform Guide                    | [Web Book](docs/load_transform/index.html),[PDF](docs/load_transform/Trafodion_Load_Transform_Guide.pdf)
+Trafodion Messages Guide                              | [Web Book](docs/messages_guide/index.html),[PDF](docs/messages_guide/Trafodion_Messages_Guide.pdf)
+Trafodion odb User Guide                              | [Web Book](docs/odb/index.html),[PDF](docs/odb/Trafodion_odb_User_Guide.pdf)
+Trafodion Provisioning Guide                          | [Web Book](docs/provisioning_guide/index.html),[PDF](docs/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
+Trafodion REST Server Reference Guide                 | [Web Book](docs/rest_reference/index.html),[API](docs/rest_reference/apidocs/index.html)
+Trafodion SQL Reference Manual                        | [Web Book](docs/sql_reference/index.html),[PDF](docs/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
 
 # 2.0.0 (In Development)
 
-Document                                       | Formats
------------------------------------------------|-----------------------------------
-Trafodion Client Installation Guide            | [Web Book](docs/2.0.0/client_install/index.html),[PDF](docs/2.0.0/client_install/Trafodion_Client_Installation_Guide.pdf)
-Trafodion Command Interface Guide              | [Web Book](docs/2.0.0/command_interface/index.html),[PDF](docs/2.0.0/command_interface/Trafodion_Command_Interface_Guide.pdf)
-Trafodion Database Connectivity Services Guide | [Web Book](docs/2.0.0/dcs_reference/index.html),[API](docs/2.0.0/dcs_reference/apidocs/index.html)
-Trafodion Messages Guide                       | [Web Book](docs/2.0.0/messages_guide/index.html),[PDF](docs/2.0.0/messages_guide/Trafodion_Messages_Guide.pdf)
-Trafodion odb User Guide                       | [Web Book](docs/2.0.0/odb/index.html),[PDF](docs/2.0.0/odb/Trafodion_odb_User_Guide.pdf)
-Trafodion Provisioning Guide                   | [Web Book](docs/2.0.0/provisioning_guide/index.html),[PDF](docs/2.0.0/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
-Trafodion REST Server Reference Guide          | [Web Book](docs/2.0.0/rest_reference/index.html),[API](docs/2.0.0/rest_reference/apidocs/index.html)
-Trafodion SQL Reference Manual                 | [Web Book](docs/2.0.0/sql_reference/index.html),[PDF](docs/2.0.0/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
+Document                                              | Formats
+------------------------------------------------------|-----------------------------------
+Trafodion Client Installation Guide                   | [Web Book](docs/2.0.0/client_install/index.html),[PDF](docs/2.0.0/client_install/Trafodion_Client_Installation_Guide.pdf)
+Trafodion Command Interface Guide                     | [Web Book](docs/2.0.0/command_interface/index.html),[PDF](docs/2.0.0/command_interface/Trafodion_Command_Interface_Guide.pdf)
+Trafodion Control Query Default (CQD) Reference Guide | [Web Book](docs/2.0.0/cqd_reference/index.html),[PDF](docs/2.0.0/cqd_interface/Trafodion_CQD_Reference_Guide.pdf)
+Trafodion Database Connectivity Services Guide        | [Web Book](docs/2.0.0/dcs_reference/index.html),[API](docs/2.0.0/dcs_reference/apidocs/index.html)
+Trafodion Load and Transform Guide                    | [Web Book](docs/2.0.0/load_transform/index.html),[PDF](docs/2.0.0/load_transform/Trafodion_Load_Transform_Guide.pdf)
+Trafodion Messages Guide                              | [Web Book](docs/2.0.0/messages_guide/index.html),[PDF](docs/2.0.0/messages_guide/Trafodion_Messages_Guide.pdf)
+Trafodion odb User Guide                              | [Web Book](docs/2.0.0/odb/index.html),[PDF](docs/2.0.0/odb/Trafodion_odb_User_Guide.pdf)
+Trafodion Provisioning Guide                          | [Web Book](docs/2.0.0/provisioning_guide/index.html),[PDF](docs/2.0.0/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
+Trafodion REST Server Reference Guide                 | [Web Book](docs/2.0.0/rest_reference/index.html),[API](docs/2.0.0/rest_reference/apidocs/index.html)
+Trafodion SQL Reference Manual                        | [Web Book](docs/2.0.0/sql_reference/index.html),[PDF](docs/2.0.0/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
 
 # 1.3.0
 
-Document                                       | Formats
------------------------------------------------|-----------------------------------
-Trafodion Client Installation Guide            | [Web Book](docs/1.3.0/client_install/index.html),[PDF](docs/1.3.0/client_install/Trafodion_Client_Installation_Guide.pdf)
-Trafodion Command Interface Guide              | [Web Book](docs/1.3.0/command_interface/index.html),[PDF](docs/1.3.0/command_interface/Trafodion_Command_Interface_Guide.pdf)
-Trafodion Database Connectivity Services Guide | [Web Book](docs/1.3.0/dcs_reference/index.html),[API](docs/1.3.0/dcs_reference/apidocs/index.html)
-Trafodion Messages Guide                       | [Web Book](docs/1.3.0/messages_guide/index.html),[PDF](docs/1.3.0/messages_guide/Trafodion_Messages_Guide.pdf)
-Trafodion odb User Guide                       | [Web Book](docs/1.3.0/odb/index.html),[PDF](docs/1.3.0/odb/Trafodion_odb_User_Guide.pdf)
-Trafodion Provisioning Guide                   | [Web Book](docs/1.3.0/provisioning_guide/index.html),[PDF](docs/1.3.0/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
-Trafodion REST Server Reference Guide          | [Web Book](docs/1.3.0/rest_reference/index.html),[API](docs/1.3.0/rest_reference/apidocs/index.html)
-Trafodion SQL Reference Manual                 | [Web Book](docs/1.3.0/sql_reference/index.html),[PDF](docs/1.3.0/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
+Document                                              | Formats
+------------------------------------------------------|-----------------------------------
+Trafodion Client Installation Guide                   | [Web Book](docs/1.3.0/client_install/index.html),[PDF](docs/1.3.0/client_install/Trafodion_Client_Installation_Guide.pdf)
+Trafodion Command Interface Guide                     | [Web Book](docs/1.3.0/command_interface/index.html),[PDF](docs/1.3.0/command_interface/Trafodion_Command_Interface_Guide.pdf)
+Trafodion Control Query Default (CQD) Reference Guide | [Web Book](docs/1.3.0/cqd_reference/index.html),[PDF](docs/1.3.0/cqd_interface/Trafodion_CQD_Reference_Guide.pdf)
+Trafodion Database Connectivity Services Guide        | [Web Book](docs/1.3.0/dcs_reference/index.html),[API](docs/1.3.0/dcs_reference/apidocs/index.html)
+Trafodion Load and Transform Guide                    | [Web Book](docs/1.3.0/load_transform/index.html),[PDF](docs/1.3.0/load_transform/Trafodion_Load_Transform_Guide.pdf)
+Trafodion Messages Guide                              | [Web Book](docs/1.3.0/messages_guide/index.html),[PDF](docs/1.3.0/messages_guide/Trafodion_Messages_Guide.pdf)
+Trafodion odb User Guide                              | [Web Book](docs/1.3.0/odb/index.html),[PDF](docs/1.3.0/odb/Trafodion_odb_User_Guide.pdf)
+Trafodion Provisioning Guide                          | [Web Book](docs/1.3.0/provisioning_guide/index.html),[PDF](docs/1.3.0/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
+Trafodion REST Server Reference Guide                 | [Web Book](docs/1.3.0/rest_reference/index.html),[API](docs/1.3.0/rest_reference/apidocs/index.html)
+Trafodion SQL Reference Manual                        | [Web Book](docs/1.3.0/sql_reference/index.html),[PDF](docs/1.3.0/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/src/site/markdown/logo.md
----------------------------------------------------------------------
diff --git a/docs/src/site/markdown/logo.md b/docs/src/site/markdown/logo.md
index f621a28..7dacd5f 100644
--- a/docs/src/site/markdown/logo.md
+++ b/docs/src/site/markdown/logo.md
@@ -44,7 +44,7 @@ when referencing our project. Download as needed.
 
 #### [trafodion-logo.jpg][3]
 
-[![Trafodion Logo jog](images/logos/trafodion-logo.jpg)][3]
+[![Trafodion Logo jpg](images/logos/trafodion-logo.jpg)][3]
 
 [3]: images/logos/trafodion-logo.jpg
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/src/site/resources/images/logos/pb-Trafodion.png
----------------------------------------------------------------------
diff --git a/docs/src/site/resources/images/logos/pb-Trafodion.png b/docs/src/site/resources/images/logos/pb-Trafodion.png
deleted file mode 100644
index 67643a4..0000000
Binary files a/docs/src/site/resources/images/logos/pb-Trafodion.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/src/site/resources/images/logos/pb-trafodion.png
----------------------------------------------------------------------
diff --git a/docs/src/site/resources/images/logos/pb-trafodion.png b/docs/src/site/resources/images/logos/pb-trafodion.png
new file mode 100644
index 0000000..67643a4
Binary files /dev/null and b/docs/src/site/resources/images/logos/pb-trafodion.png differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/docs/src/site/site.xml
----------------------------------------------------------------------
diff --git a/docs/src/site/site.xml b/docs/src/site/site.xml
index cf130d6..27b0f16 100644
--- a/docs/src/site/site.xml
+++ b/docs/src/site/site.xml
@@ -206,6 +206,7 @@
       <item href="faq.html" name="FAQ"/>
       <item href="release-notes.html" name="Release Notes"/>
       <item href="https://cwiki.apache.org/confluence/display/TRAFODION/Apache+Trafodion+Home" name="Wiki"/>
+      <item name="Videos" href="https://www.youtube.com/playlist?list=PLyyCp3HBB8Tv9696OnG0_mmgF5tfHeyOi"/>
       <item href="management.html" name="Managing Trafodion"/>
       <!-- item href="new-features.html" name="New Features"/-->
       <!-- item href="roadmap.html" name="Roadmap"/-->

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/checkHBase
----------------------------------------------------------------------
diff --git a/install/installer/checkHBase b/install/installer/checkHBase
new file mode 100755
index 0000000..354ed1a
--- /dev/null
+++ b/install/installer/checkHBase
@@ -0,0 +1,37 @@
+#!/bin/bash
+# @@@ 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 @@@
+
+echo "**INFO: Checking HBase status" 
+
+
+echo 'status' | hbase shell -n | grep "0 dead"
+
+status=$?
+
+if [[ "$status" -ne 0 ]]; then
+   echo "***ERROR: HBase not up"
+   echo "***ERROR: HBase MUST be installed and up for installation"
+   exit -1
+else
+   echo "***INFO: HBase up and running"
+   echo
+fi

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/dcs_installer
----------------------------------------------------------------------
diff --git a/install/installer/dcs_installer b/install/installer/dcs_installer
index 5d71aab..b07a748 100755
--- a/install/installer/dcs_installer
+++ b/install/installer/dcs_installer
@@ -110,7 +110,7 @@ while [[ $# -gt 0 ]]; do
 done
 
 checkOpts
-
+source $TRAF_CONFIG
 echo "***INFO: Start of DCS install"
 
 # Make sure required env vars have been set first
@@ -155,12 +155,6 @@ rm dcs-env.temp 2>/dev/null
 
 
 echo "***INFO: modifying $DCS_DIR/conf/dcs-site.xml"
-# get zookeeper quorum
-
-lineNumber=$(grep -n "zookeeper\.quorum" $TRAF_WORKDIR/hbase-site.xml | sed 's/\:.*//')
-lineNumber=$((lineNumber+1))
-
-ZOOKEEPER_NODES=$(sed "$lineNumber!d" $TRAF_WORKDIR/hbase-site.xml | sed 's/\/value.*//' | sed 's/.*>//' | sed 's/.$//')
 
 # add zookeeper quorum property to end of configuration
 rm dcs-site.temp 2>/dev/null

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/parseHBaseSite.py
----------------------------------------------------------------------
diff --git a/install/installer/parseHBaseSite.py b/install/installer/parseHBaseSite.py
new file mode 100755
index 0000000..4fb5905
--- /dev/null
+++ b/install/installer/parseHBaseSite.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+# @@@ 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 @@@
+
+
+import os
+
+import xml.etree.ElementTree as ET
+
+hbaseMaster="hbase.master.info.port"
+hbaseRegion="hbase.regionserver.info.port"
+zooKeeperNodes="hbase.zookeeper.quorum"
+pathToHome= os.environ['HOME']
+
+hbaseMasterInfoPort="60010"
+regionServerInfoPort="60030"
+zookeeperNodeNames=""
+
+tree = ET.parse( pathToHome + '/hbase-site.xml')
+
+root = tree.getroot()
+
+
+for x in root.findall('property'):
+    name = str(x.find('name').text)
+    if name == hbaseMaster:
+       hbaseMasterInfoPort = x.find('value').text
+    if name == hbaseRegion:
+       regionServerInfoPort = x.find('value').text
+    if name == zooKeeperNodes:
+       zookeeperNodeNames = x.find('value').text
+
+f = open( '/etc/trafodion/trafodion_config', 'a')
+f.write ( 'export HBASE_MASTER_INFO_PORT="' + hbaseMasterInfoPort + '"\n' )
+f.write ( 'export REGIONSERVER_INFO_PORT="' + regionServerInfoPort + '"\n' )
+f.write ( 'export ZOOKEEPER_NODES="' + zookeeperNodeNames + '"\n' )
+f.close()

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_add_sudoAccess
----------------------------------------------------------------------
diff --git a/install/installer/traf_add_sudoAccess b/install/installer/traf_add_sudoAccess
index 9440977..23fd67f 100755
--- a/install/installer/traf_add_sudoAccess
+++ b/install/installer/traf_add_sudoAccess
@@ -38,7 +38,9 @@ echo "%trafodion ALL = NOPASSWD: IP, ARP" >> $sudoFile
 
 function backupRestore {
 
-echo "## Allow $BACKUP_USER id to run commands needed for backup and restore" >> $BACKUP_USER
+source $TRAF_CONFIG
+
+echo "## Allow $BACKUP_USER id to run commands needed for backup and restore" > $BACKUP_USER
 echo "%$BACKUP_USER ALL =(hbase) NOPASSWD: /usr/bin/hbase" >> $BACKUP_USER
 
 }
@@ -73,7 +75,7 @@ fi
 echo "***INFO: Creating $TRAF_USER sudo access file"
 echo
 
-if [[ "$ENABLE_HA" == "Y" ]]; then
+if [[ "$ENABLE_HA" == "true" ]]; then
    haSudoAdd
    copyTrafFile
 fi 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_cloudera_mods98
----------------------------------------------------------------------
diff --git a/install/installer/traf_cloudera_mods98 b/install/installer/traf_cloudera_mods98
index b8da481..edb09e1 100755
--- a/install/installer/traf_cloudera_mods98
+++ b/install/installer/traf_cloudera_mods98
@@ -39,23 +39,18 @@ export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES"
 cd $UNTAR_DIR
 
 # determine java version for hbase 0.98 only java 1.7 is allowed
-echo "***INFO: Detected JAVA version $JAVA_VERSION"
-if [ "$JAVA_VERSION" == "1.6" ]; then
-   echo "***ERROR: Java 1.6 not supported for Trafodion HBase 0.98"
-   exit -1
-elif [ "$JAVA_VERSION" == "1.7" ]; then
-   if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
-      if [[ $CDH_5_4_SUPPORT == "Y" ]]; then
+if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
+   if [[ $CDH_5_4_SUPPORT == "Y" ]] || [[ $CDH_5_5_SUPPORT == "Y" ]]; then
+      if [[ $CDH_VERSION == "5.4" ]]; then
          hbase_trx_jar="hbase-trx-cdh5_4-${TRAF_VERSION}.jar"
       else
-         hbase_trx_jar="hbase-trx-${TRAF_VERSION}.jar" 
-      fi 
+         hbase_trx_jar="hbase-trx-cdh5_5-${TRAF_VERSION}.jar"
+      fi
    else
-      hbase_trx_jar="hbase-trx-cdh5_3-${TRAF_VERSION}.jar"
-   fi
+      hbase_trx_jar="hbase-trx-${TRAF_VERSION}.jar" 
+   fi 
 else
-    echo "***ERROR: unable to determine Hadoop's java version"
-    exit -1
+    hbase_trx_jar="hbase-trx-cdh5_3-${TRAF_VERSION}.jar"
 fi
 
 traf_util_jar="trafodion-utility-${TRAF_VERSION}.jar"
@@ -109,6 +104,25 @@ else
     ssh -q -n $node sudo chmod 644 $HADOOP_PATH/$traf_util_jar
     done
 fi
+
+#====================================
+#Make sure hbase-trx*jar got copied
+
+for node in $HADOOP_NODES
+do
+   copiedOver=$(ssh -q -n $node sudo ls $HADOOP_PATH/hbase-trx* | wc -l)
+   if [[ $copiedOver -ne "1" ]]; then
+      echo "***ERROR: $hbase_trx_jar was not copied on $node"
+      echo "***ERROR: Please investigate why this happened"
+      echo "***ERROR: Trafodion can not start without this. EXITING..."
+      exit -1
+   fi
+done
+
+echo "***INFO: $hbase_trx_jar copied correctly! Huzzah."
+
+
+
 #=====================================
 # create new directories for bulkload and lobs if not already there
 rm $LOCAL_WORKDIR/traf_temp_output 2>/dev/null

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_config_check
----------------------------------------------------------------------
diff --git a/install/installer/traf_config_check b/install/installer/traf_config_check
index 95e3f4a..a1ed2e9 100755
--- a/install/installer/traf_config_check
+++ b/install/installer/traf_config_check
@@ -426,10 +426,15 @@ else
          fi
        done
     fi
-    export PATH=$PATH:$JAVA_HOME/bin
+    hadoopPath="$HADOOP_PATH"
+    hadoopBinPath="$HADOOP_BIN_PATH"
+
+    export PATH="$PATH:$JAVA_HOME/bin"
     sudo chmod 777 $TRAF_CONFIG
     sed -i '/PATH\=/d' $TRAF_CONFIG
     echo "export PATH=\"$PATH\"" >>$TRAF_CONFIG
+    echo "export HADOOP_BIN_PATH=\"$hadoopBinPath\"" >>$TRAF_CONFIG
+    echo "export HADOOP_PATH=\"$hadoopPath\"" >>$TRAF_CONFIG
     sudo chmod 777 $TRAF_CONFIG
     source $TRAF_CONFIG
 fi
@@ -489,11 +494,15 @@ fi
 
 function checkBackupUser {
 
+TRAF_CONFIG="/etc/trafodion/trafodion_config"
+
+source $TRAF_CONFIG
+
 if [ -z $BACKUP_USER ]; then
    echo "***ERROR: BACKUP_USER variable not set in config file."
    echo "***WARNING: BACKUP_USER will be set to trafodion."
    sudo chmod 777 $TRAF_CONFIG
-   sudo "export BACKUP_USER=\"trafodion\"" >> $TRAF_CONFIG
+   sudo echo "export BACKUP_USER=\"trafodion\"" >> $TRAF_CONFIG
    sudo chmod 777 $TRAF_CONFIG
 fi
 
@@ -647,11 +656,11 @@ function checkClouderaVersion {
 
 if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
    #Check that Cloudera 5.2 or 5.3 are not installed.
-   if [[ "$CDH_5_4_SUPPORT" == "Y" ]]; then
-      nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/.*\-//' | grep cdh5.4.*)
+   if [[ "$CDH_5_4_SUPPORT" == "Y" ]] || [[ "$CDH_5_5_SUPPORT" == "Y" ]]; then
+      nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/.*\-//' | grep cdh5.[4-5].*)
       #Check that Cloudera 5.[n>4].* is not installed.
       if [[ -z $nameOfVersion ]]; then
-         versionInstalled=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/.*\-//' | grep cdh[5-6].[0-9].* | wc -l)
+         versionInstalled=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/.*\-//' | grep cdh[6-9].[0-9].* | wc -l)
          if [[ $versionInstalled -gt "0" ]]; then
             errorFound=1
             echo "HADOOP VERSION" >> $ERROR_LOG
@@ -686,18 +695,7 @@ else
    fi
 fi
 
-export HADOOP_PATH="/usr/lib/hbase/lib"
-#Check for Cloudera parcels of packages.
-parcelsInstalled=$(ssh -q -n $node sudo ls /opt/cloudera/parcels/ | wc -l)
-if [[ $parcelsInstalled -gt "0" ]]; then
-   export HADOOP_PATH="/opt/cloudera/parcels/CDH/lib/hbase/lib"
-fi
-
 echo "***INFO: nameOfVersion=$nameOfVersion"
-echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/HADOOP_PATH\=/d' $TRAF_CONFIG
-echo "export HADOOP_PATH=\"$HADOOP_PATH\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
 source $TRAF_CONFIG
 
@@ -727,9 +725,8 @@ if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
             ssh -q -n $node cat hbaseVersion.txt >> $ERROR_LOG
          fi
        fi
-       export HADOOP_PATH="/usr/lib/hbase/lib"
    else
-       nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/-.*//' | grep 2.3.*)
+       nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/-.*//' | grep 2.[3-4].*)
        #Check that HDP 2.[n>3].* is not installed.
        if [[ -z $nameOfVersion ]]; then
           versionInstalled=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/-.*//' | sed 's/Version [0-9]*.[0-9]*.[0-9].//g' | grep [1-3].[0-9].* | wc -l)
@@ -741,7 +738,6 @@ if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
              ssh -q -n $node cat hbaseVersion.txt >> $ERROR_LOG
           fi
        fi
-   export HADOOP_PATH="/usr/hdp/current/hbase-regionserver/lib"
    fi
 else
    nameOfVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/,.*//' | sed 's/-.*//' | grep 2.2.*)
@@ -758,14 +754,9 @@ if [[ -z $nameOfVersion ]]; then
       ssh -q -n $node cat hbaseVersion.txt >> $ERROR_LOG
    fi
 fi
-export HADOOP_PATH="/usr/hdp/current/hbase-regionserver/lib"
 
 echo "***INFO: nameOfVersion=$nameOfVersion"
 echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/HADOOP_PATH\=/d' $TRAF_CONFIG
-echo "export HADOOP_PATH=\"$HADOOP_PATH\"" >> $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
 source $TRAF_CONFIG
 
 }
@@ -877,6 +868,15 @@ if [[ ! -z $install_features_path ]]; then
    sudo chmod 777 $TRAF_CONFIG
    echo "export CDH_5_3_HDP_2_2_SUPPORT=\"$CDH_5_3_HDP_2_2_SUPPORT\"" >> $TRAF_CONFIG
    sudo chmod 777 $TRAF_CONFIG
+   if [[ -z $CDH_5_5_SUPPORT ]]; then
+      sudo chmod 777 $TRAF_CONFIG
+      echo "export CDH_5_5_SUPPORT=\"N\"" >> $TRAF_CONFIG
+      sudo chmod 777 $TRAF_CONFIG
+   else
+      sudo chmod 777 $TRAF_CONFIG
+      echo "export CDH_5_5_SUPPORT=\"$CDH_5_5_SUPPORT\"" >> $TRAF_CONFIG
+      sudo chmod 777 $TRAF_CONFIG
+   fi 
    if [[ -z $CDH_5_4_SUPPORT ]]; then
       sudo chmod 777 $TRAF_CONFIG
       echo "export CDH_5_4_SUPPORT=\"N\"" >> $TRAF_CONFIG
@@ -898,10 +898,12 @@ if [[ ! -z $install_features_path ]]; then
 else
    CDH_5_3_HDP_2_2_SUPPORT="N"
    CDH_5_4_SUPPORT="N"
+   CDH_5_5_SUPPORT="N"
    HDP_2_3_SUPPORT="N"
    sudo chmod 777 $TRAF_CONFIG
    echo "export CDH_5_3_HDP_2_2_SUPPORT=\"$CDH_5_3_HDP_2_2_SUPPORT\"" >> $TRAF_CONFIG
    echo "export CDH_5_4_SUPPORT=\"$CDH_5_4_SUPPORT\"" >> $TRAF_CONFIG
+   echo "export CDH_5_5_SUPPORT=\"$CDH_5_5_SUPPORT\"" >> $TRAF_CONFIG
    echo "export HDP_2_3_SUPPORT=\"$HDP_2_3_SUPPORT\"" >> $TRAF_CONFIG
    sudo chmod 777 $TRAF_CONFIG
 fi
@@ -912,11 +914,7 @@ fi
 #===========================================
 #Main 
 
-echo
-echo "************************************"
-echo " Trafodion Configuration File Check"
-echo "************************************"
-echo
+echo " ***INFO: Trafodion Configuration File Check"
 
 setUpErrorLog
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_config_setup
----------------------------------------------------------------------
diff --git a/install/installer/traf_config_setup b/install/installer/traf_config_setup
index 4837ca1..63704d5 100755
--- a/install/installer/traf_config_setup
+++ b/install/installer/traf_config_setup
@@ -395,6 +395,7 @@ echo "export UTT_INSTALL=\"$UTT_INSTALL\"" >> $LOCAL_TRAF_CONFIG
 
 #==============================================
 #Backup restore user
+export BACKUP_USER="trafodion"
 
 echo -n "Enter Backup/Restore username (can be Trafodion), default is [$BACKUP_USER]: "
 read answer
@@ -791,8 +792,6 @@ sudo mkdir -p $TRAF_CONFIG_DIR
 sudo chmod 777 $TRAF_CONFIG_DIR
 sudo cp $LOCAL_TRAF_CONFIG $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
-echo "***INFO: Configuration file: $TRAF_CONFIG"
-
 
 #==============================================
 #Call user defined prompting script

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_getHadoopNodes
----------------------------------------------------------------------
diff --git a/install/installer/traf_getHadoopNodes b/install/installer/traf_getHadoopNodes
index 127d0c2..e397d4a 100755
--- a/install/installer/traf_getHadoopNodes
+++ b/install/installer/traf_getHadoopNodes
@@ -25,22 +25,23 @@ source /etc/trafodion/trafodion_config
 TRAF_CONFIG=/etc/trafodion/trafodion_config
 
 
-echo "***INFO: Getting list of all $HADOOP_TYPE nodes"
-
 curlRC=0
-if [[ $HADOOP_TYPE == "cloudera" ]]; then
+if [ $HADOOP_TYPE == "cloudera" ]; then
    curl -k -su $ADMIN:$PASSWORD $URL/api/v10/hosts > tempFile
    curlRC=$?
    numberHadoopNodes=$(grep -r "hostname" tempFile | wc -l)
    grep -r "hostname" tempFile > tempFile2
 
-   if [[ -d /opt/cloudera/parcels/CDH ]]; then
-      HADOOP_PATH="/opt/cloudera/parcels/CDH/lib/hbase/lib"
-      HADOOP_BIN_PATH="/opt/cloudera/parcels/CDH/bin"
+   if [ -d /opt/cloudera/parcels/CDH ]; then
+      export HADOOP_PATH="/opt/cloudera/parcels/CDH/lib/hbase/lib"
+      export HADOOP_BIN_PATH="/opt/cloudera/parcels/CDH/bin"
    else
-      HADOOP_PATH="/usr/lib/hbase/lib"
-      HADOOP_BIN_PATH="/usr/bin"
+      export HADOOP_PATH="/usr/lib/hbase/lib"
+      export HADOOP_BIN_PATH="/usr/bin"
    fi
+  echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
+  echo "***INFO: HADOOP_BIN_PATH=$HADOOP_BIN_PATH"
+
 fi
 
 if [[ $HADOOP_TYPE == "hortonworks" ]]; then
@@ -49,11 +50,13 @@ if [[ $HADOOP_TYPE == "hortonworks" ]]; then
    numberHadoopNodes=$(grep -r "host_name" tempFile | wc -l)
    grep -r "host_name" tempFile > tempFile2
 
-   if [[ -d /usr/lib/hbase/lib ]]; then
+   if [ -d /usr/lib/hbase/lib ]; then
       HADOOP_PATH="/usr/lib/hbase/lib"
    else
       HADOOP_PATH="/usr/hdp/current/hbase-regionserver/lib"
    fi
+   echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
+
 fi
 
 if [ $curlRC != 0 ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_hortonworks_mods98
----------------------------------------------------------------------
diff --git a/install/installer/traf_hortonworks_mods98 b/install/installer/traf_hortonworks_mods98
index 7d2be7e..cffb3be 100755
--- a/install/installer/traf_hortonworks_mods98
+++ b/install/installer/traf_hortonworks_mods98
@@ -41,29 +41,20 @@ export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES"
 cd $UNTAR_DIR
 
 PORT=`echo $URL | sed 's/.*://'`
-AMBARI_HOST=$(echo $URL | sed 's@:.*@@')
+AMBARI_HOST=$(echo $URL | sed 's@.*://@@' | sed 's@:.*@@')
 echo "export AMBARI_HOST=\"$AMBARI_HOST\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
 source $TRAF_CONFIG
 
 #determine java version and choose corresponding jar files
-echo "***INFO: Detected JAVA version $JAVA_VERSION"
-if [ "$JAVA_VERSION" == "1.6" ]; then
-   echo "***ERROR: JAVA 1.6 not supported for Trafodion HBase 0.98"
-   exit -1
-elif [ "$JAVA_VERSION" == "1.7" ] || [ "$JAVA_VERSION" == "1.8" ]; then
-     if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
-        if [[ $HDP_2_3_SUPPORT == "Y" ]]; then
-           hbase_trx_jar="hbase-trx-hdp2_3-${TRAF_VERSION}.jar"
-        else
-	   hbase_trx_jar="hbase-trx-hdp2_1-${TRAF_VERSION}.jar"
-        fi
-     else
-        hbase_trx_jar="hbase-trx-hdp2_2-${TRAF_VERSION}.jar"
-     fi
+if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
+   if [[ $HDP_2_3_SUPPORT == "Y" ]]; then
+      hbase_trx_jar="hbase-trx-hdp2_3-${TRAF_VERSION}.jar"
+   else
+      hbase_trx_jar="hbase-trx-hdp2_1-${TRAF_VERSION}.jar"
+   fi
 else
-    echo "***ERROR: unable to determine Hadoop's java version"
-    exit -1
+   hbase_trx_jar="hbase-trx-hdp2_2-${TRAF_VERSION}.jar"
 fi
 
 traf_util_jar="trafodion-utility-${TRAF_VERSION}.jar"
@@ -120,6 +111,23 @@ else
     done
 fi
 
+#=======================================
+#Check that HBase-trx copied to all nodes
+
+for node in $HADOOP_NODES
+do
+   copiedOver=$(ssh -q -n $node sudo ls $HADOOP_PATH/hbase-trx* | wc -l)
+   if [[ $copiedOver -ne "1" ]]; then
+      echo "***ERROR: $hbase_trx_jar was not copied on $node"
+      echo "***ERROR: Please investigate why this happened"
+      echo "***ERROR: Trafodion can not start without this. EXITING..."
+      exit -1
+   fi
+done
+
+echo "***INFO: $hbase_trx_jar copied correctly! Huzzah."
+
+
 
 #Copy hbase-site.xml file
 ssh -q -n $AMBARI_HOST sudo cp /etc/hbase/conf/hbase-site.xml $HOME

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_package_setup
----------------------------------------------------------------------
diff --git a/install/installer/traf_package_setup b/install/installer/traf_package_setup
index dbf9a4a..d904090 100755
--- a/install/installer/traf_package_setup
+++ b/install/installer/traf_package_setup
@@ -151,7 +151,7 @@ if [[ $SUSE_LINUX == "false" ]]; then
    # it doesn't hurt if it was already enabled and we try to enable it again
    $TRAF_PDSH sudo yum-config-manager --enable RedHat-6-x86_64-Fedora-EPEL 2>> $YUM_LOG >> $YUM_LOG
 
-   package_list="sqlite expect perl-DBD-SQLite* protobuf xerces-c perl-Params-Validate perl-Time-HiRes gzip"
+   package_list="apr apr-util sqlite expect perl-DBD-SQLite* protobuf xerces-c perl-Params-Validate perl-Time-HiRes gzip"
    if [[ $internetAccess == "true" ]]; then
       for package in $package_list
       do

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/traf_sqgen
----------------------------------------------------------------------
diff --git a/install/installer/traf_sqgen b/install/installer/traf_sqgen
index d3e2da2..271e719 100755
--- a/install/installer/traf_sqgen
+++ b/install/installer/traf_sqgen
@@ -73,7 +73,7 @@ if [[ "$LDAP_SECURITY" == "Y" ]]; then
 
    #Check traf_authentication_config for errors
    echo "***INFO: Checking LDAP Configuration file for errors."
-   $SQ_ROOT/export/bin64/ldapconfigcheck -file $SQ_ROOT/sql/scripts/traf_authentication_config
+   $SQ_ROOT/export/bin${SQ_MBTYPE}/ldapconfigcheck -file $SQ_ROOT/sql/scripts/traf_authentication_config
    if [ "$?" != "0" ]; then
       echo "***ERROR: traf_authentication_config not configured correctly."
       echo "***ERROR: Install will continue WITHOUT simple security turned on."



[39/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/traf_cloudera_mods98
----------------------------------------------------------------------
diff --git a/install/installer/traf_cloudera_mods98 b/install/installer/traf_cloudera_mods98
index edb09e1..b86b2e5 100755
--- a/install/installer/traf_cloudera_mods98
+++ b/install/installer/traf_cloudera_mods98
@@ -31,8 +31,10 @@ source $TRAF_CONFIG
 export PDSH="pdsh -R exec"
 export PDSH_SSH_CMD="ssh -q -n %h"
 export PDCP="pdcp -R ssh"
-export PDSH_HADOOP_NODES="$PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD"
-export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES"
+export PDSH_HADOOP_NODES="$PDSH $MY_HBASE_NODES $PDSH_SSH_CMD"
+export PDCP_HADOOP_NODES="$PDCP $MY_HBASE_NODES"
+export HDFS_NODE=$(echo $HDFS_NODES | head -n1 | awk '{print $1;}')
+export HBASE_NODE=$(echo $HBASE_NODES | head -n1 | awk '{print $1;}')
 #=====================================
 # copy Trafodion trx jar to Cloudera's plugins directory on all nodes
 
@@ -42,18 +44,18 @@ cd $UNTAR_DIR
 if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
    if [[ $CDH_5_4_SUPPORT == "Y" ]] || [[ $CDH_5_5_SUPPORT == "Y" ]]; then
       if [[ $CDH_VERSION == "5.4" ]]; then
-         hbase_trx_jar="hbase-trx-cdh5_4-${TRAF_VERSION}.jar"
+         hbase_trx_jar="hbase-trx-cdh5_4-*.jar"
       else
-         hbase_trx_jar="hbase-trx-cdh5_5-${TRAF_VERSION}.jar"
+         hbase_trx_jar="hbase-trx-cdh5_5-*.jar"
       fi
    else
-      hbase_trx_jar="hbase-trx-${TRAF_VERSION}.jar" 
+      hbase_trx_jar="hbase-trx-*.jar" 
    fi 
 else
-    hbase_trx_jar="hbase-trx-cdh5_3-${TRAF_VERSION}.jar"
+    hbase_trx_jar="hbase-trx-cdh5_3-*.jar"
 fi
 
-traf_util_jar="trafodion-utility-${TRAF_VERSION}.jar"
+traf_util_jar="trafodion-utility-*.jar"
 
 
 # The permissions the Trafodion build process creates on the hbase-trx jar
@@ -87,7 +89,7 @@ if [ $node_count -ne 1 ]; then
     $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null
     $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null
 else
-    for node in $HADOOP_NODES
+    for node in $HBASE_NODES
     do
     ssh -q -n $node sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null
     ssh -q -n $node sudo rm -rf /usr/share/cmf/lib/plugins/hbase-trx* 2>/dev/null
@@ -108,7 +110,7 @@ fi
 #====================================
 #Make sure hbase-trx*jar got copied
 
-for node in $HADOOP_NODES
+for node in $HBASE_NODES
 do
    copiedOver=$(ssh -q -n $node sudo ls $HADOOP_PATH/hbase-trx* | wc -l)
    if [[ $copiedOver -ne "1" ]]; then
@@ -128,14 +130,20 @@ echo "***INFO: $hbase_trx_jar copied correctly! Huzzah."
 rm $LOCAL_WORKDIR/traf_temp_output 2>/dev/null
 
 #Copy hbase-site.xml file
-sudo cp /etc/hbase/conf/hbase-site.xml $HOME
-sudo chown $(whoami).$(whoami) $HOME/hbase-site.xml
-sudo chmod 777 $HOME/hbase-site.xml
+ssh -q -n $HBASE_NODE sudo cp /etc/hbase/conf/hbase-site.xml $HOME
+ssh -q -n $HBASE_NODE sudo chown "$(whoami)"."$(whoami)" "$HOME"/hbase-site.xml
+ssh -q -n $HBASE_NODE sudo chmod 777 $HOME/hbase-site.xml
+
+scp -q $(whoami)@$HBASE_NODE:$HOME/hbase-site.xml $HOME
+if [[ $? -gt 1 ]]; then
+   echo "***ERROR: Unable to find /etc/hbase/conf/hbase-site.xml file on $HBASE_NODE or unable to copy."
+   exit -1
+fi
 
 sudo cp $HOME/hbase-site.xml $TRAF_WORKDIR
 sudo chown trafodion.trafodion $TRAF_WORKDIR/hbase-site.xml
 
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -mkdir /hbase-staging" 2> $HOME/traf_temp_output
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -mkdir /hbase-staging" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
    dir_exists=$(grep "File exists" $HOME/traf_temp_output | wc -l)
@@ -146,8 +154,8 @@ if [ $? != 0 ]; then
    fi
 fi
 
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -chown -R $HBASE_USER:$HBASE_GROUP /hbase-staging"
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -mkdir /bulkload" 2> $HOME/traf_temp_output
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -chown -R '"$HBASE_USER"':'"$HBASE_GROUP"' /hbase-staging"'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -mkdir /bulkload" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
    dir_exists=$(grep "File exists" $HOME/traf_temp_output | wc -l)
@@ -157,10 +165,10 @@ if [ $? != 0 ]; then
       exit -1
    fi
 fi
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -chown -R $TRAF_USER:trafodion /bulkload"
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -chown -R $TRAF_USER:trafodion /bulkload"'
 
 # Create lobs directory
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -mkdir /lobs" 2> $HOME/traf_temp_output
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "'"$HADOOP_BIN_PATH"'/hadoop fs -mkdir /lobs" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
    dir_exists=$(grep "File exists" $HOME/traf_temp_output | wc -l)
@@ -170,11 +178,11 @@ if [ $? != 0 ]; then
       exit -1
    fi
 fi
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -chown -R $TRAF_USER:trafodion /lobs"
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "'"$HADOOP_BIN_PATH"'/hadoop fs -chown -R $TRAF_USER:trafodion /lobs"'
 
 
 #Create Backup directory 
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -mkdir /trafodion_backups" 2> $HOME/traf_temp_output
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -mkdir /trafodion_backups" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
    dir_exists=$(grep "File exists" $HOME/traf_temp_output | wc -l)
@@ -184,9 +192,9 @@ if [ $? != 0 ]; then
       exit -1
    fi
 fi
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -chown -R $TRAF_USER:trafodion /trafodion_backups"
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "'"$HADOOP_BIN_PATH"'/hadoop fs -chown -R $TRAF_USER:trafodion /trafodion_backups"'
 
-sudo su $HDFS_USER --command "$HADOOP_BIN_PATH/hadoop fs -chmod 777 /trafodion_backups"
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "' "$HADOOP_BIN_PATH"'/hadoop fs -chmod 777 /trafodion_backups"'
 #=====================================
 # Modify hadoop settings as needed by Trafodion
 
@@ -358,33 +366,33 @@ echo "***INFO: Hadoop restart completed successfully"
 
 # wait to make sure HDFS is fully restarted and out of safemode
 echo "***INFO: waiting for HDFS to exit safemode"
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfsadmin -safemode wait"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfsadmin -safemode wait"'
 
 #====================================================
 # NOTE: These command must be done AFTER acls are 
 #       enabled and HDFS has been restarted
 echo "***INFO: Setting HDFS ACLs for snapshot scan support"
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfs -mkdir -p /hbase/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -mkdir -p /hbase/archive) command failed"
    exit -1
 fi
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfs -chown hbase:hbase /hbase/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -chown hbase:hbase /hbase/archive) command failed"
    exit -1
 fi
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m user:$TRAF_USER:rwx /hbase/archive"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfs -setfacl -R -m user:'"$TRAF_USER"':rwx /hbase/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m user:$TRAF_USER:rwx /hbase/archive) command failed"
    exit -1
 fi
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m default:user:$TRAF_USER:rwx /hbase/archive"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfs -setfacl -R -m default:user:'"$TRAF_USER"':rwx /hbase/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m default:user:$TRAF_USER:rwx /hbase/archive) command failed"
    exit -1
 fi
-sudo su hdfs --command "$HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m mask::rwx /hbase/archive"
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "' "$HADOOP_BIN_PATH"'/hdfs dfs -setfacl -R -m mask::rwx /hbase/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: ($HADOOP_BIN_PATH/hdfs dfs -setfacl -R -m mask::rwx /hbase/archive) command failed"
    exit -1
@@ -404,7 +412,7 @@ if [ $node_count -ne 1 ]; then
    cp $TRAF_CONFIG $LOCAL_WORKDIR
    $TRAF_PDCP $LOCAL_WORKDIR/$TRAF_CONFIG_FILE $HOME
    $TRAF_PDSH sudo mkdir -p $TRAF_CONFIG_DIR
-   $TRAF_PDSH sudo cp $HOME/$TRAF_CONFIG_FILE $TRAF_CONFIG_DIR
+   $TRAF_PDSH sudo cp -rf $HOME/$TRAF_CONFIG_FILE $TRAF_CONFIG_DIR
    $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG
 fi
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/traf_createPasswordLessSSH
----------------------------------------------------------------------
diff --git a/install/installer/traf_createPasswordLessSSH b/install/installer/traf_createPasswordLessSSH
index da672a4..4391d6f 100755
--- a/install/installer/traf_createPasswordLessSSH
+++ b/install/installer/traf_createPasswordLessSSH
@@ -43,8 +43,8 @@ done
 
 for node in $NODES
 do
-    sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no $node hostname"
-    sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no localhost hostname"
+    sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no $node hostname" 2>&1 > /dev/null
+    sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no localhost hostname" 2>&1 > /dev/null
     if [ $? -ne 0 ]; then
         echo "***ERROR: Unable to ssh to node $node"
         exit -1
@@ -52,7 +52,7 @@ do
 
     for nodes in $NODES
     do
-       sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no $node ssh -q -oStrictHostKeyChecking=no $nodes hostname"
+       sudo su $TRAF_USER --command "ssh -q -oStrictHostKeyChecking=no $node ssh -q -oStrictHostKeyChecking=no $nodes hostname" 2>&1 > /dev/null
        if [ $? -ne 0 ]; then
           echo "***ERROR: Unable to ssh to node $node"
           exit -1

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/traf_getHadoopNodes
----------------------------------------------------------------------
diff --git a/install/installer/traf_getHadoopNodes b/install/installer/traf_getHadoopNodes
index e397d4a..0446cb7 100755
--- a/install/installer/traf_getHadoopNodes
+++ b/install/installer/traf_getHadoopNodes
@@ -31,6 +31,7 @@ if [ $HADOOP_TYPE == "cloudera" ]; then
    curlRC=$?
    numberHadoopNodes=$(grep -r "hostname" tempFile | wc -l)
    grep -r "hostname" tempFile > tempFile2
+   grep -r "hostId" tempFile > tempHadoop
 
    if [ -d /opt/cloudera/parcels/CDH ]; then
       export HADOOP_PATH="/opt/cloudera/parcels/CDH/lib/hbase/lib"
@@ -42,6 +43,46 @@ if [ $HADOOP_TYPE == "cloudera" ]; then
   echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
   echo "***INFO: HADOOP_BIN_PATH=$HADOOP_BIN_PATH"
 
+  HADOOP_IDS=""
+  HBASE_NODES=""
+  MY_HBASE_NODES=""
+  HDFS_NODES=""
+  MY_HDFS_NODES=""
+  while read line
+  do
+     hostName=$(echo $line | awk '{print $3}' | sed 's/\"//g' | sed 's/\..*//' | sed 's/\,//g')
+     HADOOP_IDS="$HADOOP_IDS $hostName"
+   done < tempHadoop
+
+   for id in $HADOOP_IDS
+   do
+      hasHBase=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v10/hosts/$id | grep "serviceName" | grep -i hbase | wc -l)
+      if [[ "$hasHBase" -ge "1" ]]; then
+         name=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v10/hosts/$id | grep "hostname")
+         hostName=$(echo $name | awk '{print $3}' | sed 's/\"//g' | sed 's/\..*//' | sed 's/\,//g')
+         HBASE_NODES="$HBASE_NODES $hostName"
+         MY_HBASE_NODES="$MY_HBASE_NODES -w $hostName"
+      fi
+      
+      hasHDFS=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v10/hosts/$id | grep "serviceName" | grep -i hdfs | wc -l)
+      if [[ "$hasHDFS" -ge "1" ]]; then
+         name=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v10/hosts/$id | grep "hostname")
+         hostName=$(echo $name | awk '{print $3}' | sed 's/\"//g' | sed 's/\..*//' | sed 's/\,//g')
+         HDFS_NODES="$HDFS_NODES $hostName"
+         MY_HDFS_NODES="$MY_HDFS_NODES -w $hostName"
+      fi 
+   done
+
+   HADOOP_NODES=""
+   MY_HADOOP_NODES=""
+   while read line
+   do
+      hostName=$(echo $line | awk '{print $3}' | sed 's/\"//g' | sed 's/\..*//' | sed 's/\,//g')
+      HADOOP_NODES="$HADOOP_NODES $hostName"
+      MY_HADOOP_NODES="$MY_HADOOP_NODES -w $hostName"
+   done < tempFile2
+   rm tempFile
+   rm tempFile2
 fi
 
 if [[ $HADOOP_TYPE == "hortonworks" ]]; then
@@ -49,7 +90,7 @@ if [[ $HADOOP_TYPE == "hortonworks" ]]; then
    curlRC=$?
    numberHadoopNodes=$(grep -r "host_name" tempFile | wc -l)
    grep -r "host_name" tempFile > tempFile2
-
+      
    if [ -d /usr/lib/hbase/lib ]; then
       HADOOP_PATH="/usr/lib/hbase/lib"
    else
@@ -57,6 +98,37 @@ if [[ $HADOOP_TYPE == "hortonworks" ]]; then
    fi
    echo "***INFO: HADOOP_PATH=$HADOOP_PATH"
 
+   HDFS_NODES=""
+   MY_HDFS_NODES=""
+   HBASE_NODES=""
+   MY_HBASE_NODES=""
+   
+   HADOOP_NODES=""
+   MY_HADOOP_NODES=""
+   while read line
+   do
+      hostName=$(echo $line | awk '{print $3}' | sed 's/\"//g' | sed 's/\,//g')
+      HADOOP_NODES="$HADOOP_NODES $hostName"
+      MY_HADOOP_NODES="$MY_HADOOP_NODES -w $hostName"
+   done < tempFile2
+
+   for node in $HADOOP_NODES
+   do
+       hasHBase=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v1/clusters/$CLUSTER_NAME/hosts/$node | grep component_name| grep -i hbase | wc -l)
+       if [[ "$hasHBase" -ge "1" ]]; then
+          HBASE_NODES="$HBASE_NODES $node"
+          MY_HBASE_NODES="$MY_HBASE_NODES -w $node"
+       fi
+
+       hasHDFS=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v1/clusters/$CLUSTER_NAME/hosts/$node | grep component_name | grep -i datanode | wc -l)
+       hasHDFS1=$(curl -k -su $ADMIN:$PASSWORD $URL/api/v1/clusters/$CLUSTER_NAME/hosts/$node | grep component_name | grep -i namenode | wc -l)
+       
+       if [[ "$hasHDFS" -ge "1" ]] || [[ "$hasHDFS1" -ge "1" ]]; then
+          HDFS_NODES="$HDFS_NODES $node"
+          MY_HDFS_NODES="$MY_HDFS_NODES -w $node"
+       fi
+        
+   done
 fi
 
 if [ $curlRC != 0 ]; then
@@ -75,18 +147,6 @@ if [ $curl_error -ne 0 ]; then
    exit -1
 fi
 
-#Get list of all hadoop nodes
-HADOOP_NODES=""
-MY_HADOOP_NODES=""
-while read line
-do
-   hostName=$(echo $line | awk '{print $3}' | sed 's/\"//g' | sed 's/\..*//' | sed 's/\,//g')
-   HADOOP_NODES="$HADOOP_NODES $hostName"
-   MY_HADOOP_NODES="$MY_HADOOP_NODES -w $hostName"
-done < tempFile2
-rm tempFile
-rm tempFile2
-
 if [[ -z $HADOOP_NODES ]]; then
    echo "***ERROR: List of $HADOOP_TYPE nodes not found."
    echo "***ERROR: Check that $HADOOP_TYPE is up and running."
@@ -95,6 +155,11 @@ if [[ -z $HADOOP_NODES ]]; then
 fi
 
 echo "***INFO: $HADOOP_TYPE list of nodes: $HADOOP_NODES"
+echo "***INFO: $HADOOP_TYPE list of HDFS nodes: $HDFS_NODES"
+echo "***INFO: $HADOOP_TYPE list of HBASE nodes: $HBASE_NODES"
+
+
+
 hadoop_node_count=$(echo $HADOOP_NODES | wc -w)
 
 sudo chmod 777 $TRAF_CONFIG
@@ -104,6 +169,18 @@ sudo chmod 777 $TRAF_CONFIG
 sed -i '/MY_HADOOP_NODES\=/d' $TRAF_CONFIG
 echo "export MY_HADOOP_NODES=\"$MY_HADOOP_NODES\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
+sed -i '/HDFS_NODES\=/d' $TRAF_CONFIG
+echo "export HDFS_NODES=\"$HDFS_NODES\"" >> $TRAF_CONFIG
+sudo chmod 777 $TRAF_CONFIG
+sed -i '/MY_HDFS_NODES\=/d' $TRAF_CONFIG
+echo "export MY_HDFS_NODES=\"$MY_HDFS_NODES\"" >> $TRAF_CONFIG
+sudo chmod 777 $TRAF_CONFIG
+sed -i '/HBASE_NODES\=/d' $TRAF_CONFIG
+echo "export HBASE_NODES=\"$HBASE_NODES\"" >> $TRAF_CONFIG
+sudo chmod 777 $TRAF_CONFIG
+sed -i '/MY_HBASE_NODES\=/d' $TRAF_CONFIG
+echo "export MY_HBASE_NODES=\"$MY_HBASE_NODES\"" >> $TRAF_CONFIG
+sudo chmod 777 $TRAF_CONFIG
 sed -i '/HADOOP_PATH\=/d' $TRAF_CONFIG
 echo "export HADOOP_PATH=\"$HADOOP_PATH\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
@@ -143,3 +220,5 @@ if [[ $error == "1" ]]; then
    exit -1
 fi
 
+
+rm -rf tempFile*

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/traf_hortonworks_mods98
----------------------------------------------------------------------
diff --git a/install/installer/traf_hortonworks_mods98 b/install/installer/traf_hortonworks_mods98
index cffb3be..df8dba8 100755
--- a/install/installer/traf_hortonworks_mods98
+++ b/install/installer/traf_hortonworks_mods98
@@ -33,8 +33,8 @@ export PDSH="pdsh -R exec"
 export PDSH_SSH_CMD="ssh -q -n %h"
 export PDCP="pdcp -R ssh"
 
-export PDSH_HADOOP_NODES="$PDSH $MY_HADOOP_NODES $PDSH_SSH_CMD"
-export PDCP_HADOOP_NODES="$PDCP $MY_HADOOP_NODES"
+export PDSH_HADOOP_NODES="$PDSH $MY_HBASE_NODES $PDSH_SSH_CMD"
+export PDCP_HADOOP_NODES="$PDCP $MY_HBASE_NODES"
 #=====================================
 # copy Trafodion hbase trx jar to /usr/lib/hbase/lib
 
@@ -42,22 +42,26 @@ cd $UNTAR_DIR
 
 PORT=`echo $URL | sed 's/.*://'`
 AMBARI_HOST=$(echo $URL | sed 's@.*://@@' | sed 's@:.*@@')
+HDFS_NODE=$(echo $HDFS_NODES | head -n1 | awk '{print $1;}')
+HBASE_NODE=$(echo $HBASE_NODES | head -n1 | awk '{print $1;}')
 echo "export AMBARI_HOST=\"$AMBARI_HOST\"" >> $TRAF_CONFIG
+echo "export HDFS_NODE=\"$HDFS_NODE\"" >> $TRAF_CONFIG
+echo "export HBASE_NODE=\"$HBASE_NODE\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
 source $TRAF_CONFIG
 
 #determine java version and choose corresponding jar files
 if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
    if [[ $HDP_2_3_SUPPORT == "Y" ]]; then
-      hbase_trx_jar="hbase-trx-hdp2_3-${TRAF_VERSION}.jar"
+      hbase_trx_jar="hbase-trx-hdp2_3-*.jar"
    else
-      hbase_trx_jar="hbase-trx-hdp2_1-${TRAF_VERSION}.jar"
+      hbase_trx_jar="hbase-trx-hdp2_1-*.jar"
    fi
 else
-   hbase_trx_jar="hbase-trx-hdp2_2-${TRAF_VERSION}.jar"
+   hbase_trx_jar="hbase-trx-hdp2_2-*.jar"
 fi
 
-traf_util_jar="trafodion-utility-${TRAF_VERSION}.jar"
+traf_util_jar="trafodion-utility-*.jar"
 
 
 # The permissions the Trafodion build process creates on the hbase-trx jar
@@ -93,7 +97,7 @@ if [ $node_count -ne 1 ]; then
     $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$hbase_trx_jar 2>/dev/null
     $PDSH_HADOOP_NODES rm $LOCAL_WORKDIR/$traf_util_jar 2>/dev/null
 else
-    for node in $HADOOP_NODES
+    for node in $HBASE_NODES
     do 
     ssh -q -n $node sudo rm -rf $HADOOP_PATH/hbase-trx* 2>/dev/null
     ssh -q -n $node sudo rm -rf /usr/lib/hbase/lib/hbase-trx* 2>/dev/null
@@ -114,7 +118,7 @@ fi
 #=======================================
 #Check that HBase-trx copied to all nodes
 
-for node in $HADOOP_NODES
+for node in $HBASE_NODES
 do
    copiedOver=$(ssh -q -n $node sudo ls $HADOOP_PATH/hbase-trx* | wc -l)
    if [[ $copiedOver -ne "1" ]]; then
@@ -130,13 +134,13 @@ echo "***INFO: $hbase_trx_jar copied correctly! Huzzah."
 
 
 #Copy hbase-site.xml file
-ssh -q -n $AMBARI_HOST sudo cp /etc/hbase/conf/hbase-site.xml $HOME
-ssh -q -n $AMBARI_HOST sudo chown $(whoami).$(whoami) $HOME/hbase-site.xml
-ssh -q -n $AMBARI_HOST sudo chmod 777 $HOME/hbase-site.xml
+ssh -q -n $HBASE_NODE sudo cp /etc/hbase/conf/hbase-site.xml $HOME
+ssh -q -n $HBASE_NODE sudo chown $(whoami).$(whoami) $HOME/hbase-site.xml
+ssh -q -n $HBASE_NODE sudo chmod 777 $HOME/hbase-site.xml
 
-scp -q $(whoami)@$AMBARI_HOST:$HOME/hbase-site.xml $HOME
+scp -q $(whoami)@$HBASE_NODE:$HOME/hbase-site.xml $HOME
 if [[ $? -gt 1 ]]; then
-   echo "***ERROR: Unable to find /etc/hbase/conf/hbase-site.xml file on $AMBARI_HOST or unable to copy."
+   echo "***ERROR: Unable to find /etc/hbase/conf/hbase-site.xml file on $HBASE_NODE or unable to copy."
    exit -1
 fi
 sudo cp $HOME/hbase-site.xml $TRAF_WORKDIR
@@ -146,56 +150,56 @@ sudo chown trafodion.trafodion $TRAF_WORKDIR/hbase-site.xml
 # create new directories for bulkload and lobs if not already there
 rm $LOCAL_WORKDIR/traf_temp_output 2>/dev/null
 
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /hbase-staging" 2> $HOME/traf_temp_output'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /hbase-staging" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
-   dir_exists=$(ssh -q -n $AMBARI_HOST 'grep "File exists" $HOME/traf_temp_output | wc -l')
+   dir_exists=$(ssh -q -n $HDFS_NODE 'grep "File exists" $HOME/traf_temp_output | wc -l')
    if [ $dir_exists -eq 0 ]; then
       echo "***ERROR: 'hadoop fs -mkdir /hbase-staging' command failed"
-      echo "***ERROR: $(ssh -q -n $AMBARI_HOST cat $HOME/traf_temp_output)"
+      echo "***ERROR: $(ssh -q -n $HDFS_NODE cat $HOME/traf_temp_output)"
       exit -1
    fi
 fi
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$HBASE_USER"':'"$HBASE_GROUP" '/hbase-staging"'
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /bulkload" 2> $HOME/traf_temp_output'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$HBASE_USER"':'"$HBASE_GROUP" '/hbase-staging"'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /bulkload" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
-   dir_exists=$(ssh -q -n $AMBARI_HOST 'grep "File exists" $HOME/traf_temp_output | wc -l')
+   dir_exists=$(ssh -q -n $HDFS_NODE 'grep "File exists" $HOME/traf_temp_output | wc -l')
    if [ $dir_exists -eq 0 ]; then
       echo "***ERROR: 'hadoop fs -mkdir /bulkload' command failed"
-      echo "***ERROR: $(ssh -q -n $AMBARI_HOST cat $HOME/traf_temp_output)"
+      echo "***ERROR: $(ssh -q -n $HDFS_NODE cat $HOME/traf_temp_output)"
       exit -1
    fi
 fi
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /bulkload"'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /bulkload"'
 
 # Create lobs directory
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hadoop fs -mkdir /lobs" 2> $HOME/traf_temp_output'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hadoop fs -mkdir /lobs" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
-   dir_exists=$(ssh -q -n $AMBARI_HOST 'grep "File exists" $HOME/traf_temp_output | wc -l')
+   dir_exists=$(ssh -q -n $HDFS_NODE 'grep "File exists" $HOME/traf_temp_output | wc -l')
    if [ $dir_exists -eq 0 ]; then
       echo "***ERROR: 'hadoop fs -mkdir /lobs' command failed"
-      echo "***ERROR: $(ssh -q -n $AMBARI_HOST cat $HOME/traf_temp_output)"
+      echo "***ERROR: $(ssh -q -n $HDFS_NODE cat $HOME/traf_temp_output)"
       exit -1
    fi
 fi
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /lobs"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /lobs"'
 
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /trafodion_backups" 2> $HOME/traf_temp_output'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -mkdir /trafodion_backups" 2> $HOME/traf_temp_output'
 if [ $? != 0 ]; then
    # ok if directory already exists
-   dir_exists=$(ssh -q -n $AMBARI_HOST 'grep "File exists" $HOME/traf_temp_output | wc -l')
+   dir_exists=$(ssh -q -n $HDFS_NODE 'grep "File exists" $HOME/traf_temp_output | wc -l')
    if [ $dir_exists -eq 0 ]; then
       echo "***ERROR: 'hadoop fs -mkdir /trafodion_backups' command failed"
-      echo "***ERROR: $(ssh -q -n $AMBARI_HOST cat $HOME/traf_temp_output)"
+      echo "***ERROR: $(ssh -q -n $HDFS_NODE cat $HOME/traf_temp_output)"
       exit -1
    fi
 fi
-ssh -q -n $AMBARI_HOST 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /trafodion_backups"'
+ssh -q -n $HDFS_NODE 'sudo su' "$HDFS_USER" '--command "hadoop fs -chown -R' "$TRAF_USER"':trafodion /trafodion_backups"'
 
 
-ssh -q -n $AMBARI_HOST 'rm -rf $HOME/traf_temp_output'
+ssh -q -n $HDFS_NODE 'rm -rf $HOME/traf_temp_output'
 #=====================================
 # change the hbase configuration using Ambari's script
 
@@ -539,59 +543,32 @@ echo "***INFO: HBase restart completed"
 # NOTE: These command must be done AFTER acls are 
 #       enabled and HDFS has been restarted
 echo "***INFO: Setting HDFS ACLs for snapshot scan support"
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -mkdir -p /apps/hbase/data/archive"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hdfs dfs -mkdir -p /apps/hbase/data/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: (hdfs dfs -mkdir -p /apps/hbase/data/archive) command failed"
    exit -1
 fi
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: (hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive) command failed"
    exit -1
 fi
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -setfacl -R -m user:'"$TRAF_USER"':rwx /apps/hbase/data/archive"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hdfs dfs -setfacl -R -m user:'"$TRAF_USER"':rwx /apps/hbase/data/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: (hdfs dfs -setfacl -R -m mask::rwx /apps/hbase/data/archive) command failed"
    exit -1
 fi
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -setfacl -R -m default:user:'"$TRAF_USER"':rwx /apps/hbase/data/archive"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hdfs dfs -setfacl -R -m default:user:'"$TRAF_USER"':rwx /apps/hbase/data/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: (hdfs dfs -setfacl -R -m mask::rwx /apps/hbase/data/archive) command failed"
    exit -1
 fi
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -setfacl -R -m mask::rwx /apps/hbase/data/archive"'
+ssh -q -n $HDFS_NODE 'sudo su hdfs --command "hdfs dfs -setfacl -R -m mask::rwx /apps/hbase/data/archive"'
 if [ $? != 0 ]; then
    echo "***ERROR: (hdfs dfs -setfacl -R -m mask::rwx /apps/hbase/data/archive) command failed"
    exit -1
 fi
 
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -mkdir -p /apps/hbase/data/archive/data"'
-if [ $? != 0 ]; then
-   echo "***ERROR: (hdfs dfs -mkdir -p /apps/hbase/data/archive/data) command failed"
-   exit -1
-fi
-
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive/data"'
-if [ $? != 0 ]; then
-   echo "***ERROR: (hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive/data) command failed"
-   exit -1
-fi
-
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -mkdir -p /apps/hbase/data/archive/data/default"'
-if [ $? != 0 ]; then
-   echo "***ERROR: (hdfs dfs -mkdir -p /apps/hbase/data/archive/data/default) command failed"
-   exit -1
-fi
-
-ssh -q -n $AMBARI_HOST 'sudo su hdfs --command "hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive/data/default"'
-if [ $? != 0 ]; then
-   echo "***ERROR: (hdfs dfs -chown hbase:hdfs /apps/hbase/data/archive/data/default) command failed"
-   exit -1
-fi
-
-
-
-
 # clean up files generated by Ambari's config.sh script
 ssh -q -n $AMBARI_HOST 'rm $HOME/doSet_version*'
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/trafodion_apache_hadoop_install
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_apache_hadoop_install b/install/installer/trafodion_apache_hadoop_install
index dc5be0a..ca36122 100755
--- a/install/installer/trafodion_apache_hadoop_install
+++ b/install/installer/trafodion_apache_hadoop_install
@@ -333,7 +333,7 @@ if [ ! -z $TRAF_PACKAGE ]; then
    # untar the package
    sudo tar -xzf $TRAF_PACKAGE --directory=$UNTAR_DIR
 
-   build_file=$(ls $UNTAR_DIR | grep "trafodion_server")
+   build_file=$(ls $UNTAR_DIR | grep "trafodion_.*server")
    if [[ -z $build_file ]]; then
       echo "***ERROR: trafodion_server-*.tgz could not be found in $UNTAR_DIR"
       exit -1
@@ -454,7 +454,7 @@ sudo rm -rf hbaseVersion.txt
 trafodionFullName=$(basename $TRAF_BUILD)
 echo "***DEBUG: trafodionFullName=$trafodionFullName"
 #Debug version
-trafodionVersion=$(echo $trafodionFullName | sed 's/trafodion_server-//' | sed 's/-debug//' | sed 's/.tgz//')
+trafodionVersion=$(echo $trafodionFullName | sed 's/trafodion_.*server-//' | sed 's/-debug//' | sed 's/.tgz//')
 
 echo "***INFO: Trafodion version = $trafodionVersion"
 #==============================================
@@ -474,12 +474,6 @@ if [ ${PIPESTATUS[0]} != 0 ]; then
     exit -1
 fi
 
-# parse the version string from the trafodion_server-n.n.n.jar filename
-traf_version=$(sudo ls $UNTAR_DIR | \
-               grep --max-count=1 trafodion_server | \
-               sed -e 's@trafodion_server-\([0-9*].*\).tgz@\1@')
-TRAF_VERSION=$(echo $traf_version | sed -e 's@\([0-9*].*\)-debug@\1@')
-
 # Detect java version
 
 for node in $HADOOP_NODES
@@ -527,8 +521,6 @@ else
 fi
 
 sudo chmod 777 $TRAF_CONFIG
-sed -i '/TRAF_VERSION\=/d' $TRAF_CONFIG
-echo "export TRAF_VERSION=\"$TRAF_VERSION\"" >> $TRAF_CONFIG
 sed -i '/JAVA_VERSION\=/d' $TRAF_CONFIG
 echo "export JAVA_VERSION=\"$JAVA_VERSION\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/trafodion_install
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_install b/install/installer/trafodion_install
index 7fc13dd..2e25bad 100755
--- a/install/installer/trafodion_install
+++ b/install/installer/trafodion_install
@@ -557,18 +557,6 @@ if [ ${PIPESTATUS[0]} != 0 ]; then
     exit -1
 fi
 
-# parse the version string from the trafodion_server-n.n.n.jar filename
-traf_version=$(sudo ls $UNTAR_DIR | \
-               grep --max-count=1 trafodion_.*server | \
-               sed -e 's@trafodion_.*server-\([0-9*].*\).tgz@\1@')
-TRAF_VERSION=$(echo $traf_version | sed -e 's@\([0-9*].*\)-debug@\1@')
-
-# Detect java version
-
-sudo chmod 777 $TRAF_CONFIG
-sed -i '/TRAF_VERSION\=/d' $TRAF_CONFIG
-echo "export TRAF_VERSION=\"$TRAF_VERSION\"" >> $TRAF_CONFIG
-sudo chmod 777 $TRAF_CONFIG
 #==============================================
 # Run trafodion_setup
 echo

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/trafodion_uninstaller
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_uninstaller b/install/installer/trafodion_uninstaller
index 0924dcd..e9e27b2 100755
--- a/install/installer/trafodion_uninstaller
+++ b/install/installer/trafodion_uninstaller
@@ -48,7 +48,7 @@ fi
 #=========================================
 # define defaults
 TRAF_GROUP="trafodion"
-HBASE_TRX="hbase-trx*"
+#HBASE_TRX="hbase-trx*"
 
 UNINSTALL_ALL="N"
 UNINSTALL_DIR=""
@@ -104,13 +104,13 @@ echo "***INFO: removing $HBASE_TRX from Hadoop directories"
 if [ $all_node_count -eq 1 ]; then
    sudo rm /etc/security/limits.d/trafodion.conf 2>/dev/null
    sudo rm /usr/share/cmf/lib/plugins/$HBASE_TRX 2>/dev/null
-   sudo rm /usr/lib/hbase/lib/$HBASE_TRX 2>/dev/null
-   sudo rm /usr/hdp/current/hbase-regionserver/lib/$HBASE_TRX 2>/dev/null
+   #sudo rm /usr/lib/hbase/lib/$HBASE_TRX 2>/dev/null
+   #sudo rm /usr/hdp/current/hbase-regionserver/lib/$HBASE_TRX 2>/dev/null
 else
    $TRAF_PDSH "sudo rm /etc/security/limits.d/trafodion.conf 2>/dev/null"
    $TRAF_PDSH "sudo rm /usr/share/cmf/lib/plugins/$HBASE_TRX 2>/dev/null"
-   $TRAF_PDSH "sudo rm /usr/lib/hbase/lib/$HBASE_TRX 2>/dev/null"
-   $TRAF_PDSH "sudo rm /usr/hdp/current/hbase-regionserver/lib/$HBASE_TRX 2>/dev/null" 
+   #$TRAF_PDSH "sudo rm /usr/lib/hbase/lib/$HBASE_TRX 2>/dev/null"
+   #$TRAF_PDSH "sudo rm /usr/hdp/current/hbase-regionserver/lib/$HBASE_TRX 2>/dev/null" 
 fi
 
 echo "***INFO remove the Trafodion userid and group"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7e2bf84..05f4f5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -132,7 +132,7 @@
   </properties>
 
   <modules>
-    <module>docs/client_install</module>
+    <!--module>docs/client_install</module>
     <module>dcs</module>
     <module>core/rest</module>
     <module>docs/command_interface</module>
@@ -141,7 +141,7 @@
     <module>docs/provisioning_guide</module>
     <module>docs/messages_guide</module>
     <module>docs/odb_user</module>
-    <module>docs/sql_reference</module>
+    <module>docs/sql_reference</module-->
   </modules>
 
   <build>


[40/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/_chapters/sample_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/sample_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/sample_spjs.adoc
new file mode 100644
index 0000000..1c4fc8e
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/_chapters/sample_spjs.adoc
@@ -0,0 +1,2386 @@
+////
+/**
+ *@@@ 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 @@@
+ */
+////
+
+[[a-sample-spjs]]
+= A Sample SPJs
+
+This appendix presents the SPJs that are shown in examples throughout
+this manual. The class files that contain the SPJ methods use JDBC
+method calls to access a sample database. For information about the
+sample database, see link:#_bookmark336[Appendix B (page 103)].
+
+* link:#_bookmark223["Procedures in the SALES Schema" (page 62)]
+* link:#_bookmark274["Procedures in the PERSNL Schema" (page 83)]
+* link:#_bookmark309["Procedures in the INVENT Schema" (page 94)]
+
+[[procedures-in-the-sales-schema]]
+== Procedures in the SALES Schema
+
+The Sales class contains these SPJ methods, which are useful for
+tracking orders and managing sales:
+
+* link:#_bookmark226["LOWERPRICE Procedure" (page 67)]
+* link:#_bookmark234["DAILYORDERS Procedure" (page 69)]
+* link:#_bookmark242["MONTHLYORDERS Procedure" (page 71)]
+* link:#_bookmark250["TOTALPRICE Procedure" (page 73)]
+* link:#_bookmark258["PARTDATA Procedure" (page 76)]
+* link:#_bookmark266["ORDERSUMMARY Procedure" (page 80)]
+
+Those methods are registered as stored procedures in the SALES schema.
+link:#_bookmark225[Example 1] shows the code of the Sales.java source
+file.
+
+*Example 1* `Sales.java` - The Sales Class
+
+```
+import java.sql.*; import java.math.*;
+
+public class Sales
+{
+   public static void lowerPrice() throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+         PreparedStatement getParts = 
+            conn.prepareStatement( "SELECT p.partnum, "
+                                 + "SUM(qty_ordered) AS qtyOrdered " 
+                                 + "FROM demo.sales.parts p " 
+                                 + "LEFT JOIN demo.sales.odetail o " 
+                                 + "ON p.partnum = o.partnum " 
+                                 + "GROUP BY p.partnum"
+                                 ) ;
+
+         PreparedStatement updateParts = 
+            conn.prepareStatement( "UPDATE demo.sales.parts " 
+                                 + "SET price = price * 0.9 " 
+                                 + "WHERE partnum = ?"
+                                 ) ;
+
+         ResultSet rs = getParts.executeQuery() ; 
+         while ( rs.next() )
+         {
+            BigDecimal qtyOrdered = rs.getBigDecimal( 2 ) ;
+
+            if (( qtyOrdered == null ) || ( qtyOrdered.intValue() < 50 ) )
+            {
+               BigDecimal partnum = rs.getBigDecimal( 1 ) ; 
+               updateParts.setBigDecimal( 1, partnum ) ; 
+               updateParts.executeUpdate() ;
+            }
+         }
+
+         rs.close();
+         conn.close();
+
+   } // See the link:#_bookmark226["LOWERPRICE Procedure" (page 67)].
+
+   public static void numDailyOrders( Date date
+                                    , int[] numOrders 
+                                    ) throws SQLException
+
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getNumOrders = 
+         conn.prepareStatement( "SELECT COUNT(order_date) " 
+                              + "FROM demo.sales.orders " 
+                              + "WHERE order_date = ?"
+                              ) ;
+
+      getNumOrders.setDate( 1, date ) ;
+
+      ResultSet rs = getNumOrders.executeQuery() ; 
+      rs.next() ;
+
+      numOrders[0] = rs.getInt( 1 ) ; 
+      rs.close() ;
+
+      conn.close();
+
+   } // See the link:#_bookmark234["DAILYORDERS Procedure" (page 69)].
+
+   public static void numMonthlyOrders( int month
+                                      , int[] numOrders
+                                      ) throws SQLException
+
+   {
+      if ( month < 1 || month > 12 )
+      {
+         throw new SQLException( "Invalid value for month. " 
+                               + "Retry the CALL statement " 
+                               + "using a number from 1 to 12 " 
+                               + "to represent the month."
+                               , "38001" 
+                               ) ;
+      }
+
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getNumOrders =
+         conn.prepareStatement( "SELECT COUNT( month( order_date ) ) " 
+                              + "FROM demo.sales.orders " 
+                              + "WHERE month( order_date ) = ?"
+                              ) ;
+
+      getNumOrders.setInt(1, month);
+
+      ResultSet rs = getNumOrders.executeQuery() ; 
+      rs.next() ;
+
+      numOrders[0] = rs.getInt(1) ; 
+      rs.close() ;
+
+      conn.close();
+
+   } // See the link:#_bookmark242["MONTHLYORDERS Procedure" (page 71)].
+
+   public static void totalPrice( BigDecimal qtyOrdered
+                                , String shippingSpeed
+                                , BigDecimal[] price
+                                ) throws SQLException
+   {
+      BigDecimal shipcharge = new BigDecimal( 0 ) ;
+
+      if ( shippingSpeed.equals( "economy" ) )
+      {
+         shipcharge = new BigDecimal( 1.95 ) ;
+      }
+      else if ( shippingSpeed.equals( "standard" ) )
+      {
+         shipcharge = new BigDecimal( 4.99 ) ;
+      }
+      else if ( shippingSpeed.equals( "nextday" ) )
+      {
+         shipcharge = new BigDecimal( 14.99 ) ;
+      }
+      else
+      {
+         throw new SQLException( "Invalid value for shipping speed. " 
+                               + "Retry the CALL statement using " 
+                               + "'economy' for 7 to 9 days, " 
+                               + "'standard' for 3 to 5 days, or " 
+                               + "'nextday' for one day."
+                               , "38002" 
+                               ) ;
+      }
+ 
+      BigDecimal subtotal   = price[0].multiply( qtyOrdered ) ; 
+      BigDecimal tax        = new BigDecimal( 0.0825 ) ;
+      BigDecimal taxcharge  = subtotal.multiply( tax ) ;
+      BigDecimal charges    = taxcharge.add( shipcharge ) ; 
+      BigDecimal totalprice = subtotal.add( charges ) ;
+
+      totalprice = totalprice.setScale( 2, BigDecimal.ROUND_HALF_EVEN ) ;
+      price[0] = totalprice;
+
+   } // See the link:#_bookmark250["TOTALPRICE Procedure" (page 73)].
+
+   public static void partData( int partNum
+                              , String[] partDescription
+                              , BigDecimal[] unitPrice
+                              , int[] qtyAvailable
+                              , ResultSet[] orders
+                              , ResultSet[] locations
+                              , ResultSet[] suppliers
+                              , ResultSet[] reps
+                              ) throws SQLException
+   {
+
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      // Retrieve detail about this part into the output parameters
+      PreparedStatement getPartInfo = 
+        conn.prepareStatement( "SELECT P.partdesc, P.price, P.qty_available " 
+                             + "FROM demo.sales.parts P " 
+                             + "WHERE partnum = ? "
+                             ) ; 
+
+      getPartInfo.setInt( 1, partNum ) ;
+
+      ResultSet rs = getPartInfo.executeQuery() ; 
+      rs.next() ;
+
+      partDescription[0] = rs.getString( 1 ) ; 
+      unitPrice[0]       = rs.getBigDecimal( 2 ) ; 
+      qtyAvailable[0]    = rs.getInt( 3 ) ;
+
+      rs.close();
+
+      // Return a result set of rows from the ORDERS table listing orders
+      // that included this part. Each ORDERS row is augmented with the
+      // quantity of this part that was ordered. 
+      PreparedStatement getOrders =
+         conn.prepareStatement( "SELECT O.*, QTY.QTY_ORDERED " 
+                              + "FROM   demo.sales.orders O " 
+                              + "     , ( select ordernum, sum(qty_ordered) as QTY_ORDERED " 
+                              + "         from demo.sales.odetail " 
+                              + "         where partnum = ? " 
+                              + "         group by ordernum ) QTY " 
+                              + "WHERE O.ordernum = QTY.ordernum " 
+                              + "ORDER BY O.ordernum "
+                              ) ;
+
+
+       getOrders.setInt( 1, partNum ) ; 
+       orders[0] = getOrders.executeQuery() ;
+
+       // Return a result set of rows from the PARTLOC table listing
+       // locations that have this part in stock and the quantity they
+       // have on hand.
+       PreparedStatement getLocations = 
+          conn.prepareStatement( "SELECT * " 
+                               + "FROM demo.invent.partloc " 
+                               + " WHERE partnum = ? "
+                               ) ;
+
+       getLocations.setInt( 1, partNum ) ; 
+       locations[0] = getLocations.executeQuery() ;
+
+       // Return a result set of rows from the PARTSUPP table listing
+       // suppliers who supply this part.
+       PreparedStatement getSuppliers = 
+          conn.prepareStatement( "SELECT * " 
+                               + "FROM demo.invent.partsupp " 
+                               + "WHERE partnum = ? "
+                               ) ;
+
+       getSuppliers.setInt( 1, partNum ) ; 
+       suppliers[0] = getSuppliers.executeQuery() ;
+
+       // Return a result set of rows from the EMPLOYEE table listing
+       // sales reps that have sold this part. 
+       PreparedStatement getReps =
+          conn.prepareStatement( "SELECT * " 
+                               + "FROM demo.persnl.employee " 
+                               + "WHERE empnum in ( SELECT O.salesrep " 
+                               + "                  FROM demo.sales.orders O, " 
+                               + "                  demo.sales.odetail D " 
+                               + "                  D.partnum = ? " 
+                               + "                  O.ordernum = D.ordernum ) " 
+                               + "ORDER BY empnum "
+                               ) ;
+
+        getReps.setInt( 1, partNum ) ; 
+        reps[0] = getReps.executeQuery() ;
+
+   } // See the link:#_bookmark258["PARTDATA Procedure" (page 76)].
+
+   public static void orderSummary( java.lang.String onOrAfter
+                                  , long[] numOrders
+                                  , java.sql.ResultSet[] orders
+                                  , java.sql.ResultSet[] detail
+                                  ) throws SQLException
+   {
+      java.lang.String s ; 
+
+      java.sql.Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      // Get the number of orders on or after this date
+      s =   "SELECT COUNT(ordernum) FROM demo.sales.orders " 
+          + "WHERE order_date >= CAST(? AS DATE) "
+          ;
+
+      java.sql.PreparedStatement ps1 = conn.prepareStatement( s ) ;
+      ps1.setString( 1, onOrAfter ) ;
+
+      java.sql.ResultSet rs = ps1.executeQuery() ; 
+      rs.next() ;
+
+      numOrders[0] = rs.getLong( 1 ) ; 
+      rs.close() ;
+
+      // Open a result set for order num, order info rows
+      s =   "SELECT amounts.*, orders.order_date, emps.last_name " 
+          + "FROM ( SELECT " 
+          + "         o.ordernum "
+          + "       , COUNT(d.partnum) AS num_parts " 
+          + "       , SUM(d.unit_price * d.qty_ordered) AS amount " 
+          + "       FROM demo.sales.orders o, demo.sales.odetail d " 
+          + "       WHERE o.ordernum = d.ordernum " 
+          + "          AND o.order_date >= CAST(? AS DATE) " 
+          + "       GROUP BY o.ordernum "
+          + "      ) amounts " 
+          + "      , demo.sales.orders orders "
+          + "      , demo.persnl.employee emps " 
+          + "WHERE amounts.ordernum = orders.ordernum " 
+          + "   AND orders.salesrep = emps.empnum " 
+          + "ORDER BY orders.ordernum "
+          ;
+
+       java.sql.PreparedStatement ps2 = conn.prepareStatement( s ) ;
+       ps2.setString( 1, onOrAfter ) ;
+       orders[0] = ps2.executeQuery() ;
+
+       // Open a result set for order detail rows
+       s =   "SELECT d.*, p.partdesc " 
+           + "FROM demo.sales.odetail d, demo.sales.parts p, demo.sales.orders O " 
+           + "WHERE d.partnum = p.partnum AND d.ordernum = o.ordernum " 
+           + "   AND o.order_date >= CAST(? AS DATE) " 
+           + "ORDER BY d.ordernum "
+           ;
+
+       java.sql.PreparedStatement ps3 = conn.prepareStatement( s ) ;
+       ps3.setString( 1, onOrAfter ) ;
+       detail[0] = ps3.executeQuery() ;
+
+   } // See the link:#_bookmark266["ORDERSUMMARY Procedure" (page 80)].
+}
+```
+
+See the following sections for more information about each SPJ method.
+
+[[lowerprice-procedure]]
+=== LOWERPRICE Procedure
+
+The LOWERPRICE procedure determines which items are selling poorly (that
+is, have less than 50 orders) and lowers the price of these items in the
+database by 10 percent.
+
+[[java-method-lowerprice]]
+==== Java Method: lowerPrice()
+
+Example 2 lowerPrice() Method
+
+```
+public static void lowerPrice() throws SQLException
+{
+   Connection conn = 
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getParts = 
+      conn.prepareStatement( "SELECT " 
+                           + "  p.partnum"
+                           + ", SUM(qty_ordered) AS qtyOrdered " 
+                           + "FROM demo.sales.parts p " 
+                           + "LEFT JOIN demo.sales.odetail o " 
+                           + "   ON p.partnum = o.partnum " 
+                           + "GROUP BY p.partnum"
+                           ) ;
+
+   PreparedStatement updateParts = 
+      conn.prepareStatement( "UPDATE demo.sales.parts " 
+                           + "SET price = price * 0.9 " 
+                           + "WHERE partnum = ?"
+                           ) ;
+
+   ResultSet rs = getParts.executeQuery() ; 
+
+   while ( rs.next() )
+   {
+      BigDecimal qtyOrdered = rs.getBigDecimal( 2 ) ;
+      
+      if ( ( qtyOrdered == null ) || ( qtyOrdered.intValue() < 50 ) )
+      {
+         BigDecimal partnum = rs.getBigDecimal( 1 ) ; 
+         updateParts.setBigDecimal( 1, partnum ) ; 
+         updateParts.executeUpdate() ;
+      }
+   }
+
+   rs.close() ;
+   conn.close() ;
+}
+```
+
+[[creating-the-procedure-lowerprice]]
+==== Creating the Procedure: LOWERPRICE
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 3 HPDM Create Procedure Settings: LOWERPRICE Procedure
+
+[cols=",,",options="header",]
+|===
+| Group Box  | Field or Option | Value or Setting
+| Name
+| lowerprice | Code            | DEMO.SALES.SALES  | Sales
+lowerPrice
+Parameters
+None
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|==
+
+[[calling-the-procedure-lowerprice]]
+==== Calling the Procedure: LOWERPRICE
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the LOWERPRICE procedure in trafci:
+
+```
+SQL> CALL demo.sales.lowerprice() ;
+
+--- SQL operation complete.
+```
+
+To view the prices and quantities of items in the database with 50 or
+fewer orders, issue this query before and after calling the LOWERPRICE
+procedure:
+
+```
+SELECT * 
+FROM
+   ( SELECT p.partnum
+   , SUM(qty_ordered) AS qtyOrdered
+   , p.price 
+     FROM demo.sales.parts p
+     LEFT OUTER JOIN demo.sales.odetail o ON p.partnum = o.partnum
+     GROUP BY p.partnum, p.price
+   ) AS allparts 
+WHERE qtyOrdered < 51 ;
+```
+
+The LOWERPRICE procedure lowers the price of items with 50 or fewer
+orders by 10 percent in the database. For example, part number 3103, the
+LASER PRINTER, X1, has 40 orders and a price of 4200.00:
+
+```
+PARTNUM QTYORDERED           PRICE
+------- -------------------- ----------
+    212                   20    2500.00
+   3201                    6     525.00
+    255                   38    4000.00
+   5101                    6     200.00
+   2002                   46    1500.00
+   7102                   18     275.00
+   3103                   40    4200.00
+    ...                  ...        ...
+
+--- 17 row(s) selected.
+```
+
+The invocation of LOWERPRICE lowers the price of this item from 4200.00
+to 3780.00:
+
+```
+PARTNUM QTYORDERED           PRICE
+------- -------------------- ----------
+   6500                   40      85.50
+   5504                   23     148.50
+   2002                   46    1350.00
+   3201                    6     472.50
+   7102                   18     247.50
+   3103                   40    3780.00
+... ... ...
+
+--- 17 row(s) selected.
+```
+
+[[dailyorders-procedure]]
+=== DAILYORDERS Procedure
+
+The DAILYORDERS procedure accepts a date and returns the number of
+orders on that date to an output parameter.
+
+[[java-method-numdailyorders]]
+==== Java Method: numDailyOrders()
+
+Example 3 numDailyOrders() Method
+
+```
+public static void numDailyOrders( Date date
+                                 , int[] numOrders
+                                 ) throws SQLException
+{
+   Connection conn = DriverManager.getConnection("jdbc:default:connection");
+
+   PreparedStatement getNumOrders =
+      conn.prepareStatement( "SELECT COUNT(order_date) " 
+                           + "FROM demo.sales.orders " 
+                           + "WHERE order_date = ?"
+                           ) ;
+
+   getNumOrders.setDate( 1, date ) ;
+
+   ResultSet rs = getNumOrders.executeQuery() ; 
+   rs.next() ;
+
+   numOrders[0] = rs.getInt( 1 ) ; 
+   rs.close() ;
+
+   conn.close() ;
+}
+```
+
+[[creating-the-procedure-dailyorders]]
+==== Creating the Procedure: DAILYORDERS
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 4 HPDM Create Procedure Settings: DAILYORDERS Procedure
+
+[cols="15%,20%,65%", options="header"]
+|===
+| Group Box  | Field or Option               | Value or Setting
+| Name       | Procedure Name                | dailyorders
+| Code       | Library                       | DEMO.SALES.SALES
+|            | Class Name                    | Sales
+|            | Method Name                   | numDailyOrders
+| Parameters |                               |
+| 1st        | Parameter Name                | date1
+|            | SQL Data Type                 | DATE
+|            | Direction                     | IN
+|            | Java Data Type                | Displays the signature of the Java method that you selected: `java.sql.Date`
+| 2nd        | Parameter Name                | number
+|            | SQL Data Type                 | SIGNED INTEGER
+|            | Direction                     | OUT
+|            | Java Data Type                | Displays the signature of the Java method that you selected: `int[]`
+| Attributes | Number of dynamic result sets | 0
+|            | Accesses Database             | selected
+|            | External security             | Invoker +
+ +
+*NOTE:( Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+|            | Transaction required          | Yes
+|===
+
+[[calling-the-procedure-dailyorders]]
+==== Calling the Procedure: DAILYORDERS
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the DAILYORDERS procedure in trafci:
+
+```
+SQL> CALL demo.sales.dailyorders( DATE '2011-03-19', ? ) ;
+```
+
+The DAILYORDERS procedure determines the total number of orders on a
+specified date and returns this output in trafci:
+
+```
+NUMBER
+-----------
+2
+
+--- SQL operation complete.
+```
+
+On March 19, 2011, there were two orders.
+
+[[monthlyorders-procedure]]
+=== MONTHLYORDERS Procedure
+
+The MONTHLYORDERS procedure accepts an integer representing the month
+and returns the number of orders during that month to an output
+parameter.
+
+[[java-method-nummonthlyorders]]
+==== Java Method: numMonthlyOrders()
+
+Example 4 numMonthlyOrders() Method
+
+```
+public static void numMonthlyOrders( int month
+                                   , int[] numOrders
+                                   ) throws SQLException
+{
+   if ( month < 1 || month > 12 )
+   {
+      throw new
+         SQLException( "Invalid value for month. " 
+                     + "Retry the CALL statement " 
+                     + "using a number from 1 to 12 " 
+                     + "to represent the month."
+                     , "38001" 
+                     ) ;
+   }
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getNumOrders =
+      conn.prepareStatement( "SELECT COUNT(month(order_date)) " 
+                           + "FROM demo.sales.orders " 
+                           + "WHERE month(order_date) = ?"
+                           ) ;
+
+   getNumOrders.setInt( 1, month ) ;
+
+   ResultSet rs = getNumOrders.executeQuery() ; 
+   rs.next() ;
+
+   numOrders[0] = rs.getInt( 1 ) ; 
+   rs.close() ;
+
+   conn.close() ;
+}
+
+[[creating-the-procedure-monthlyorders]]
+=== Creating the Procedure: MONTHLYORDERS
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 5 HPDM Create Procedure Settings: MONTHLYORDERS Procedure
+
+[cols=",,",options="header",]
+|===
+| Group Box | Field or Option | Value or Setting
+Name
+monthlyorders
+Code
+DEMO.SALES.SALES
+Sales
+numMonthlyOrders
+Parameters
+monthnum
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+ordernum
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected: int[]
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-monthlyorders]]
+==== Calling the Procedure: MONTHLYORDERS
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the MONTHLYORDERS procedure in trafci:
+
+```
+SQL> CALL demo.sales.monthlyorders( 3,? ) ;
+```
+
+The MONTHLYORDERS procedure determines the total number of orders during
+a specified month and returns this output in trafci:
+
+```
+ORDERNUM
+-----------
+4
+
+--- SQL operation complete.
+```
+
+In March, there were four orders.
+
+[[totalprice-procedure]]
+=== TOTALPRICE Procedure
+
+The TOTALPRICE procedure accepts the quantity, shipping speed, and price
+of an item, calculates the total price, including tax and shipping
+charges, and returns the total price to an input/output parameter.
+
+[[java-method-totalprice]]
+==== Java Method: totalPrice()
+
+Example 5 totalPrice() Method
+
+```
+public static void totalPrice( BigDecimal qtyOrdered
+                             , String shippingSpeed
+                             , BigDecimal[] price
+                             ) throws SQLException
+{
+   BigDecimal shipcharge = new BigDecimal( 0 ) ;
+
+   if ( shippingSpeed.equals( "economy" ) )
+   {
+      shipcharge = new BigDecimal( 1.95 ) ;
+   }
+   else if ( shippingSpeed.equals( "standard" ) )
+   {
+      shipcharge = new BigDecimal( 4.99 ) ;
+   }
+   else if ( shippingSpeed.equals( "nextday" ) )
+   {
+      shipcharge = new BigDecimal( 14.99 ) ;
+   }
+   else
+   {
+      throw new SQLException( "Invalid value for shipping speed. " 
+                            + "Retry the CALL statement using " 
+                            + "'economy' for 7 to 9 days," 
+                            + "'standard' for 3 to 5 days, or " 
+                            + "'nextday' for one day."
+                            , "38002" 
+                            ) ;
+   }
+
+   BigDecimal subtotal = price[0].multiply( qtyOrdered ) ;
+
+   BigDecimal tax = new BigDecimal( 0.0825 ) ; 
+   BigDecimal taxcharge = subtotal.multiply( tax ) ;
+   BigDecimal charges = taxcharge.add( shipcharge ) ;
+   BigDecimal totalprice = subtotal.add( charges ) ;
+
+   totalprice = totalprice.setScale( 2, BigDecimal.ROUND_HALF_EVEN ) ;
+   price[0] = totalprice ;
+
+}
+
+[[creating-the-procedure-totalprice]]
+==== Creating the Procedure: TOTALPRICE
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 6 HPDM Create Procedure Settings: TOTALPRICE Procedure
+
+[cols=",,",options="header",]
+|=======================================================================
+| Group Box | Field or Option | Value or Setting
+Name
+totalprice
+Code
+DEMO.SALES.SALES
+Sales
+totalPrice
+Parameters
+qty
+SIGNED NUMERIC
+*
+Precision: 18
+*
+Scale: 0
+IN
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal
+rate
+VARCHAR
+*
+Length: 10
+*
+Upshift: not selected
+*
+Character set: ISO88591
+IN
+Displays the signature of the Java method that you selected:
+java.lang.String
+price
+SIGNED NUMERIC
+*
+Precision: 18
+*
+Scale: 2
+INOUT
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal[]
+Attributes
+0
+not selected
+Invoker
+NOTE: External security is disabled because the stored procedure does
+not access the database.
+No
+|===
+
+[[calling-the-procedure-totalprice]]
+==== Calling the Procedure: TOTALPRICE
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the TOTALPRICE procedure in trafci:
+
+```
+SQL> SET PARAM ?p 10 ;
+SQL> CALL demo.sales.totalprice( 23, 'standard', ?p ) ;
+```
+
+The TOTALPRICE procedure calculates the total price of a purchase and
+returns this output in trafci:
+
+```
+p
+--------------------
+253.97
+
+--- SQL operation complete.
+```
+
+The total price of 23 items, which cost $10 each and which are shipped
+at the standard rate, is $253.97, including sales tax.
+
+[[partdata-procedure]]
+=== PARTDATA Procedure
+
+The PARTDATA procedure accepts a part number and returns this
+information about the part:
+
+* Part description, price, and quantity available as output parameters
+* A result set that contains rows from the ORDERS table about when this part was ordered
+* A result set that contains rows from the PARTLOC table, listing locations that have this 
+part in stock and the quantity they have on hand
+* A result set that contains rows from the PARTSUPP table for suppliers who carry this part
+* A result set that contains rows from the EMPLOYEE table for sales reps who have sold this part
+
+[[java-method-partdata]]
+==== Java Method: partData()
+
+Example 6 partData() Method
+
+```
+public static void partData( int partNum
+                           , String[] partDescription
+                           , BigDecimal[] unitPrice
+                           , int[] qtyAvailable
+                           , ResultSet[] orders
+                           , ResultSet[] locations
+                           , ResultSet[] suppliers
+                           , ResultSet[] reps
+                           ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   // Retrieve detail about this part into the output parameters
+   PreparedStatement getPartInfo = 
+      conn.prepareStatement( "SELECT P.partdesc, P.price, P.qty_available " 
+                           + "FROM demo.sales.parts P " 
+                           + "WHERE partnum = ? "
+                           ) ; 
+
+   getPartInfo.setInt( 1, partNum ) ;
+
+   ResultSet rs = getPartInfo.executeQuery() ; 
+   rs.next() ;
+
+   partDescription[0] = rs.getString( 1 ) ; 
+   unitPrice[0]       = rs.getBigDecimal( 2 ) ; 
+   qtyAvailable[0]    = rs.getInt( 3 ) ;
+
+   rs.close();
+
+   // Return a result set of rows from the ORDERS table listing orders
+   // that included this part. Each ORDERS row is augmented with the
+   // quantity of this part that was ordered. 
+   PreparedStatement getOrders =
+      conn.prepareStatement( "SELECT o.*, qty.qty_ordered " 
+                           + "FROM   demo.sales.orders o "
+                           + "     , ( SELECT ordernum, SUM( qty_ordered ) AS qty_ordered " 
+                           + "         FROM demo.sales.odetail " 
+                           + "         WHERE partnum = ? " 
+                           + "         GROUP BY ordernum) qty " 
+                           + "WHERE o.ordernum = qty.ordernum " 
+                           + "ORDER BY O.ordernum "
+                           ) ;
+
+   getOrders.setInt( 1, partNum ) ; 
+   orders[0] = getOrders.executeQuery() ;
+
+   // Return a result set of rows from the PARTLOC table listing
+   // locations that have this part in stock and the quantity they
+   // have on hand.
+   PreparedStatement getLocations = 
+      conn.prepareStatement( "SELECT * " 
+                           + "FROM demo.invent.partloc " 
+                           + "WHERE partnum = ? "
+                           ) ;
+
+   getLocations.setInt( 1, partNum ) ; 
+   locations[0] = getLocations.executeQuery() ;
+
+   // Return a result set of rows from the PARTSUPP table listing
+   // suppliers who supply this part.
+   PreparedStatement getSuppliers = 
+      conn.prepareStatement( "SELECT * " 
+                           + "FROM demo.invent.partsupp " 
+                           + "WHERE partnum = ? "
+                           ) ;
+
+   getSuppliers.setInt( 1, partNum ) ; 
+   suppliers[0] = getSuppliers.executeQuery() ;
+
+   // Return a result set of rows from the EMPLOYEE table listing
+   // sales reps that have sold this part. 
+   PreparedStatement getReps =
+      conn.prepareStatement( "SELECT * " 
+                           + "FROM demo.persnl.employee " 
+                           + "WHERE empnum IN "
+                           + "   ( SELECT o.salesrep " 
+                           + "     FROM demo.sales.orders o, demo.sales.odetail d " 
+                           + "     WHERE d.partnum = ? " 
+                           + "       AND o.ordernum = d.ordernum ) " 
+                           + "ORDER BY empnum "
+                           ) ;
+
+   getReps.setInt( 1, partNum ) ;
+   reps[0] = getReps.executeQuery() ;
+}
+
+[[creating-the-procedure-partdata]]
+==== Creating the Procedure: PARTDATA
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 7 HPDM Create Procedure Settings: PARTDATA Procedure
+
+[cols=",,",options="header",]
+|===
+| Group Box | Field or Option | Value or Setting
+Name
+partdata
+Code
+DEMO.SALES.SALES
+Sales
+partData
+Parameters
+partnum
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+partdesc
+CHARACTER
+*
+Length: 18
+*
+Varying: not selected
+*
+Upshift: not selected
+*
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+price
+SIGNED NUMERIC
+* 
+Precision: 8
+* 
+Scale: 2
+OUT
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal[]
+qty_available
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected: int[]
+Attributes
+4
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-partdata]]
+==== Calling the Procedure: PARTDATA
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the PARTDATA procedure in trafci:
+
+```
+SQL> CALL demo.sales.partdata(212,?,?,?) ;
+```
+
+The PARTDATA procedure returns this information about part 212:
+
+```
+PARTDESC           PRICE      QTY_AVAILABLE
+------------------ ---------- ------------- 
+PC SILVER, 20 MB      2500.00          3525
+
+ORDERNUM ORDER_DATE DELIV_DATE SALESREP CUSTNUM QTY_ORDERED
+-------- ---------- ---------- -------- ------- --------------------
+  400410 2011-03-27 2011-09-01      227    7654                   12
+  500450 2011-04-20 2011-09-15      220     324                    8
+
+--- 2 row(s) selected.
+
+LOC_CODE PARTNUM QTY_ON_HAND
+-------- ------- ----------- 
+G87          212          20
+A87          212          18
+
+--- 2 row(s) selected.
+
+PARTNUM SUPPNUM PARTCOST   QTY_RECEIVED
+------- ------- ---------- ------------ 
+    212       3    1900.00           35
+    212       1    2000.00           20
+
+--- 2 row(s) selected.
+
+EMPNUM FIRST_NAME      LAST_NAME            DEPTNUM JOBCODE SALARY
+------ --------------- -------------------- ------- ------- ----------
+220    JOHN            HUGHES                  3200     300   33000.10
+227    XAVIER          SEDLEMEYER              3300     300   30000.00
+
+--- 2 row(s) selected.
+
+--- SQL operation complete.
+```
+
+[[ordersummary-procedure]]
+== ORDERSUMMARY Procedure
+
+The ORDERSUMMARY procedure accepts a date, which is formatted as a
+string, and returns this information about the orders on or after that
+date:
+
+* The number of orders as an output parameter
+* A result set that contains one row for each order. Each row contains
+fields for the order number, the number of parts ordered, total dollar
+amount, order date, and the name of the sales representative.
+* A result set that contains details about each order. Each order has
+one or more rows that provide details about the ordered parts. Each row
+contains fields for the order number, part number, unit price, quantity
+ordered, and part description.
+
+[[java-method-ordersummary]]
+==== Java Method: orderSummary()
+
+Example 7 orderSummary() Method
+
+public static void orderSummary( java.lang.String onOrAfter
+                               , long[] numOrders
+                               , java.sql.ResultSet[] orders
+                               , java.sql.ResultSet[] detail
+                               ) throws SQLException
+{
+   java.lang.String s ; 
+
+   java.sql.Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   // Get the number of orders on or after this date
+   s =   "SELECT COUNT( ordernum ) FROM demo.sales.orders " 
+       + "WHERE order_date >= CAST(? AS DATE) "
+       ;
+
+   java.sql.PreparedStatement ps1 = conn.prepareStatement( s ) ;
+   ps1.setString( 1, onOrAfter ) ;
+
+   java.sql.ResultSet rs = ps1.executeQuery() ; 
+   rs.next() ;
+
+   numOrders[0] = rs.getLong(1) ; 
+   rs.close() ;
+
+   // Open a result set for order num, order info rows
+   s =   "SELECT amounts.*, orders.order_date, emps.last_name " 
+       + "FROM ( SELECT o.ordernum, COUNT(d.partnum) AS num_parts, " 
+       + "          SUM(d.unit_price * d.qty_ordered) AS amount " 
+       + "       FROM demo.sales.orders o, demo.sales.odetail d " 
+       + "       WHERE o.ordernum = d.ordernum " 
+       + "         AND o.order_date >= CAST(? AS DATE) " 
+       + "       GROUP BY o.ordernum "
+       + "      ) amounts " 
+       + "      , demo.sales.orders orders "
+       + "      , demo.persnl.employee emps " 
+       + "WHERE amounts.ordernum = orders.ordernum " 
+       + "  AND orders.salesrep = emps.empnum " 
+       + "ORDER BY orders.ordernum "
+       ;
+
+   java.sql.PreparedStatement ps2 = conn.prepareStatement( s ) ;
+   ps2.setString( 1, onOrAfter ) ;
+   orders[0] = ps2.executeQuery() ;
+
+   // Open a result set for order detail rows
+   s =   "SELECT d.*, p.partdesc " 
+       + "FROM demo.sales.odetail d, demo.sales.parts p, demo.sales.orders O " 
+       + "WHERE d.partnum = p.partnum AND d.ordernum = o.ordernum " 
+       + "  AND o.order_date >= CAST(? AS DATE) " 
+       + "ORDER BY d.ordernum "
+       ;
+
+   java.sql.PreparedStatement ps3 = conn.prepareStatement( s ) ;
+   ps3.setString( 1, onOrAfter ) ;
+   detail[0] = ps3.executeQuery() ;
+}
+
+[[creating-the-procedure-ordersummary]]
+==== Creating the Procedure: ORDERSUMMARY
+
+Before creating the procedure, use HPDM to create a library named SALES
+in the DEMO.SALES schema and select the Sales.jar file to upload to the
+Trafodion platform for that library. For more information, see
+link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the SALES schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 8 HPDM Create Procedure Settings: ORDERSUMMARY Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+ordersummary
+Code
+DEMO.SALES.SALES
+Sales
+orderSummary
+Parameters
+on_or_after_date
+VARCHAR
+Length: 20
+Upshift: not selected
+Character set: ISO88591
+IN
+Displays the signature of the Java method that you selected:
+java.lang.String
+num_orders
+SIGNED LARGEINT
+OUT
+Displays the signature of the Java method that you selected: long[]
+Attributes
+2
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-ordersummary]]
+==== Calling the Procedure: ORDERSUMMARY
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the ORDERSUMMARY procedure in trafci:
+
+```
+SQL> CALL demo.sales.ordersummary('01-01-2011', ?);
+```
+
+The ORDERSUMMARY procedure returns this information about the orders on
+or after the specified date, 01-01-2011:
+
+```
+NUM_ORDERS
+--------------------
+13
+
+ORDERNUM NUM_PARTS            AMOUNT               ORDER_DATE LAST_NAME
+-------- -------------------- -------------------- ---------- --------------------
+HUGHES HUGHES SCHNABL
+...
+
+--- 13 row(s) selected.
+
+ORDERNUM PARTNUM UNIT_PRICE QTY_ORDERED PARTDESC
+-------- ------- ---------- ----------- ------------------ 
+  100210     244    3500.00           3 PC GOLD, 30 MB
+  100210    2001    1100.00           3 GRAPHIC PRINTER,M1
+   100210   2403     620.00           6 DAISY PRINTER,T2
+... ... ... ... ...
+
+--- 70 row(s) selected.
+
+--- SQL operation complete.
+```
+
+[[procedures-in-the-persnl-schema]]
+== Procedures in the PERSNL Schema
+
+The Payroll class contains these SPJ methods, which are useful for
+managing personnel data:
+
+* link:#_bookmark277["ADJUSTSALARY Procedure" (page 86)]
+* link:#_bookmark285["EMPLOYEEJOB Procedure" (page 88)]
+* link:#_bookmark293["PROJECTTEAM Procedure" (page 90)]
+* link:#_bookmark301["TOPSALESREPS Procedure" (page 92)]
+
+Those methods are registered as stored procedures in the PERSNL schema.
+link:#_bookmark276[Example 8] shows the code of the Payroll.java source
+file.
+
+Example 8 Payroll.java-The Payroll Class
+
+```
+import java.sql.*; 
+import java.math.*;
+
+public class Payroll
+{
+   public static void adjustSalary( BigDecimal empNum
+                                  , double percent
+                                  , BigDecimal[] newSalary
+                                  ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement setSalary = 
+         conn.prepareStatement( "UPDATE demo.persnl.employee " 
+                              + "SET salary = salary * (1 + (? / 100)) " 
+                              + "WHERE empnum = ?"
+                              ) ;
+
+      PreparedStatement getSalary = 
+         conn.prepareStatement( "SELECT salary " 
+                              + "FROM demo.persnl.employee " 
+                              + "WHERE empnum = ?"
+                              ) ;
+
+      setSalary.setDouble( 1, percent ) ; 
+      setSalary.setBigDecimal( 2, empNum ) ;
+      setSalary.executeUpdate() ;
+
+      getSalary.setBigDecimal( 1, empNum ) ; 
+      ResultSet rs = getSalary.executeQuery() ; 
+      rs.next() ;
+
+      newSalary[0] = rs.getBigDecimal( 1 ) ; 
+      rs.close() ;
+
+      conn.close() ;
+
+   } // See the link:#_bookmark277["ADJUSTSALARY Procedure" (page 86)].
+
+   public static void employeeJob( int empNum
+                                 , java.lang.Integer[] jobCode
+                                 ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getJobcode = 
+         conn.prepareStatement( "SELECT jobcode " 
+                              + "FROM demo.persnl.employee " 
+                              + "WHERE empnum = ?"
+                              ) ;
+
+      getJobcode.setInt( 1, empNum ) ;
+      ResultSet rs = getJobcode.executeQuery() ; 
+      rs.next() ;
+
+      int num = rs.getInt(1) ; 
+      if ( rs.wasNull() )
+         jobCode[0] = null ;
+      else
+         jobCode[0] = new Integer(num) ; 
+
+      rs.close() ;
+      conn.close() ;
+
+   } // See the link:#_bookmark285["EMPLOYEEJOB Procedure" (page 88)].
+
+   public static void projectTeam( int projectCode
+                                 , ResultSet[] members
+                                 ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getMembers = 
+         conn.prepareStatement( "SELECT E.empnum, E.first_name, E.last_name, D.location " 
+                              + "FROM demo.persnl.employee E, demo.persnl.dept D, demo.persnl.project P "
+                              + "WHERE P.projcode = ? " 
+                              + "  AND P.empnum = E.empnum " 
+                              + "  AND E.deptnum = D.deptnum "
+                              ) ; 
+
+       getMembers.setInt( 1, projectCode ) ;
+       members[0] = getMembers.executeQuery() ;
+
+   } // See the link:#_bookmark293["PROJECTTEAM Procedure" (page 90)].
+
+   public static void topSalesReps( int whichQuarter
+                                  , ResultSet[] topReps
+                                  ) throws SQLException
+   {
+      if ( whichQuarter < 1 || whichQuarter > 4 )
+      {
+         throw new SQLException ( "Invalid value for quarter. " 
+                                + "Retry the CALL statement " 
+                                + "using a number from 1 to 4 " 
+                                + "to represent the quarter."
+                                , "38001" 
+                                ) ;
+      }
+
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getTopReps = 
+        conn.prepareStatement( "SELECT [first 5] e.empnum, e.first_name, " 
+                             + "e.last_name, totals.total " 
+                             + "FROM demo.persnl.employee e, " 
+                             + "   ( SELECT o.salesrep, " 
+                             + "     SUM( od.unit_price * od.qty_ordered ) as total " 
+                             + "     FROM demo.sales.orders o, demo.sales.odetail od " 
+                             + "     WHERE o.ordernum = od.ordernum " 
+                             + "       AND QUARTER( o.order_date ) = ? " 
+                             + "     GROUP BY o.salesrep " 
+                             + "    ) totals " 
+                             + "WHERE e.empnum = totals.salesrep " 
+                             + "ORDER BY totals.total DESCENDING "
+                             ) ;
+
+      getTopReps.setInt( 1, whichQuarter ) ;
+      topReps[0] = getTopReps.executeQuery() ;
+
+   } // See the link:#_bookmark301["TOPSALESREPS Procedure" (page 92)].
+}
+
+See the following sections for more information about each SPJ method.
+
+[[adjustsalary-procedure]]
+=== ADJUSTSALARY Procedure
+
+The ADJUSTSALARY procedure accepts an employee number and a percentage
+value and updates the employee's salary in the database based on that
+percentage. This method also returns the updated salary to an output
+parameter.
+
+[[java-method-adjustsalary]]
+==== Java Method: adjustSalary()
+
+Example 9 adjustSalary() Method
+
+```
+public static void adjustSalary( BigDecimal empNum
+                               , double percent
+                               , BigDecimal[] newSalary
+                               ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement setSalary = 
+      conn.prepareStatement( "UPDATE demo.persnl.employee " 
+                           + "SET salary = salary * (1 + (? / 100)) " 
+                           + "WHERE empnum = ?"
+                           ) ;
+
+   PreparedStatement getSalary = 
+      conn.prepareStatement( "SELECT salary " 
+                           + "FROM demo.persnl.employee " 
+                           + "WHERE empnum = ?" 
+                           ) ;
+
+   setSalary.setDouble( 1, percent ) ; 
+   setSalary.setBigDecimal( 2, empNum ) ;
+   setSalary.executeUpdate() ;
+
+   getSalary.setBigDecimal( 1, empNum ) ; 
+   ResultSet rs = getSalary.executeQuery() ; 
+   rs.next() ;
+
+   newSalary[0] = rs.getBigDecimal( 1 ) ; 
+
+   rs.close() ;
+   conn.close() ;
+}
+```
+
+[[creating-the-procedure-adjustsalary]]
+==== Creating the Procedure: ADJUSTSALARY
+
+Before creating the procedure, use HPDM to create a library named
+PAYROLL in the DEMO.PERSNL schema and select the Payroll.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the PERSNL schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 9 HPDM Create Procedure Settings: ADJUSTSALARY Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+adjustsalary
+Code
+DEMO.PERSNL.PAYROLL
+Payroll
+adjustSalary
+Parameters
+empnum
+SIGNED NUMERIC
+Precision: 4
+Scale: 0
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal
+percent
+FLOAT
+IN
+Displays the signature of the Java method that you selected: double
+newsalary
+SIGNED NUMERIC
+Precision: 8
+Scale: 2
+OUT
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal[]
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-adjustsalary]]
+==== Calling the Procedure: ADJUSTSALARY
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the ADJUSTSALARY procedure in trafci:
+
+```
+SQL> CALL demo.persnl.adjustsalary(29, 2.5, ?) ;
+```
+
+The ADJUSTSALARY procedure updates the salary of employee number 29 by
+2.5 percent and returns this output in trafci:
+
+```
+NEWSALARY
+---------- 
+ 139400.00
+
+--- SQL operation complete.
+```
+
+The salary of employee number 29 was originally $136,000.00 and became
+$139,400.00 after the invocation of ADJUSTSALARY.
+
+[[employeejob-procedure]]
+=== EMPLOYEEJOB Procedure
+
+The EMPLOYEEJOB procedure accepts an employee number and returns a job
+code or null value to an output parameter.
+
+[[java-method-employeejob]]
+==== Java Method: employeeJob()
+
+Example 10 employeeJob() Method
+
+```
+public static void employeeJob( int empNum
+                              , java.lang.Integer[] jobCode
+                              ) throws SQLException
+
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getJobcode = 
+      conn.prepareStatement( "SELECT jobcode " 
+                           + "FROM demo.persnl.employee " + "WHERE empnum = ?");
+
+   getJobcode.setInt( 1, empNum ) ;
+
+   ResultSet rs = getJobcode.executeQuery() ; 
+   rs.next() ;
+
+   int num = rs.getInt( 1 ) ; 
+   if ( rs.wasNull() )
+      jobCode[0] = null ;
+   else
+      jobCode[0] = new Integer( num ) ; 
+
+   rs.close() ;
+   conn.close() ;
+}
+```
+
+[[creating-the-procedure-employeejob]]
+==== Creating the Procedure: EMPLOYEEJOB
+
+Before creating the procedure, use HPDM to create a library named
+PAYROLL in the DEMO.PERSNL schema and select the Payroll.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the PERSNL schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 10 HPDM Create Procedure Settings: EMPLOYEEJOB Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+employeejob
+Code
+DEMO.PERSNL.PAYROLL
+Payroll
+employeeJob
+Parameters
+empnum
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+jobcode
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.Integer[]
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-employeejob]]
+==== Calling the Procedure: EMPLOYEEJOB
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the EMPLOYEEJOB procedure in trafci:
+
+```
+SQL> CALL demo.persnl.employeejob(337, ?) ;
+```
+
+The EMPLOYEEJOB procedure accepts the employee number 337 and returns
+this output in trafci:
+
+```
+JOBCODE
+-----------
+900
+
+--- SQL operation complete.
+```
+
+The job code for employee number 337 is 900.
+
+[[projectteam-procedure]]
+=== PROJECTTEAM Procedure
+
+The PROJECTTEAM procedure accepts a project code and returns the
+employee number, first name, last name, and location of the employees
+assigned to that project.
+
+[[java-method-projectteam]]
+==== Java Method: projectTeam()
+
+Example 11 projectTeam() Method
+
+```
+public static void projectTeam( int projectCode
+                              , ResultSet[] members
+			      ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getMembers =
+      conn.prepareStatement( "SELECT E.empnum, E.first_name, E.last_name, "
+                           + "       D.location "
+			   + "FROM demo.persnl.employee E, demo.persnl.dept D, demo.persnl.project P "
+                           + "WHERE P.projcode = ? "
+			   + "  AND P.empnum = E.empnum "
+			   + "  AND E.deptnum = D.deptnum "
+			   ) ;
+
+   getMembers.setInt( 1, projectCode ) ;
+   members[0] = getMembers.executeQuery() ;
+}
+
+[[creating-the-procedure-projectteam]]
+==== Creating the Procedure: PROJECTTEAM
+
+Before creating the procedure, use HPDM to create a library named
+PAYROLL in the DEMO.PERSNL schema and select the Payroll.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the PERSNL schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 11 HPDM Create Procedure Settings: PROJECTTEAM Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+projectteam
+Code
+DEMO.PERSNL.PAYROLL
+Payroll
+projectTeam
+Parameters
+projectcode
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+Attributes
+1
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-projectteam]]
+==== Calling the Procedure: PROJECTTEAM
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the PROJECTTEAM procedure in trafci:
+
+SQL> CALL demo.persnl.projectteam( 5000 ) ;
+
+The PROJECTTEAM procedure returns this information about the employees
+assigned to project number 5000:
+
+```
+EMPNUM FIRST_NAME      LAST_NAME             LOCATION
+------ --------------- -------------------- ------------------
+    65 RACHEL          MCKAY                NEW YORK
+   203 KATHRYN         HALL                 NEW YORK
+... ... ...
+
+--- 6 row(s) selected.
+
+--- SQL operation complete.
+```
+
+[[topsalesreps-procedure]]
+=== TOPSALESREPS Procedure
+
+The TOPSALESREPS procedure accepts a number representing the fiscal
+quarter (1, 2, 3, and 4, with each number representing a range of
+months) and returns the employee number, first name, last name, and sale
+figures of the top five sales representatives who had the highest sales
+(unit_price * qty_ordered) that quarter.
+
+[[java-method-topsalesreps]]
+==== Java Method: topSalesReps()
+
+Example 12 topSalesReps() Method
+
+```
+public static void topSalesReps( int whichQuarter
+                               , ResultSet[] topReps
+			       ) throws SQLException
+{
+   if ( whichQuarter < 1 || whichQuarter > 4 )
+   {
+      throw new SQLException( "Invalid value for quarter. "
+                            + "Retry the CALL statement "
+			    + "using a number from 1 to 4 "
+			    + "to represent the quarter."
+			    , "38001"
+			    ) ;
+   }
+
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getTopReps =
+      conn.prepareStatement( "SELECT [first 5] e.empnum, e.first_name, "
+                           + " e.last_name, totals.total "
+			   + " FROM demo.persnl.employee e, "
+			   + "    ( SELECT o.salesrep, "
+			   + "      SUM( od.unit_price * od.qty_ordered) AS total "
+			   + "      FROM demo.sales.orders o, demo.sales.odetail od "
+			   + "      WHERE o.ordernum = od.ordernum "
+			   + "        AND quarter(o.order_date) = ? "
+			   + "      GROUP BY o.salesrep "
+			   + "    ) totals "
+			   + "WHERE e.empnum = totals.salesrep "
+			   + "ORDER BY totals.total DESCENDING "
+			   ) ;
+
+   getTopReps.setInt( 1, whichQuarter ) ;
+   topReps[0] = getTopReps.executeQuery() ;
+
+}
+
+[[creating-the-procedure-topsalesreps]]
+==== Creating the Procedure: TOPSALESREPS
+
+Before creating the procedure, use HPDM to create a library named
+PAYROLL in the DEMO.PERSNL schema and select the Payroll.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the PERSNL schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 12 HPDM Create Procedure Settings: TOPSALESREPS Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+topsalesreps
+Code
+DEMO.PERSNL.PAYROLL
+Payroll
+topSalesReps
+Parameters
+whichquarter
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+Attributes
+1
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-topsalesreps]]
+==== Calling the Procedure: TOPSALESREPS
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the TOPSALESREPS procedure in trafci:
+
+```
+SQL> CALL demo.persnl.topsalesreps( 1 ) ;
+```
+
+The TOPSALESREPS procedure returns this information about the top five
+sales representatives during the first fiscal quarter:
+
+[cols=",,,",options="header",]
+|===
+FIRST_NAME      LAST_NAME            TOTAL
+--------------- -------------------- --------------------
+XAVIER          SEDLEMEYER                      172460.00
+HERB            ALBERT                           67025.00
+MARTIN          SCHAEFFER                        52000.00
+HEIDI           WEIGL                            28985.00
+JOHN            HUGHES                           22625.00
+
+--- 5 row(s) selected.
+
+--- SQL operation complete.
+```
+
+[[procedures-in-the-invent-schema]]
+== Procedures in the INVENT Schema
+
+The Inventory class contains these SPJ methods, which are useful for
+tracking parts and suppliers:
+
+* link:#_bookmark312["SUPPLIERINFO Procedure" (page 96)]
+* link:#_bookmark320["SUPPLYNUMBERS Procedure" (page 99)]
+* link:#_bookmark328["PARTLOCS Procedure" (page 101)]
+
+Those methods are registered as stored procedures in the INVENT schema.
+link:#_bookmark311[Example 13] shows the code of the Inventory.java
+source file.
+
+Example 13 Inventory.java The Inventory Class
+
+```
+import java.sql.*;
+import java.math.*;
+
+public class Inventory
+{
+   public static void supplierInfo( BigDecimal suppNum
+                                  , String[] suppName
+				  , String[] streetAddr
+				  , String[] cityName
+				  , String[] stateName
+				  , String[] postCode
+				  ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getSupplier =
+         conn.prepareStatement( "SELECT suppname, street, city, "
+	                      + "       state, postcode "
+			      + "FROM demo.invent.supplier "
+			      + "WHERE suppnum = ?"  
+			      ) ;
+
+      getSupplier.setBigDecimal( 1, suppNum ) ;
+      ResultSet rs = getSupplier.executeQuery() ;
+      rs.next() ;
+
+      suppName[0]   = rs.getString( 1 ) ;
+      streetAddr[0] = rs.getString( 2 ) ;
+      cityName[0]   = rs.getString( 3 ) ;
+      stateName[0]  = rs.getString( 4 ) ;
+      postCode[0]   = rs.getString( 5 ) ;
+
+      rs.close() ;
+      conn.close() ;
+
+   } // See the link:#_bookmark312["SUPPLIERINFO Procedure" (page 96)].
+
+   public static void supplyQuantities( int[] avgQty
+                                      , int[] minQty
+				      , int[] maxQty
+				      ) throws SQLException
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getQty =
+         conn.prepareStatement( "SELECT AVG(qty_on_hand), "
+	                      + "       MIN(qty_on_hand), "
+			      + "       MAX(qty_on_hand) "
+			      + "FROM demo.invent.partloc"
+			      ) ;
+
+      ResultSet rs = getQty.executeQuery() ;
+      rs.next() ;
+
+      avgQty[0] = rs.getInt( 1 ) ;
+      minQty[0] = rs.getInt( 2 ) ;
+      maxQty[0] = rs.getInt( 3 ) ;
+
+      rs.close() ;
+      conn.close() ;
+
+   } // See the link:#_bookmark320["SUPPLYNUMBERS Procedure" (page 99)].
+
+   public static void partLocations( int partNum
+                                   , int quantity
+				   , ResultSet exactly[]
+				   , ResultSet moreThan[]
+				   ) throws SQLException
+
+   {
+      Connection conn =
+         DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+      PreparedStatement getLocationsExact =
+         conn.prepareStatement( "SELECT L.loc_code, L.partnum, L.qty_on_hand "
+	                      + "FROM demo.invent.partloc L "
+			      + "WHERE L.partnum = ? "
+			      + "  AND L.qty_on_hand = ? "
+			      + " ORDER BY L.partnum "
+			      ) ;
+
+      getLocationsExact.setInt( 1, partNum ) ;
+      getLocationsExact.setInt( 2, quantity) ;
+
+      PreparedStatement getLocationsMoreThan =
+         conn.prepareStatement( "SELECT L.loc_code, L.partnum, L.qty_on_hand "
+	                      + "FROM demo.invent.partloc L "
+			      + "WHERE L.partnum = ? "
+			      + "  AND L.qty_on_hand > ? "
+			      + "ORDER BY L.partnum "
+			      ) ;
+
+      getLocationsMoreThan.setInt( 1, partNum ) ;
+      getLocationsMoreThan.setInt( 2, quantity) ;
+
+      exactly[0]  = getLocationsExact.executeQuery() ;
+      moreThan[0] = getLocationsMoreThan.executeQuery() ;
+
+   } // See the link:#_bookmark328["PARTLOCS Procedure" (page 101)].
+}
+
+See the following sections for more information about each SPJ method.
+
+[[supplierinfo-procedure]]
+=== SUPPLIERINFO Procedure
+
+The SUPPLIERINFO procedure accepts a supplier number and returns the
+supplier's name, street, city, state, and post code to separate output
+parameters.
+
+[[java-method-supplierinfo]]
+==== Java Method: supplierInfo()
+
+Example 14 supplierInfo() Method
+
+```
+public static void supplierInfo( BigDecimal suppNum
+                               , String[] suppName
+			       , String[] streetAddr
+			       , String[] cityName
+			       , String[] stateName
+			       , String[] postCode
+			       ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getSupplier =
+      conn.prepareStatement( "SELECT suppname, street, city, "
+                           + "       state, postcode "
+			   + "FROM demo.invent.supplier "
+			   + "WHERE suppnum = ?"
+			   ) ;
+
+   getSupplier.setBigDecimal( 1, suppNum ) ;
+   ResultSet rs = getSupplier.executeQuery() ;
+   rs.next() ;
+
+   suppName[0]   = rs.getString( 1 ) ;
+   streetAddr[0] = rs.getString( 2 ) ;
+   cityName[0]   = rs.getString( 3 ) ;
+   stateName[0]  = rs.getString( 4 ) ;
+   postCode[0]   = rs.getString( 5 ) ;
+
+   rs.close() ;
+   conn.close() ;
+}
+```
+
+[[creating-the-procedure-supplierinfo]]
+==== Creating the Procedure: SUPPLIERINFO
+
+Before creating the procedure, use HPDM to create a library named
+INVENTORY in the DEMO.INVENT schema and select the Inventory.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the INVENT schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 13 HPDM Create Procedure Settings: SUPPLIERINFO Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+supplierinfo
+Code
+DEMO.INVENT.INVENTORY
+Inventory
+supplierInfo
+Parameters
+empnum
+SIGNED NUMERIC
+Precision: 4
+Scale: 0
+IN
+Displays the signature of the Java method that you selected:
+java.math.BigDecimal
+suppname
+CHARACTER
+Length: 18
+Varying: not selected
+Upshift: not selected
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+address
+CHARACTER
+Length: 22
+Varying: not selected
+Upshift: not selected
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+city
+CHARACTER
+Length: 14
+Varying: not selected
+Upshift: not selected
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+state
+CHARACTER
+Length: 12
+Varying: not selected
+Upshift: not selected
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+zipcode
+Length: 10
+Varying: not selected
+Upshift: not selected
+Character set: ISO88591
+OUT
+Displays the signature of the Java method that you selected:
+java.lang.String[]
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-supplierinfo]]
+==== Calling the Procedure: SUPPLIERINFO
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the SUPPLIERINFO procedure in trafci:
+
+```
+SQL> CALL demo.invent.supplierinfo( 25,?,?,?,?,? ) ;
+```
+
+The SUPPLIERINFO procedure accepts the supplier number 25 and returns
+this output in trafci:
+
+SUPPNAME           ADDRESS                CITY           STATE        ZIPCODE
+------------------ ---------------------- -------------- ------------ ---------
+Schroeder's Ltd    212 Strasse Blvd West  Hamburg        Rhode Island     22222
+
+--- SQL operation complete.
+```
+
+Supplier number 25 is Schroeder's Ltd. and is located in Hamburg, Rhode Island.
+
+[[supplynumbers-procedure]]
+=== SUPPLYNUMBERS Procedure
+
+The SUPPLYNUMBERS procedure returns the average, minimum, and maximum
+quantities of available parts in inventory to separate output
+parameters.
+
+[[java-method-supplyquantities]]
+==== Java Method: supplyQuantities()
+
+Example 15 supplyQuantities() Method
+
+```
+public static void supplyQuantities( int[] avgQty
+                                   , int[] minQty
+				   , int[] maxQty
+				   ) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getQty =
+      conn.prepareStatement( "SELECT AVG(qty_on_hand), "
+                           + "MIN(qty_on_hand), "
+			   + "MAX(qty_on_hand) "
+			   + "FROM demo.invent.partloc"
+			   ) ;
+
+   ResultSet rs = getQty.executeQuery() ;
+   rs.next() ;
+
+   avgQty[0] = rs.getInt( 1 ) ;
+   minQty[0] = rs.getInt( 2 ) ;
+   maxQty[0] = rs.getInt( 3 ) ;
+
+   rs.close() ;
+   conn.close() ;
+
+}
+
+[[creating-the-procedure-supplynumbers]]
+==== Creating the Procedure: SUPPLYNUMBERS
+
+Before creating the procedure, use HPDM to create a library named
+INVENTORY in the DEMO.INVENT schema and select the Inventory.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the INVENT schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 14 HPDM Create Procedure Settings: SUPPLYNUMBERS Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+supplynumbers
+Code
+DEMO.INVENT.INVENTORY
+Inventory
+supplyQuantities
+Parameters
+avrg
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected: int[]
+minm
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected: int[]
+maxm
+SIGNED INTEGER
+OUT
+Displays the signature of the Java method that you selected: int[]
+Attributes
+0
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-supplynumbers]]
+==== Calling the Procedure: SUPPLYNUMBERS
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the SUPPLYNUMBERS procedure in trafci:
+
+```
+SQL> CALL demo.invent.supplynumbers( ?,?,? ) ;
+```
+
+The SUPPLYNUMBERS procedure returns this output in trafci:
+
+AVRG        MINM        MAXM
+----------- ----------- -----------
+        167           0        1132
+
+--- SQL operation complete.
+```
+
+The average number of items in inventory is 167, the minimum number is
+0, and the maximum number is 1132.
+
+[[partlocs-procedure]]
+=== PARTLOCS Procedure
+
+The PARTLOCS procedure accepts a part number and quantity and returns a
+set of location codes that have the exact quantity and a set of location
+codes that have more than that quantity.
+
+[[java-method-partlocations]]
+==== Java Method: partLocations()
+
+Example 16 partLocations() Method
+
+```
+public static void partLocations( int partNum
+                                , int quantity
+				, ResultSet exactly[]
+				, ResultSet moreThan[]
+				) throws SQLException
+{
+   Connection conn =
+      DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+   PreparedStatement getLocationsExact =
+      conn.prepareStatement( "SELECT L.loc_code, L.partnum, L.qty_on_hand "
+                           + "FROM demo.invent.partloc L "
+			   + "WHERE L.partnum = ? "
+			   + "  AND L.qty_on_hand = ? "
+			   + " ORDER BY L.partnum "
+			   ) ;
+
+   getLocationsExact.setInt( 1, partNum ) ;
+   getLocationsExact.setInt( 2, quantity ) ;
+
+   PreparedStatement getLocationsMoreThan =
+      conn.prepareStatement( "SELECT L.loc_code, L.partnum, L.qty_on_hand "
+                           + "FROM demo.invent.partloc L "
+			   + "WHERE L.partnum = ? "
+			   + "  AND L.qty_on_hand > ? "
+			   + " ORDER BY L.partnum "
+			   ) ;
+
+   getLocationsMoreThan.setInt( 1, partNum ) ;
+   getLocationsMoreThan.setInt( 2, quantity ) ;
+
+   exactly[0]  = getLocationsExact.executeQuery() ;
+   moreThan[0] = getLocationsMoreThan.executeQuery() ;
+}
+```
+
+[[creating-the-procedure-partlocs]]
+==== Creating the Procedure: PARTLOCS
+
+Before creating the procedure, use HPDM to create a library named
+INVENTORY in the DEMO.INVENT schema and select the Inventory.jar file to
+upload to the Trafodion platform for that library. For more information,
+see link:#_bookmark95["Create a Library" (page 29)]. After creating the
+library, navigate to the Procedures folder in the INVENT schema, launch
+the Create Procedure dialog box, and then enter or select these values.
+For more information, see link:#_bookmark116["Create a Procedure" (page
+37)].
+
+Table 15 HPDM Create Procedure Settings: PARTLOCS Procedure
+
+[cols=",,",options="header",]
+|===
+Group Box
+Field or Option
+Value or Setting
+Name
+partlocs
+Code
+DEMO.INVENT.INVENTORY
+Inventory
+partLocations
+Parameters
+partnum
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+qty
+SIGNED INTEGER
+IN
+Displays the signature of the Java method that you selected: int
+Attributes
+2
+selected
+Invoker
+NOTE: Depending on your security requirements, you can select Definer
+instead. For more information, see link:#_bookmark124["Understand
+External] link:#_bookmark124[Security" (page 41)].
+Yes
+|===
+
+[[calling-the-procedure-partlocs]]
+==== Calling the Procedure: PARTLOCS
+
+NOTE: Make sure that users who will be calling the stored procedure have
+the appropriate execute privileges. For more information, see
+link:#bookmark138["Granting Privileges for Executing SPJs" (page 45)].
+
+To invoke the PARTLOCS procedure in trafci:
+
+```
+SQL> CALL demo.invent.partlocs( 212, 18 ) ;
+```
+
+The PARTLOCS procedure accepts the part number 212 and returns a set of
+locations that have 18 of those parts and a set of locations that have
+more than 18 of those parts:
+
+```
+LOC_CODE PARTNUM QTY_ON_HAND
+-------- ------- -----------
+A87          212           18
+
+--- 1 row(s) selected.
+
+LOC_CODE PARTNUM QTY_ON_HAND
+-------- ------- -----------
+G87          212          20
+
+--- 1 row(s) selected.
+
+--- SQL operation complete.
+```
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/spj_guide/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/index.adoc b/docs/spj_guide/src/asciidoc/index.adoc
new file mode 100644
index 0000000..17afeb7
--- /dev/null
+++ b/docs/spj_guide/src/asciidoc/index.adoc
@@ -0,0 +1,113 @@
+////
+* @@@ 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 @@@ 
+////
+
+= Stored Procedures in Java (SPJs) Guide
+:doctype: book
+:numbered:
+:toc: left
+:toclevels: 3
+:toc-title: Table of Contents
+:icons: font
+:iconsdir: icons
+:experimental:
+:source-language: text
+:revnumber: {project-version}
+:title-logo-image: ../../../shared/trafodion-logo.jpg
+
+:images: ../images
+:sourcedir: ../../resources/source
+
+:leveloffset: 1
+
+// The directory is called _chapters because asciidoctor skips direct
+// processing of files found in directories starting with an _. This
+// prevents each chapter being built as its own book.
+
+**License Statement**
+
+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.
+
+*Acknowledgements*
+
+Microsoft®, Windows®, Windows NT®, Windows® XP, and Windows Vista® are
+U.S. registered trademarks of Microsoft Corporation. Intel® and Intel®
+Itanium® are trademarks of Intel Corporation in the U.S. and other
+countries. Java® is a registered trademark of Oracle and/or its
+affiliates. Motif, OSF/1, UNIX®, X/Open®, and the X device is a
+trademark of X/Open Company Ltd. in the UK and other countries. OSF,
+OSF/1, OSF/Motif, Motif, and Open Software Foundation are trademarks of
+the Open Software Foundation in the U.S. and other countries.
+
+© 1990, 1991, 1992, 1993 Open Software Foundation, Inc. The OSF
+documentation and the OSF software to which it relates are derived in
+part from materials supplied by the following: © 1987, 1988, 1989
+Carnegie-Mellon University. © 1989, 1990, 1991 Digital Equipment
+Corporation.
+
+<<<
+© 1985, 1988, 1989, 1990 Encore Computer Corporation. © 1988 Free
+Software Foundation, Inc. © 1987, 1988, 1989, 1990, 1991 Hewlett-Packard
+Company. © 1985, 1987, 1988, 1989, 1990, 1991, 1992 International
+Business Machines Corporation. © 1988, 1989 Massachusetts Institute of
+Technology. © 1988, 1989, 1990 Mentat Inc. © 1988 Microsoft Corporation.
+© 1987, 1988, 1989, 1990, 1991,
+1992 SecureWare, Inc. © 1990, 1991 Siemens Nixdorf Informations systeme
+AG. © 1986, 1989, 1996, 1997 Sun Microsystems, Inc. © 1989, 1990, 1991
+Transarc Corporation.
+
+OSF software and documentation are based in part
+on the Fourth Berkeley Software Distribution under license from The
+Regents of the University of California. OSF acknowledges the following
+individuals and institutions for their role in its development: Kenneth
+C.R.C. Arnold, Gregory S. Couch, Conrad C. Huang, Ed James, Symmetric
+Computer Systems, Robert Elz. © 1980, 1981, 1982, 1983, 1985, 1986,
+1987, 1988, 1989 Regents of the University of California. OSF MAKES NO
+WARRANTY OF ANY KIND WITH REGARD TO THE OSF MATERIAL PROVIDED HEREIN,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. OSF shall not be liable for errors
+contained herein or for incidental consequential damages in connection
+with the furnishing, performance, or use of this material.
+
+*Revision History*
+
+[cols="2",options="header"]
+|===
+| Version    | Date
+| 2.0.0      | To be announced.
+| 1.3.0      | January, 2016  
+|===
+
+include::asciidoc/_chapters/about.adoc[]
+include::asciidoc/_chapters/introduction.adoc[]
+include::asciidoc/_chapters/get_started.adoc[]
+include::asciidoc/_chapters/develop_spjs.adoc[]
+include::asciidoc/_chapters/execute_spjs.adoc[]
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/src/site/markdown/documentation.md
----------------------------------------------------------------------
diff --git a/docs/src/site/markdown/documentation.md b/docs/src/site/markdown/documentation.md
index a3848eb..89155b5 100644
--- a/docs/src/site/markdown/documentation.md
+++ b/docs/src/site/markdown/documentation.md
@@ -18,16 +18,20 @@ This page provides links to the per-release Trafodion documentation.
 
 Document                                              | Formats
 ------------------------------------------------------|-----------------------------------
+Scalar UDFs in C                                      | [wiki](https://cwiki.apache.org/confluence/display/TRAFODION/Scalar+UDFs+-+In+C)
 Trafodion Client Installation Guide                   | [Web Book](docs/client_install/index.html),[PDF](docs/client_install/Trafodion_Client_Installation_Guide.pdf)
+Trafodion Code Examples                               | [wiki](https://cwiki.apache.org/confluence/display/TRAFODION/Trafodion+Code+Examples)
 Trafodion Command Interface Guide                     | [Web Book](docs/command_interface/index.html),[PDF](docs/command_interface/Trafodion_Command_Interface_Guide.pdf)
 Trafodion Control Query Default (CQD) Reference Guide | [Web Book](docs/cqd_reference/index.html),[PDF](docs/cqd_interface/Trafodion_CQD_Reference_Guide.pdf)
 Trafodion Database Connectivity Services Guide        | [Web Book](docs/dcs_reference/index.html),[API](docs/dcs_reference/apidocs/index.html)
 Trafodion Load and Transform Guide                    | [Web Book](docs/load_transform/index.html),[PDF](docs/load_transform/Trafodion_Load_Transform_Guide.pdf)
 Trafodion Messages Guide                              | [Web Book](docs/messages_guide/index.html),[PDF](docs/messages_guide/Trafodion_Messages_Guide.pdf)
+Trafodion Manageability                               | [wiki](https://cwiki.apache.org/confluence/display/TRAFODION/Trafodion+Manageability)
 Trafodion odb User Guide                              | [Web Book](docs/odb/index.html),[PDF](docs/odb/Trafodion_odb_User_Guide.pdf)
 Trafodion Provisioning Guide                          | [Web Book](docs/provisioning_guide/index.html),[PDF](docs/provisioning_guide/Trafodion_Provisioning_Guide.pdf)
 Trafodion REST Server Reference Guide                 | [Web Book](docs/rest_reference/index.html),[API](docs/rest_reference/apidocs/index.html)
 Trafodion SQL Reference Manual                        | [Web Book](docs/sql_reference/index.html),[PDF](docs/sql_reference/Trafodion_SQL_Reference_Manual.pdf)
+UDF Tutorial                                          | [wiki](https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface)
 
 # 2.0.0 (In Development)
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/docs/src/site/markdown/download.md
----------------------------------------------------------------------
diff --git a/docs/src/site/markdown/download.md b/docs/src/site/markdown/download.md
index 66e0c2f..356e568 100644
--- a/docs/src/site/markdown/download.md
+++ b/docs/src/site/markdown/download.md
@@ -26,7 +26,7 @@ The Trafodion end-user environment is installed using the Trafodion Installer, w
 * [log4c++ RPM](http://traf-builds.esgyn.com/downloads/trafodion/publish/release/1.3.0/log4cxx-0.10.0-13.el6.x86_64.rpm)
 * [Trafodion Installer](http://traf-builds.esgyn.com/downloads/trafodion/publish/release/1.3.0/apache-trafodion-installer-1.3.0-incubating-bin.tar.gz)
 * [Trafodion Server](http://traf-builds.esgyn.com/downloads/trafodion/publish/release/1.3.0/apache-trafodion-1.3.0-incubating-bin.tar.gz)
-* [Trafodion Clients](http://traf-builds.esgyn.com/downloads/trafodion/publish/release/1.3.0/apache-trafodion-clients-1.3.0-incubating-bin.tar.gz)
+* [Trafodion Clients](http://traf-builds.esgyn.com/downloads/trafodion/publish/release/1.3.0/apache-trafodion-clients-1.3.0-incubating-bin.tar.gz) (JDBC, odb, ODBC, trafci)
 
 # Install
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c86d2385/install/installer/rest_installer
----------------------------------------------------------------------
diff --git a/install/installer/rest_installer b/install/installer/rest_installer
index 68888c2..2907c2a 100755
--- a/install/installer/rest_installer
+++ b/install/installer/rest_installer
@@ -44,7 +44,7 @@ EOF
 # Default parameters
 typeset REST_BUILD_FILE=""
 typeset REST_INSTALL_PATH="$MY_SQROOT"
-
+typeset TRAF_CONFIG="/etc/trafodion/trafodion_config"
 # Parse input parameters
 while [[ $# -gt 0 ]]; do
     case "$1" in
@@ -76,7 +76,9 @@ while [[ $# -gt 0 ]]; do
   shift
 done
 
+source 
 echo "***INFO: Start of REST Server install"
+source $TRAF_CONFIG
 
 # Make sure required env vars have been set first
 if [[ -z "$MY_SQROOT" ]]; then
@@ -108,13 +110,6 @@ mv $MY_SQROOT/sqenvcom.temp $MY_SQROOT/sqenvcom.sh
 cd $REST_DIR/conf
 
 echo "***INFO: modifying $REST_DIR/conf/rest-site.xml"
-# get zookeeper quorum
-
-lineNumber=$(grep -n "zookeeper\.quorum" /etc/hbase/conf/hbase-site.xml | sed 's/\:.*//')
-lineNumber=$((lineNumber+1))
-
-ZOOKEEPER_NODES=`sed "$lineNumber!d" /etc/hbase/conf/hbase-site.xml | sed 's/\/value.*//' | sed 's/.*>//' | sed 's/.$//'`
-
 # add zookeeper quorum property to end of configuration
 rm rest-site.temp 2>/dev/null
 cat rest-site.xml | sed -e "s@</configuration>@  <property>\n    <name>rest.zookeeper.quorum</name>\n    <value>$ZOOKEEPER_NODES</value>\n  </property>\n </configuration>@" > rest-site.temp


[19/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index fb9c802..d6325e7 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -1,4 +1,4 @@
- /**********************************************************************
+/**********************************************************************
 // @@@ START COPYRIGHT @@@
 //
 // Licensed to the Apache Software Foundation (ASF) under one
@@ -1530,11 +1530,18 @@ short CmpSeabaseDDL::createSeabaseTable2(
     objectOwnerID = schemaOwnerID;
 
   // check if SYSKEY is specified as a column name.
-  NABoolean explicitSyskeySpecified = FALSE;
   for (Lng32 i = 0; i < colArray.entries(); i++)
     {
-      if (colArray[i]->getColumnName() == "SYSKEY")
-        explicitSyskeySpecified = TRUE;
+      if ((CmpCommon::getDefault(TRAF_ALLOW_RESERVED_COLNAMES) == DF_OFF) &&
+          (ComTrafReservedColName(colArray[i]->getColumnName())))
+        {
+          *CmpCommon::diags() << DgSqlCode(-1269)
+                              << DgString0(colArray[i]->getColumnName());
+          
+          deallocEHI(ehi);
+          processReturn();
+          return -1;
+        }
     }
 
   NABoolean implicitPK = FALSE;
@@ -1562,18 +1569,6 @@ short CmpSeabaseDDL::createSeabaseTable2(
       numSysCols++;
     }
 
-  if ((implicitPK) && (explicitSyskeySpecified))
-    {
-      *CmpCommon::diags() << DgSqlCode(-1080)
-                                << DgColumnName("SYSKEY");
-
-      deallocEHI(ehi); 
-
-      processReturn();
-
-      return -1;
-    }
-
   int numSaltPartns = 0; // # of "_SALT_" values
   int numSplits = 0;     // # of initial region splits
 
@@ -1582,7 +1577,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
   
   if ((createTableNode->getSaltOptions()) ||
       ((numSaltPartnsFromCQD > 0) &&
-       (NOT (implicitPK || explicitSyskeySpecified))))
+       (NOT implicitPK)))
     {
       // add a system column SALT INTEGER NOT NULL with a computed
       // default value HASH2PARTFUNC(<salting cols> FOR <num salt partitions>)
@@ -1615,7 +1610,17 @@ short CmpSeabaseDDL::createSeabaseTable2(
         {
           const NAString &colName = (*saltArray)[i]->getColumnName();
           ComAnsiNamePart cnp(colName, ComAnsiNamePart::INTERNAL_FORMAT);
-          CollIndex      colIx    = colArray.getColumnIndex(colName);
+          Lng32      colIx    = colArray.getColumnIndex(colName);
+          if (colIx < 0)
+            {
+              *CmpCommon::diags() << DgSqlCode(-1009)
+                                  << DgColumnName(colName);
+              
+              deallocEHI(ehi); 
+              processReturn();
+              return -1;
+            }
+
           NAType         *colType = colArray[colIx]->getColumnDataType();
           NAString       typeText;
           short          rc       = colType->getMyTypeAsText(&typeText, FALSE);
@@ -1904,7 +1909,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
       if (colType->getFSDatatype() == REC_BLOB || colType->getFSDatatype() == REC_CLOB)
 	//Cannot allow LOB in primary or clustering key 
 	{
-	  *CmpCommon::diags() << DgSqlCode(CAT_LOB_COL_CANNOT_BE_INDEX_OR_KEY)
+	  *CmpCommon::diags() << DgSqlCode(-CAT_LOB_COL_CANNOT_BE_INDEX_OR_KEY)
                               << DgColumnName(colName);
 
           deallocEHI(ehi); 
@@ -2224,8 +2229,13 @@ short CmpSeabaseDDL::createSeabaseTable2(
     }
   
   Int64 lobMaxSize =  CmpCommon::getDefaultNumeric(LOB_MAX_SIZE)*1024*1024;
+
+  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
+   
   if (j > 0)
     {
+      Int32 rc = sendAllControls(FALSE, FALSE, TRUE);
       //if the table is a volatile table return an error
       if (createTableNode->isVolatile())
         {
@@ -2241,13 +2251,13 @@ short CmpSeabaseDDL::createSeabaseTable2(
                                   catalogNamePart.data(), schemaNamePart.data(), 
                                   objectNamePart.data(),
                                   COM_BASE_TABLE_OBJECT_LIT);
-      
+     
       ComString newSchName = "\"";
       newSchName += catalogNamePart;
       newSchName.append("\".\"");
       newSchName.append(schemaNamePart);
       newSchName += "\"";
-      Lng32 rc = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
+       rc = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
                                           newSchName.length(),
                                           objUID,
                                           j,
@@ -2255,8 +2265,10 @@ short CmpSeabaseDDL::createSeabaseTable2(
                                           lobNumList,
                                           lobTypList,
                                           lobLocList,
+                                          (char *)lobHdfsServer,
+                                          lobHdfsPort,
                                           lobMaxSize);
-      
+       
       if (rc < 0)
         {
           //sss TBD need to retrive the cli diags here.
@@ -2264,11 +2276,12 @@ short CmpSeabaseDDL::createSeabaseTable2(
                               << DgTableName(extTableName);
           deallocEHI(ehi); 	   
           processReturn();
-          
+	   
           return -2;
         }
-    } // j > 0
-  
+    }
+
+
   // if not a compound create, update valid def to true.
   if (NOT ((createTableNode->getAddConstraintUniqueArray().entries() > 0) ||
            (createTableNode->getAddConstraintRIArray().entries() > 0) ||
@@ -3050,7 +3063,9 @@ short CmpSeabaseDDL::dropSeabaseTable2(
     }
   else if (dropTableNode->getDropBehavior() == COM_CASCADE_DROP_BEHAVIOR)
     {
-      cliRC = getUsingViews(cliInterface, objUID, usingViewsQueue);
+      cliRC = getAllUsingViews(cliInterface, 
+                               catalogNamePart, schemaNamePart, objectNamePart,
+                               usingViewsQueue);
       if (cliRC < 0)
         {
           deallocEHI(ehi); 
@@ -3099,13 +3114,14 @@ short CmpSeabaseDDL::dropSeabaseTable2(
   // Drop referencing objects
   char query[4000];
 
+  // drop the views.
+  // usingViewsQueue contain them in ascending order of their create
+  // time. Drop them from last to first.
   if (usingViewsQueue)
     {
-      usingViewsQueue->position();
-      for (int idx = 0; idx < usingViewsQueue->numEntries(); idx++)
+      for (int idx = usingViewsQueue->numEntries()-1; idx >= 0; idx--)
         {
-          OutputInfo * vi = (OutputInfo*)usingViewsQueue->getNext(); 
-          
+          OutputInfo * vi = (OutputInfo*)usingViewsQueue->get(idx);
           char * viewName = vi->get(0);
           
           if (dropOneTableorView(*cliInterface,viewName,COM_VIEW_OBJECT,false))
@@ -3334,8 +3350,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
           processReturn();
           
           return -1;
-        }
-      
+        }     
     }
 
   // drop all check constraints from metadata if 'no check' is not specified.
@@ -3553,6 +3568,8 @@ short CmpSeabaseDDL::dropSeabaseTable2(
   short *lobNumList = new (STMTHEAP) short[numCols];
   short *lobTypList = new (STMTHEAP) short[numCols];
   char  **lobLocList = new (STMTHEAP) char*[numCols];
+  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   Lng32 j = 0;
   for (Int32 i = 0; i < nacolArr.entries(); i++)
     {
@@ -3573,7 +3590,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 	  
 	  const char* f = ActiveSchemaDB()->getDefaults().
 	    getValue(LOB_STORAGE_FILE_DIR);
-	  
+	   
 	  strcpy(loc, f);
 	  
 	  lobLocList[j] = loc;
@@ -3582,6 +3599,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
     }
   if (j > 0)
     {
+      Int32 rc = sendAllControls(FALSE, FALSE, TRUE);
       Int64 objUID = getObjectUID(cliInterface,
 				  catalogNamePart.data(), schemaNamePart.data(), 
 				  objectNamePart.data(),
@@ -3592,14 +3610,14 @@ short CmpSeabaseDDL::dropSeabaseTable2(
       newSchName.append("\".\"");
       newSchName.append(schemaNamePart);
       newSchName += "\"";
-      Lng32 rc = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
+      rc = SQL_EXEC_LOBddlInterface((char*)newSchName.data(),
 					  newSchName.length(),
 					  objUID,
 					  j,
 					  LOB_CLI_DROP,
 					  lobNumList,
 					  lobTypList,
-					  lobLocList,0);
+					  lobLocList,(char *)lobHdfsServer, lobHdfsPort,0);
       if (rc < 0)
 	{
 	  *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_DROP_OBJECT)
@@ -3888,7 +3906,29 @@ void CmpSeabaseDDL::renameSeabaseTable(
       return;
     }
 
-  Int64 objUID = getObjectUID(&cliInterface,
+  // cascade option not supported
+  if (renameTableNode->isCascade())
+    {
+      *CmpCommon::diags() << DgSqlCode(-1427)
+                          << DgString0("Reason: Cascade option not supported.");
+      
+      processReturn();
+      return;
+    }
+
+  const CheckConstraintList &checkList = naTable->getCheckConstraints();
+  if (checkList.entries() > 0)
+    {
+      *CmpCommon::diags()
+        << DgSqlCode(-1427)
+        << DgString0("Reason: Operation not allowed if check constraints are present. Drop the constraints and recreate them after rename.");
+      
+      processReturn();
+      
+      return;
+    }
+    
+   Int64 objUID = getObjectUID(&cliInterface,
                               catalogNamePart.data(), schemaNamePart.data(), 
                               objectNamePart.data(),
                               COM_BASE_TABLE_OBJECT_LIT);
@@ -3913,7 +3953,7 @@ void CmpSeabaseDDL::renameSeabaseTable(
   if (usingViewsQueue->numEntries() > 0)
     {
       *CmpCommon::diags() << DgSqlCode(-1427)
-                          << DgString0("Reason: Dependent views exist.");
+                          << DgString0("Reason: Operation not allowed if dependent views exist. Drop the views and recreate them after rename.");
       
       processReturn();
       return;
@@ -4261,26 +4301,6 @@ short CmpSeabaseDDL::cloneSeabaseTable(
   return 0;
 }
 
-short CmpSeabaseDDL::recreateViews(ExeCliInterface &cliInterface,
-                                   NAList<NAString> &viewNameList,
-                                   NAList<NAString> &viewDefnList)
-{
-  Lng32 cliRC = 0;
-
-  for (Lng32 i = 0; i < viewDefnList.entries(); i++)
-    {
-      cliRC = cliInterface.executeImmediate(viewDefnList[i]);
-      if (cliRC < 0)
-        {
-          cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
-          
-          return -1;
-        }
-    }
-
-  return 0;
-}
-
 void CmpSeabaseDDL::alterSeabaseTableAddColumn(
                                                StmtDDLAlterTableAddColumn * alterAddColNode,
                                                NAString &currCatName, NAString &currSchName)
@@ -4333,6 +4353,16 @@ void CmpSeabaseDDL::alterSeabaseTableAddColumn(
       return;
     }
 
+  if (retcode == 0) // does not exist
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_WRONG_TYPE)
+                          << DgString0(extTableName);
+
+      processReturn();
+
+      return;
+    }
+
   ActiveSchemaDB()->getNATableDB()->useCache();
 
   BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
@@ -4454,6 +4484,17 @@ void CmpSeabaseDDL::alterSeabaseTableAddColumn(
       return;
     }
 
+  if ((CmpCommon::getDefault(TRAF_ALLOW_RESERVED_COLNAMES) == DF_OFF) &&
+      (ComTrafReservedColName(colName)))
+    {
+      *CmpCommon::diags() << DgSqlCode(-1269)
+                          << DgString0(colName);
+      
+      deallocEHI(ehi);
+      processReturn();
+      return;
+    }
+
   if (colFamily.isNull())
     {
       colFamily = naTable->defaultColFam();
@@ -4844,101 +4885,390 @@ short CmpSeabaseDDL::updateMDforDropCol(ExeCliInterface &cliInterface,
   return 0;
 }
 
-void CmpSeabaseDDL::alterSeabaseTableDropColumn(
-                                                StmtDDLAlterTableDropColumn * alterDropColNode,
-                                                NAString &currCatName, NAString &currSchName)
+///////////////////////////////////////////////////////////////////////
+//
+// An aligned table constains all columns in one hbase cell.
+// To drop a column, we need to read each row, create a
+// new row with the removed column and insert into the original table.
+//
+// Steps to drop a column from an aligned table:
+//
+// -- make a copy of the source aligned table using hbase copy
+// -- truncate the source table
+// -- Update metadata and remove the dropped column.
+// -- bulk load data from copied table into the source table
+// -- drop the copied temp table
+//
+// If an error happens after the source table has been truncated, then
+// it will be restored from the copied table.
+//
+///////////////////////////////////////////////////////////////////////
+short CmpSeabaseDDL::alignedFormatTableDropColumn
+(
+ const NAString &catalogNamePart,
+ const NAString &schemaNamePart,
+ const NAString &objectNamePart,
+ const NATable * naTable,
+ const NAString &altColName,
+ ElemDDLColDef *pColDef,
+ NABoolean ddlXns,
+ NAList<NAString> &viewNameList,
+ NAList<NAString> &viewDefnList)
 {
   Lng32 cliRC = 0;
-  Lng32 retcode = 0;
 
-  const NAString &tabName = alterDropColNode->getTableName();
+  const NAFileSet * naf = naTable->getClusteringIndex();
+  
+  CorrName cn(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
 
-  ComObjectName tableName(tabName, COM_TABLE_NAME);
-  ComAnsiNamePart currCatAnsiName(currCatName);
-  ComAnsiNamePart currSchAnsiName(currSchName);
-  tableName.applyDefaults(currCatAnsiName, currSchAnsiName);
+  ComUID comUID;
+  comUID.make_UID();
+  Int64 objUID = comUID.get_value();
+  
+  char objUIDbuf[100];
 
-  const NAString catalogNamePart = tableName.getCatalogNamePartAsAnsiString();
-  const NAString schemaNamePart = tableName.getSchemaNamePartAsAnsiString(TRUE);
-  const NAString objectNamePart = tableName.getObjectNamePartAsAnsiString(TRUE);
-  const NAString extTableName = tableName.getExternalName(TRUE);
-  const NAString extNameForHbase = catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
+  NAString tempTable(naTable->getTableName().getQualifiedNameAsAnsiString());
+  tempTable += "_";
+  tempTable += str_ltoa(objUID, objUIDbuf);
 
-  ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
-  CmpCommon::context()->sqlSession()->getParentQid());
+  ExpHbaseInterface * ehi = allocEHI();
+  ExeCliInterface cliInterface
+    (STMTHEAP, NULL, NULL, 
+     CmpCommon::context()->sqlSession()->getParentQid());
 
-  if ((isSeabaseReservedSchema(tableName)) &&
-      (!Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)))
+  Int64 tableUID = naTable->objectUid().castToInt64();
+  const NAColumnArray &naColArr = naTable->getNAColumnArray();
+  const NAColumn * altNaCol = naColArr.getColumn(altColName);
+  Lng32 altColNum = altNaCol->getPosition();
+
+  NAString tgtCols;
+  NAString srcCols;
+
+ NABoolean xnWasStartedHere = FALSE;
+
+  char buf[4000];
+
+  if (cloneSeabaseTable(cn, naTable, tempTable, ehi, &cliInterface))
     {
-      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_DEFINITION_METADATA_SCHEMA);
-      processReturn();
-      return;
+      cliRC = -1;
+      goto label_drop;
     }
-
-  ExpHbaseInterface * ehi = allocEHI();
-  if (ehi == NULL)
+  
+  if (truncateHbaseTable(catalogNamePart, schemaNamePart, objectNamePart,
+                         (NATable*)naTable, ehi))
     {
-      processReturn();
-      
-      return;
+      cliRC = -1;
+      goto label_restore;
     }
 
-  retcode = existsInSeabaseMDTable(&cliInterface, 
-                                   catalogNamePart, schemaNamePart, objectNamePart,
-                                   COM_BASE_TABLE_OBJECT,
-                                   (Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL) 
-                                    ? FALSE : TRUE),
-                                   TRUE, TRUE);
-  if (retcode < 0)
+  if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
     {
-      processReturn();
-
-      return;
+      cliRC = -1;
+      goto label_restore;
     }
 
-  ActiveSchemaDB()->getNATableDB()->useCache();
-
-  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
-  CorrName cn(tableName.getObjectNamePart().getInternalName(),
-              STMTHEAP,
-              tableName.getSchemaNamePart().getInternalName(),
-              tableName.getCatalogNamePart().getInternalName());
+  if (updateMDforDropCol(cliInterface, naTable, altColNum))
+    {
+      cliRC = -1;
+      goto label_restore;
+    }
+  
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, 
+     COM_BASE_TABLE_OBJECT, ddlXns, FALSE);
 
-  const NATable *naTable = bindWA.getNATable(cn); 
-  if (naTable == NULL || bindWA.errStatus())
+  for (Int32 c = 0; c < naColArr.entries(); c++)
     {
-      *CmpCommon::diags()
-        << DgSqlCode(-4082)
-        << DgTableName(cn.getExposedNameAsAnsiString());
-    
-      processReturn();
+      const NAColumn * nac = naColArr[c];
+      if (nac->getColName() == altColName)
+        continue;
 
-      return;
-    }
+      if (nac->isComputedColumn())
+        continue;
 
-  // Make sure user has the privilege to perform the drop column
-  if (!isDDLOperationAuthorized(SQLOperation::ALTER_TABLE,
-                                naTable->getOwner(),naTable->getSchemaOwner()))
-  {
-     *CmpCommon::diags() << DgSqlCode(-CAT_NOT_AUTHORIZED);
+      if (nac->isSystemColumn())
+        continue;
 
-     processReturn ();
+      tgtCols += nac->getColName();
+      tgtCols += ",";
+    } // for
 
-     return;
-  }
+  tgtCols = tgtCols.strip(NAString::trailing, ',');
 
-  // return an error if trying to drop a column from a volatile table
-  if (naTable->isVolatileTable())
+  str_sprintf(buf, "upsert using load into %s(%s) select %s from %s",
+              naTable->getTableName().getQualifiedNameAsAnsiString().data(),
+              tgtCols.data(),
+              tgtCols.data(),
+              tempTable.data());
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
     {
-      *CmpCommon::diags() << DgSqlCode(-CAT_REGULAR_OPERATION_ON_VOLATILE_OBJECT);
-     
-      processReturn ();
-
-      return;
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      goto label_restore;
     }
 
-  const NAColumnArray &nacolArr = naTable->getNAColumnArray();
-  const NAString &colName = alterDropColNode->getColName();
+  if ((cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                                  ddlXns)) < 0)
+    {
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(altColName)
+                          << DgString0(reason);
+      goto label_restore;
+    }
+
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, 0);
+
+  str_sprintf(buf, "drop table %s", tempTable.data());
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      goto label_restore;
+    }
+  
+  deallocEHI(ehi); 
+  
+  return 0;
+
+ label_restore:
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, -1);
+
+  cloneHbaseTable(tempTable, 
+                  naTable->getTableName().getQualifiedNameAsAnsiString(),
+                  ehi);
+ 
+ label_drop:  
+  str_sprintf(buf, "drop table %s", tempTable.data());
+  Lng32 cliRC2 = cliInterface.executeImmediate(buf);
+  
+  deallocEHI(ehi); 
+  
+  return (cliRC < 0 ? -1 : 0);  
+}
+
+short CmpSeabaseDDL::hbaseFormatTableDropColumn(
+     ExpHbaseInterface *ehi,
+     const NAString &catalogNamePart,
+     const NAString &schemaNamePart,
+     const NAString &objectNamePart,
+     const NATable * naTable,
+     const NAString &altColName,
+     const NAColumn * nacol,
+     NABoolean ddlXns,
+     NAList<NAString> &viewNameList,
+     NAList<NAString> &viewDefnList)
+{
+  Lng32 cliRC = 0;
+
+  const NAString extNameForHbase = 
+    catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
+
+  ExeCliInterface cliInterface(
+       STMTHEAP, NULL, NULL, 
+       CmpCommon::context()->sqlSession()->getParentQid());
+
+  Lng32 colNumber = nacol->getPosition();
+
+  NABoolean xnWasStartedHere = FALSE;
+  if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
+    {
+      cliRC = -1;
+      goto label_error;
+    }
+  
+  if (updateMDforDropCol(cliInterface, naTable, colNumber))
+    {
+      cliRC = -1;
+      goto label_error;
+    }
+  
+  // remove column from all rows of the base table
+  HbaseStr hbaseTable;
+  hbaseTable.val = (char*)extNameForHbase.data();
+  hbaseTable.len = extNameForHbase.length();
+  
+  {
+    NAString column(nacol->getHbaseColFam(), heap_);
+    column.append(":");
+    
+    char * colQualPtr = (char*)nacol->getHbaseColQual().data();
+    Lng32 colQualLen = nacol->getHbaseColQual().length();
+    Int64 colQval = str_atoi(colQualPtr, colQualLen);
+    if (colQval <= UCHAR_MAX)
+      {
+        unsigned char c = (unsigned char)colQval;
+        column.append((char*)&c, 1);
+      }
+    else if (colQval <= USHRT_MAX)
+      {
+        unsigned short s = (unsigned short)colQval;
+        column.append((char*)&s, 2);
+      }
+    else if (colQval <= ULONG_MAX)
+      {
+        Lng32 l = (Lng32)colQval;
+        column.append((char*)&l, 4);
+      }
+    else
+      column.append((char*)&colQval, 8);
+    
+    HbaseStr colNameStr;
+    char * col = (char *) heap_->allocateMemory(column.length() + 1, FALSE);
+    if (col)
+      {
+        memcpy(col, column.data(), column.length());
+        col[column.length()] = 0;
+        colNameStr.val = col;
+        colNameStr.len = column.length();
+      }
+    else
+      {
+        cliRC = -EXE_NO_MEM_TO_EXEC;
+        *CmpCommon::diags() << DgSqlCode(-EXE_NO_MEM_TO_EXEC);  // error -8571
+        
+        goto label_error;
+      }
+    
+    cliRC = ehi->deleteColumns(hbaseTable, colNameStr);
+    if (cliRC < 0)
+      {
+        *CmpCommon::diags() << DgSqlCode(-8448)
+                            << DgString0((char*)"ExpHbaseInterface::deleteColumns()")
+                            << DgString1(getHbaseErrStr(-cliRC))
+                            << DgInt0(-cliRC)
+                            << DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+        
+        goto label_error;
+      }
+  }
+  
+  if ((cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                                  ddlXns)) < 0)
+    {
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(altColName)
+                          << DgString0(reason);
+      goto label_error;
+    }
+
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, 0);
+  
+  return 0;
+
+ label_error:
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, -1);
+
+  return -1;
+}
+
+void CmpSeabaseDDL::alterSeabaseTableDropColumn(
+                                                StmtDDLAlterTableDropColumn * alterDropColNode,
+                                                NAString &currCatName, NAString &currSchName)
+{
+  Lng32 cliRC = 0;
+  Lng32 retcode = 0;
+
+  const NAString &tabName = alterDropColNode->getTableName();
+
+  ComObjectName tableName(tabName, COM_TABLE_NAME);
+  ComAnsiNamePart currCatAnsiName(currCatName);
+  ComAnsiNamePart currSchAnsiName(currSchName);
+  tableName.applyDefaults(currCatAnsiName, currSchAnsiName);
+
+  const NAString catalogNamePart = tableName.getCatalogNamePartAsAnsiString();
+  const NAString schemaNamePart = tableName.getSchemaNamePartAsAnsiString(TRUE);
+  const NAString objectNamePart = tableName.getObjectNamePartAsAnsiString(TRUE);
+  const NAString extTableName = tableName.getExternalName(TRUE);
+  const NAString extNameForHbase = catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
+
+  ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
+  CmpCommon::context()->sqlSession()->getParentQid());
+
+  if ((isSeabaseReservedSchema(tableName)) &&
+      (!Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)))
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_DEFINITION_METADATA_SCHEMA);
+      processReturn();
+      return;
+    }
+
+  ExpHbaseInterface * ehi = allocEHI();
+  if (ehi == NULL)
+    {
+      processReturn();
+      
+      return;
+    }
+
+  retcode = existsInSeabaseMDTable(&cliInterface, 
+                                   catalogNamePart, schemaNamePart, objectNamePart,
+                                   COM_BASE_TABLE_OBJECT,
+                                   (Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL) 
+                                    ? FALSE : TRUE),
+                                   TRUE, TRUE);
+  if (retcode < 0)
+    {
+      processReturn();
+
+      return;
+    }
+
+  if (retcode == 0) // does not exist
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_WRONG_TYPE)
+                          << DgString0(extTableName);
+
+      processReturn();
+
+      return;
+    }
+
+  ActiveSchemaDB()->getNATableDB()->useCache();
+
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  CorrName cn(tableName.getObjectNamePart().getInternalName(),
+              STMTHEAP,
+              tableName.getSchemaNamePart().getInternalName(),
+              tableName.getCatalogNamePart().getInternalName());
+
+  const NATable *naTable = bindWA.getNATable(cn); 
+  if (naTable == NULL || bindWA.errStatus())
+    {
+      *CmpCommon::diags()
+        << DgSqlCode(-4082)
+        << DgTableName(cn.getExposedNameAsAnsiString());
+    
+      processReturn();
+
+      return;
+    }
+
+  // Make sure user has the privilege to perform the drop column
+  if (!isDDLOperationAuthorized(SQLOperation::ALTER_TABLE,
+                                naTable->getOwner(),naTable->getSchemaOwner()))
+  {
+     *CmpCommon::diags() << DgSqlCode(-CAT_NOT_AUTHORIZED);
+
+     processReturn ();
+
+     return;
+  }
+
+  // return an error if trying to drop a column from a volatile table
+  if (naTable->isVolatileTable())
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_REGULAR_OPERATION_ON_VOLATILE_OBJECT);
+     
+      processReturn ();
+
+      return;
+    }
+
+  const NAColumnArray &nacolArr = naTable->getNAColumnArray();
+  const NAString &colName = alterDropColNode->getColName();
 
   const NAColumn * nacol = nacolArr.getColumn(colName);
   if (! nacol)
@@ -5016,7 +5346,8 @@ void CmpSeabaseDDL::alterSeabaseTableDropColumn(
   // this operation cannot be done if a xn is already in progress.
   if (xnInProgress(&cliInterface))
     {
-      *CmpCommon::diags() << DgSqlCode(-20123);
+      *CmpCommon::diags() << DgSqlCode(-20123)
+                          << DgString0("ALTER");
       
       processReturn();
       return;
@@ -5024,6 +5355,20 @@ void CmpSeabaseDDL::alterSeabaseTableDropColumn(
 
   Int64 objUID = naTable->objectUid().castToInt64();
 
+  NAList<NAString> viewNameList;
+  NAList<NAString> viewDefnList;
+  if (saveAndDropUsingViews(objUID, &cliInterface, viewNameList, viewDefnList))
+    {
+      NAString reason = "Error occurred while saving views.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+      
+      return;
+    }
+
   NABoolean xnWasStartedHere = FALSE;
 
   Lng32 colNumber = nacol->getPosition();
@@ -5035,81 +5380,27 @@ void CmpSeabaseDDL::alterSeabaseTableDropColumn(
            catalogNamePart, schemaNamePart, objectNamePart,
            naTable, 
            alterDropColNode->getColName(),
-           NULL, alterDropColNode->ddlXns()))
+           NULL, alterDropColNode->ddlXns(),
+           viewNameList, viewDefnList))
         {
-          processReturn();
-          return;
+          cliRC = -1;
+          goto label_error;
         }
      }
   else
     {
-      if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
-        return;
-
-      if (updateMDforDropCol(cliInterface, naTable, colNumber))
+      if (hbaseFormatTableDropColumn
+          (
+               ehi,
+               catalogNamePart, schemaNamePart, objectNamePart,
+               naTable, 
+               alterDropColNode->getColName(),
+               nacol, alterDropColNode->ddlXns(),
+               viewNameList, viewDefnList))
         {
-          goto label_return;
+          cliRC = -1;
+          goto label_error;
         }
-
-      // remove column from all rows of the base table
-      HbaseStr hbaseTable;
-      hbaseTable.val = (char*)extNameForHbase.data();
-      hbaseTable.len = extNameForHbase.length();
-      
-      {
-        NAString column(nacol->getHbaseColFam(), heap_);
-        column.append(":");
-        
-        char * colQualPtr = (char*)nacol->getHbaseColQual().data();
-        Lng32 colQualLen = nacol->getHbaseColQual().length();
-        Int64 colQval = str_atoi(colQualPtr, colQualLen);
-        if (colQval <= UCHAR_MAX)
-          {
-            unsigned char c = (unsigned char)colQval;
-            column.append((char*)&c, 1);
-          }
-        else if (colQval <= USHRT_MAX)
-          {
-            unsigned short s = (unsigned short)colQval;
-            column.append((char*)&s, 2);
-          }
-        else if (colQval <= ULONG_MAX)
-          {
-            Lng32 l = (Lng32)colQval;
-            column.append((char*)&l, 4);
-          }
-        else
-          column.append((char*)&colQval, 8);
-        
-        HbaseStr colNameStr;
-        col = (char *) heap_->allocateMemory(column.length() + 1, FALSE);
-        if (col)
-          {
-            memcpy(col, column.data(), column.length());
-            col[column.length()] = 0;
-            colNameStr.val = col;
-            colNameStr.len = column.length();
-          }
-        else
-          {
-            cliRC = -EXE_NO_MEM_TO_EXEC;
-            *CmpCommon::diags() << DgSqlCode(-EXE_NO_MEM_TO_EXEC);  // error -8571
-            
-            goto label_return;
-          }
-
-        cliRC = ehi->deleteColumns(hbaseTable, colNameStr);
-        if (cliRC < 0)
-          {
-            *CmpCommon::diags() << DgSqlCode(-8448)
-                                << DgString0((char*)"ExpHbaseInterface::deleteColumns()")
-                                << DgString1(getHbaseErrStr(-retcode))
-                                << DgInt0(-retcode)
-                                << DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
-            
-            goto label_return;
-          }
-      }
     } // hbase format table
 
   cliRC = updateObjectRedefTime(&cliInterface,
@@ -5117,21 +5408,40 @@ void CmpSeabaseDDL::alterSeabaseTableDropColumn(
                                 COM_BASE_TABLE_OBJECT_LIT);
   if (cliRC < 0)
     {
-      goto label_return;
+      goto label_error;
     }
 
  label_return:
   endXnIfStartedHere(&cliInterface, xnWasStartedHere, cliRC);
-  
-  deallocEHI(ehi); 
-  heap_->deallocateMemory(col);
 
   ActiveSchemaDB()->getNATableDB()->removeNATable
     (cn,
      ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
      alterDropColNode->ddlXns(), FALSE);
 
-  processReturn();
+  return;
+
+ label_error:
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, cliRC);
+
+  if ((cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                                  alterDropColNode->ddlXns())) < 0)
+    {
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+    }
+
+  deallocEHI(ehi); 
+  heap_->deallocateMemory(col);
+
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     alterDropColNode->ddlXns(), FALSE);
+
+  processReturn();
 
   return;
 }
@@ -5302,155 +5612,151 @@ void CmpSeabaseDDL::alterSeabaseTableAlterIdentityColumn(
   return;
 }
 
-///////////////////////////////////////////////////////////////////////
-//
-// An aligned table constains all columns in one hbase cell.
-// To drop a column, we need to read each row, create a
-// new row with the removed column and insert into the original table.
-//
-// Steps to drop a column from an aligned table:
-//
-// -- make a copy of the source aligned table using hbase copy
-// -- truncate the source table
-// -- Update metadata and remove the dropped column.
-// -- bulk load data from copied table into the source table
-// -- drop the copied temp table
-//
-// If an error happens after the source table has been truncated, then
-// it will be restored from the copied table.
-//
-///////////////////////////////////////////////////////////////////////
-short CmpSeabaseDDL::alignedFormatTableDropColumn
-(
- const NAString &catalogNamePart,
- const NAString &schemaNamePart,
- const NAString &objectNamePart,
- const NATable * naTable,
- const NAString &altColName,
- ElemDDLColDef *pColDef,
- NABoolean ddlXns)
+short CmpSeabaseDDL::saveAndDropUsingViews(Int64 objUID,
+                                           ExeCliInterface *cliInterface,
+                                           NAList<NAString> &viewNameList,
+                                           NAList<NAString> &viewDefnList)
 {
   Lng32 cliRC = 0;
 
-  const NAFileSet * naf = naTable->getClusteringIndex();
-  
-  CorrName cn(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
-
-  ComUID comUID;
-  comUID.make_UID();
-  Int64 objUID = comUID.get_value();
-  
-  char objUIDbuf[100];
-
-  NAString tempTable(naTable->getTableName().getQualifiedNameAsAnsiString());
-  tempTable += "_";
-  tempTable += str_ltoa(objUID, objUIDbuf);
-
-  ExpHbaseInterface * ehi = allocEHI();
-  ExeCliInterface cliInterface
-    (STMTHEAP, NULL, NULL, 
-     CmpCommon::context()->sqlSession()->getParentQid());
-
-  Int64 tableUID = naTable->objectUid().castToInt64();
-  const NAColumnArray &naColArr = naTable->getNAColumnArray();
-  const NAColumn * altNaCol = naColArr.getColumn(altColName);
-  Lng32 altColNum = altNaCol->getPosition();
-
-  NAString tgtCols;
-  NAString srcCols;
-
- NABoolean xnWasStartedHere = FALSE;
-
-  char buf[4000];
-
-  if (cloneSeabaseTable(cn, naTable, tempTable, ehi, &cliInterface))
-    {
-      cliRC = -1;
-      goto label_drop;
-    }
-  
-  if (truncateHbaseTable(catalogNamePart, schemaNamePart, objectNamePart,
-                         (NATable*)naTable, ehi))
+  NAString catName, schName, objName;
+  cliRC = getObjectName(cliInterface, objUID,
+                        catName, schName, objName);
+  if (cliRC < 0)
     {
-      cliRC = -1;
-      goto label_restore;
+      processReturn();
+      
+      return -1;
     }
 
-  if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
+  Queue * usingViewsQueue = NULL;
+  cliRC = getAllUsingViews(cliInterface, 
+                           catName, schName, objName, 
+                           usingViewsQueue);
+  if (cliRC < 0)
     {
-      cliRC = -1;
-      goto label_restore;
+      processReturn();
+      
+      return -1;
     }
 
-  if (updateMDforDropCol(cliInterface, naTable, altColNum))
+  if (usingViewsQueue->numEntries() == 0)
+    return 0;
+
+  NABoolean xnWasStartedHere = FALSE;
+  if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
+    return -1;
+  
+  // find out any views on this table.
+  // save their definition and drop them.
+  // they will be recreated before return.
+  usingViewsQueue->position();
+  for (int idx = 0; idx < usingViewsQueue->numEntries(); idx++)
     {
-      cliRC = -1;
-      goto label_restore;
+      OutputInfo * vi = (OutputInfo*)usingViewsQueue->getNext(); 
+      char * viewName = vi->get(0);
+      
+      viewNameList.insert(viewName);
+      
+      ComObjectName viewCO(viewName, COM_TABLE_NAME);
+      
+      const NAString catName = viewCO.getCatalogNamePartAsAnsiString();
+      const NAString schName = viewCO.getSchemaNamePartAsAnsiString(TRUE);
+      const NAString objName = viewCO.getObjectNamePartAsAnsiString(TRUE);
+      
+      Int64 viewUID = getObjectUID(cliInterface,
+                                   catName.data(), schName.data(), objName.data(), 
+                                   COM_VIEW_OBJECT_LIT);
+      if (viewUID < 0 )
+        {
+          endXnIfStartedHere(cliInterface, xnWasStartedHere, -1);
+          
+          return -1;
+        }
+      
+      NAString viewText;
+      if (getTextFromMD(cliInterface, viewUID, COM_VIEW_TEXT, 0, viewText))
+        {
+          endXnIfStartedHere(cliInterface, xnWasStartedHere, -1);
+          
+          return -1;
+        }
+      
+      viewDefnList.insert(viewText);
     }
-  
-  ActiveSchemaDB()->getNATableDB()->removeNATable
-    (cn,
-     ComQiScope::REMOVE_FROM_ALL_USERS, 
-     COM_BASE_TABLE_OBJECT, ddlXns, FALSE);
 
-  for (Int32 c = 0; c < naColArr.entries(); c++)
+  // drop the views.
+  // usingViewsQueue contain them in ascending order of their create
+  // time. Drop them from last to first.
+  for (int idx = usingViewsQueue->numEntries()-1; idx >= 0; idx--)
     {
-      const NAColumn * nac = naColArr[c];
-      if (nac->getColName() == altColName)
-        continue;
-
-      if (nac->isComputedColumn())
-        continue;
+      OutputInfo * vi = (OutputInfo*)usingViewsQueue->get(idx);
+      char * viewName = vi->get(0);
 
-      if (nac->isSystemColumn())
-        continue;
+      if (dropOneTableorView(*cliInterface,viewName,COM_VIEW_OBJECT,false))
+        {
+          endXnIfStartedHere(cliInterface, xnWasStartedHere, -1);
+          
+          processReturn();
+          
+          return -1;
+        }
+    }
 
-      tgtCols += nac->getColName();
-      tgtCols += ",";
-    } // for
+  endXnIfStartedHere(cliInterface, xnWasStartedHere, 0);
+   
+  return 0;
+}
 
-  tgtCols = tgtCols.strip(NAString::trailing, ',');
+short CmpSeabaseDDL::recreateUsingViews(ExeCliInterface *cliInterface,
+                                        NAList<NAString> &viewNameList,
+                                        NAList<NAString> &viewDefnList,
+                                        NABoolean ddlXns)
+{
+  Lng32 cliRC = 0;
 
-  str_sprintf(buf, "upsert using load into %s(%s) select %s from %s",
-              naTable->getTableName().getQualifiedNameAsAnsiString().data(),
-              tgtCols.data(),
-              tgtCols.data(),
-              tempTable.data());
-  cliRC = cliInterface.executeImmediate(buf);
-  if (cliRC < 0)
-    {
-      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
-      goto label_restore;
-    }
+  if (viewDefnList.entries() == 0)
+    return 0;
 
-  endXnIfStartedHere(&cliInterface, xnWasStartedHere, 0);
+  NABoolean xnWasStartedHere = FALSE;
+  if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
+    return -1;
 
-  str_sprintf(buf, "drop table %s", tempTable.data());
-  cliRC = cliInterface.executeImmediate(buf);
-  if (cliRC < 0)
+  for (Lng32 i = 0; i < viewDefnList.entries(); i++)
     {
-      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
-      goto label_restore;
+      cliRC = cliInterface->executeImmediate(viewDefnList[i]);
+      if (cliRC < 0)
+        {
+          cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+          
+          cliRC = -1;
+          goto label_return;
+        }
     }
+
+  cliRC = 0;
   
-  deallocEHI(ehi); 
-  
-  return 0;
+label_return:
+  for (Lng32 i = 0; i < viewDefnList.entries(); i++)
+    {
+      ComObjectName tableName(viewNameList[i], COM_TABLE_NAME);
+      const NAString catalogNamePart = 
+        tableName.getCatalogNamePartAsAnsiString();
+      const NAString schemaNamePart = 
+        tableName.getSchemaNamePartAsAnsiString(TRUE);
+      const NAString objectNamePart = 
+        tableName.getObjectNamePartAsAnsiString(TRUE);
 
- label_restore:
-  endXnIfStartedHere(&cliInterface, xnWasStartedHere, -1);
+      CorrName cn(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
+      ActiveSchemaDB()->getNATableDB()->removeNATable
+        (cn,
+         ComQiScope::REMOVE_MINE_ONLY, COM_VIEW_OBJECT,
+         ddlXns, FALSE);
+    }
 
-  cloneHbaseTable(tempTable, 
-                  naTable->getTableName().getQualifiedNameAsAnsiString(),
-                  ehi);
+  endXnIfStartedHere(cliInterface, xnWasStartedHere, cliRC);
  
- label_drop:  
-  str_sprintf(buf, "drop table %s", tempTable.data());
-  Lng32 cliRC2 = cliInterface.executeImmediate(buf);
-  
-  deallocEHI(ehi); 
-  
-  return (cliRC < 0 ? -1 : 0);  
+  return cliRC;
 }
 
 ///////////////////////////////////////////////////////////////////////
@@ -5459,19 +5765,24 @@ short CmpSeabaseDDL::alignedFormatTableDropColumn
 // To alter a column, we need to read each row, create a
 // new row with the altered column and insert into the original table.
 //
+// Validation that altered col datatype is compatible with the
+// original datatype has already been done before this method
+// is called.
+//
 // Steps to alter a column from an aligned table:
 //
 // -- make a copy of the source aligned table using hbase copy
 // -- truncate the source table
 // -- Update metadata column definition with the new definition
 // -- bulk load data from copied table into the source table
+// -- recreate views, if existed, based on the new definition
 // -- drop the copied temp table
 //
 // If an error happens after the source table has been truncated, then
 // it will be restored from the copied table.
 //
 ///////////////////////////////////////////////////////////////////////
-short CmpSeabaseDDL::alignedFormatTableAlterColumn
+short CmpSeabaseDDL::alignedFormatTableAlterColumnAttr
 (
  const NAString &catalogNamePart,
  const NAString &schemaNamePart,
@@ -5479,7 +5790,9 @@ short CmpSeabaseDDL::alignedFormatTableAlterColumn
  const NATable * naTable,
  const NAString &altColName,
  ElemDDLColDef *pColDef,
- NABoolean ddlXns)
+ NABoolean ddlXns,
+ NAList<NAString> &viewNameList,
+ NAList<NAString> &viewDefnList)
 {
   Lng32 cliRC = 0;
 
@@ -5608,13 +5921,33 @@ short CmpSeabaseDDL::alignedFormatTableAlterColumn
       goto label_restore;
     }
 
-  deallocEHI(ehi); 
-  
+  if ((cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                                  ddlXns)) < 0)
+    {
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(altColName)
+                          << DgString0(reason);
+      goto label_restore;
+    }
+
   endXnIfStartedHere(&cliInterface, xnWasStartedHere, 0);
   
+  str_sprintf(buf, "drop table %s", tempTable.data());
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      goto label_restore;
+    }
+
+  deallocEHI(ehi); 
+  
   return 0;
 
  label_restore:
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, -1);
+
   cloneHbaseTable(tempTable, 
                   naTable->getTableName().getQualifiedNameAsAnsiString(),
                   ehi);
@@ -5630,44 +5963,98 @@ short CmpSeabaseDDL::alignedFormatTableAlterColumn
   return (cliRC < 0 ? -1 : 0);
 }
 
-short CmpSeabaseDDL::alterColumnAttr(
+/////////////////////////////////////////////////////////////////////
+// this method is called if alter could be done by metadata changes
+// only and without affecting table data.
+/////////////////////////////////////////////////////////////////////
+short CmpSeabaseDDL::mdOnlyAlterColumnAttr(
      const NAString &catalogNamePart, const NAString &schemaNamePart,
      const NAString &objectNamePart,
      const NATable * naTable, const NAColumn * naCol, NAType * newType,
-     StmtDDLAlterTableAlterColumnDatatype * alterColNode)
+     StmtDDLAlterTableAlterColumnDatatype * alterColNode,
+     NAList<NAString> &viewNameList,
+     NAList<NAString> &viewDefnList)
 {
+  Lng32 cliRC = 0;
+
   ExeCliInterface cliInterface
     (STMTHEAP, NULL, NULL, 
      CmpCommon::context()->sqlSession()->getParentQid());
+  
+  Int64 objUID = naTable->objectUid().castToInt64();
+  
+  Lng32 colNumber = naCol->getPosition();
+  
+  NABoolean xnWasStartedHere = FALSE;
+  if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
+    return -1;
 
-  // this operation cannot be done if a xn is already in progress.
-  if (xnInProgress(&cliInterface))
+  char buf[4000];
+  str_sprintf(buf, "update %s.\"%s\".%s set column_size = %d, column_class = '%s' where object_uid = %Ld and column_number = %d",
+              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
+              newType->getNominalSize(),
+              COM_ALTERED_USER_COLUMN_LIT,
+              objUID,
+              colNumber);
+  
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
     {
-      *CmpCommon::diags() << DgSqlCode(-20123);
-
-      processReturn();
-      return -1;
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      
+      goto label_error;
     }
-
-  if (naTable->isSQLMXAlignedTable())
+  
+  cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList, 
+                             alterColNode->ddlXns());
+  if (cliRC < 0)
     {
-      ElemDDLColDef *pColDef = 
-        alterColNode->getColToAlter()->castToElemDDLColDef();
-
-      if (alignedFormatTableAlterColumn
-          (
-           catalogNamePart, schemaNamePart, objectNamePart,
-           naTable,
-           naCol->getColName(), 
-           pColDef,
-           alterColNode->ddlXns()))
-        {
-          processReturn();
-          return -1;
-        }
-
-      return 0;
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(naCol->getColName().data())
+                          << DgString0(reason);
+      
+      goto label_error;
     }
+  
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, cliRC);
+
+  return 0;
+
+ label_error:
+  endXnIfStartedHere(&cliInterface, xnWasStartedHere, cliRC);
+
+  return -1;
+}
+
+///////////////////////////////////////////////////////////////////////
+//
+// Steps to alter a column from an hbase format table:
+//
+// Validation that altered col datatype is compatible with the
+// original datatype has already been done before this method
+// is called.
+//
+// -- add a temp column based on the altered datatype
+// -- update temp col with data from the original col 
+// -- update metadata column definition with the new col definition
+// -- update original col with data from temp col
+// -- recreate views, if existed, based on the new definition
+// -- drop the temp col. Dependent views will be recreated during drop.
+//
+// If an error happens after the source table has been truncated, then
+// it will be restored from the copied table.
+//
+///////////////////////////////////////////////////////////////////////
+short CmpSeabaseDDL::hbaseFormatTableAlterColumnAttr(
+     const NAString &catalogNamePart, const NAString &schemaNamePart,
+     const NAString &objectNamePart,
+     const NATable * naTable, const NAColumn * naCol, NAType * newType,
+     StmtDDLAlterTableAlterColumnDatatype * alterColNode)
+{
+  ExeCliInterface cliInterface
+    (STMTHEAP, NULL, NULL, 
+     CmpCommon::context()->sqlSession()->getParentQid());
 
   CorrName cn(objectNamePart, STMTHEAP, schemaNamePart,catalogNamePart);
 
@@ -5793,37 +6180,377 @@ short CmpSeabaseDDL::alterColumnAttr(
       processReturn();
       goto label_error1;
     }
-   
-  str_sprintf(buf, "alter table %s drop column %s",
-              naTable->getTableName().getQualifiedNameAsAnsiString().data(), 
-              tempCol.data());
-  cliRC = cliInterface.executeImmediate(buf);
+   
+  str_sprintf(buf, "alter table %s drop column %s",
+              naTable->getTableName().getQualifiedNameAsAnsiString().data(), 
+              tempCol.data());
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      
+      processReturn();
+      return -1;
+    }
+
+  return 0;
+
+ label_error1:
+  str_sprintf(buf, "alter table %s drop column %s",
+              naTable->getTableName().getQualifiedNameAsAnsiString().data(), 
+              tempCol.data());
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      processReturn();
+      return -1;
+    } 
+ 
+  return -1;
+}
+
+void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
+     StmtDDLAlterTableAlterColumnDatatype * alterColNode,
+     NAString &currCatName, NAString &currSchName)
+{
+  Lng32 cliRC = 0;
+  Lng32 retcode = 0;
+
+  const NAString &tabName = alterColNode->getTableName();
+
+  ComObjectName tableName(tabName, COM_TABLE_NAME);
+  ComAnsiNamePart currCatAnsiName(currCatName);
+  ComAnsiNamePart currSchAnsiName(currSchName);
+  tableName.applyDefaults(currCatAnsiName, currSchAnsiName);
+
+  const NAString catalogNamePart = tableName.getCatalogNamePartAsAnsiString();
+  const NAString schemaNamePart = tableName.getSchemaNamePartAsAnsiString(TRUE);
+  const NAString objectNamePart = tableName.getObjectNamePartAsAnsiString(TRUE);
+  const NAString extTableName = tableName.getExternalName(TRUE);
+  const NAString extNameForHbase = catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
+
+  ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
+  CmpCommon::context()->sqlSession()->getParentQid());
+
+  if ((isSeabaseReservedSchema(tableName)) &&
+      (!Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)))
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_DEFINITION_METADATA_SCHEMA);
+      processReturn();
+      return;
+    }
+
+  retcode = existsInSeabaseMDTable(&cliInterface, 
+                                   catalogNamePart, schemaNamePart, objectNamePart,
+                                   COM_BASE_TABLE_OBJECT,
+                                   (Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL) 
+                                    ? FALSE : TRUE),
+                                   TRUE, TRUE);
+  if (retcode < 0)
+    {
+      processReturn();
+
+      return;
+    }
+
+  if (retcode == 0) // does not exist
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_WRONG_TYPE)
+                          << DgString0(extTableName);
+
+      processReturn();
+
+      return;
+    }
+
+  ActiveSchemaDB()->getNATableDB()->useCache();
+
+  BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
+  CorrName cn(tableName.getObjectNamePart().getInternalName(),
+              STMTHEAP,
+              tableName.getSchemaNamePart().getInternalName(),
+              tableName.getCatalogNamePart().getInternalName());
+
+  NATable *naTable = bindWA.getNATable(cn); 
+  if (naTable == NULL || bindWA.errStatus())
+    {
+      *CmpCommon::diags()
+        << DgSqlCode(-4082)
+        << DgTableName(cn.getExposedNameAsAnsiString());
+    
+      processReturn();
+
+      return;
+    }
+
+  // Make sure user has the privilege to perform the alter column
+  if (!isDDLOperationAuthorized(SQLOperation::ALTER_TABLE,
+                                naTable->getOwner(),naTable->getSchemaOwner()))
+  {
+     *CmpCommon::diags() << DgSqlCode(-CAT_NOT_AUTHORIZED);
+
+     processReturn ();
+
+     return;
+  }
+
+  // return an error if trying to alter a column from a volatile table
+  if (naTable->isVolatileTable())
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_REGULAR_OPERATION_ON_VOLATILE_OBJECT);
+     
+      processReturn ();
+
+      return;
+    }
+
+  ElemDDLColDef *pColDef = alterColNode->getColToAlter()->castToElemDDLColDef();
+  
+  const NAColumnArray &nacolArr = naTable->getNAColumnArray();
+  const NAString &colName = pColDef->getColumnName();
+
+  const NAColumn * nacol = nacolArr.getColumn(colName);
+  if (! nacol)
+    {
+      // column doesnt exist. Error.
+      *CmpCommon::diags() << DgSqlCode(-CAT_COLUMN_DOES_NOT_EXIST_ERROR)
+                          << DgColumnName(colName);
+
+      processReturn();
+
+      return;
+    }
+
+  const NAType * currType = nacol->getType();
+  NAType * newType = pColDef->getColumnDataType();
+
+  // If column is a LOB column , error
+  if ((currType->getFSDatatype() == REC_BLOB) || (currType->getFSDatatype() == REC_CLOB))
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_LOB_COLUMN_ALTER)
+                          << DgColumnName(colName);
+      processReturn();
+      return;
+     }
+
+  const NAFileSet * naFS = naTable->getClusteringIndex();
+  const NAColumnArray &naKeyColArr = naFS->getIndexKeyColumns();
+  if (naKeyColArr.getColumn(colName))
+    {
+      // key column cannot be altered
+      *CmpCommon::diags() << DgSqlCode(-1420)
+                          << DgColumnName(colName);
+
+      processReturn();
+
+      return;
+    }
+
+  if (naTable->hasSecondaryIndexes())
+    {
+      const NAFileSetList &naFsList = naTable->getIndexList();
+
+      for (Lng32 i = 0; i < naFsList.entries(); i++)
+        {
+          naFS = naFsList[i];
+          
+          // skip clustering index
+          if (naFS->getKeytag() == 0)
+            continue;
+
+          const NAColumnArray &naIndexColArr = naFS->getAllColumns();
+          if (naIndexColArr.getColumn(colName))
+            {
+              // secondary index column cannot be altered
+              *CmpCommon::diags() << DgSqlCode(-1421)
+                                  << DgColumnName(colName)
+                                  << DgTableName(naFS->getExtFileSetName());
+
+              processReturn();
+
+              return;
+            }
+        } // for
+    } // secondary indexes present
+
+  if ((NOT currType->isCompatible(*newType)) &&
+      (NOT ((currType->getTypeQualifier() == NA_CHARACTER_TYPE) &&
+            (newType->getTypeQualifier() == NA_CHARACTER_TYPE))))
+    {
+      NAString reason = "Old and New datatypes must be compatible.";
+
+      // column cannot be altered
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+      
+      processReturn();
+      
+      return;
+    }
+
+  // Column that can be altered by updating metadata only
+  // must meet these conditions:
+  //   -- old and new column datatype must be VARCHAR
+  //   -- old and new datatype must have the same nullable attr
+  //   -- new col length must be greater than or equal to old length
+  //   -- old and new character sets must be the same
+  NABoolean mdAlterOnly = FALSE;
+  if ((DFS2REC::isSQLVarChar(currType->getFSDatatype())) &&
+      (DFS2REC::isSQLVarChar(newType->getFSDatatype())) &&
+      (currType->getFSDatatype() == newType->getFSDatatype()) &&
+      (currType->supportsSQLnull() == newType->supportsSQLnull()) &&
+      (currType->getNominalSize() <= newType->getNominalSize()) &&
+      (((CharType*)currType)->getCharSet() == ((CharType*)newType)->getCharSet()))
+    mdAlterOnly = TRUE;
+
+  if ((NOT mdAlterOnly) &&
+      (CmpCommon::getDefault(TRAF_ALTER_COL_ATTRS) == DF_OFF))
+    {
+      NAString reason;
+      if (NOT ((DFS2REC::isSQLVarChar(currType->getFSDatatype())) &&
+               (DFS2REC::isSQLVarChar(newType->getFSDatatype()))))
+        reason = "Old and New datatypes must be VARCHAR.";
+      else if (currType->getFSDatatype() != newType->getFSDatatype())
+        reason = "Old and New datatypes must be the same.";
+      else if (((CharType*)currType)->getCharSet() != ((CharType*)newType)->getCharSet())
+        reason = "Old and New character sets must be the same.";
+      else if (currType->getNominalSize() > newType->getNominalSize())
+        reason = "New length must be greater than or equal to old length.";
+      else if (currType->supportsSQLnull() != newType->supportsSQLnull())
+        reason = "Old and New nullability must be the same.";
+
+      // column cannot be altered
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+      
+      return;
+    }
+
+  // this operation cannot be done if a xn is already in progress.
+  if ((NOT mdAlterOnly) && (xnInProgress(&cliInterface)))
+    {
+      *CmpCommon::diags() << DgSqlCode(-20123)
+                          << DgString0("ALTER");
+
+      processReturn();
+      return;
+    }
+
+  Int64 objUID = naTable->objectUid().castToInt64();
+
+  // if there are views on the table, save the definition and drop
+  // the views.
+  // At the end of alter, views will be recreated. If an error happens
+  // during view recreation, alter will fail.
+  NAList<NAString> viewNameList;
+  NAList<NAString> viewDefnList;
+  if (saveAndDropUsingViews(objUID, &cliInterface, viewNameList, viewDefnList))
+     {
+      NAString reason = "Error occurred while saving views.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+       
+      return;
+    }
+
+  if (mdAlterOnly)
+    {
+      if (mdOnlyAlterColumnAttr
+          (catalogNamePart, schemaNamePart, objectNamePart,
+           naTable, nacol, newType, alterColNode,
+           viewNameList, viewDefnList))
+        {
+          cliRC = -1;
+          
+          goto label_error;
+        }
+    }
+  else if (naTable->isSQLMXAlignedTable())
+    {
+      ElemDDLColDef *pColDef = 
+        alterColNode->getColToAlter()->castToElemDDLColDef();
+      
+      if (alignedFormatTableAlterColumnAttr
+          (catalogNamePart, schemaNamePart, objectNamePart,
+           naTable,
+           colName,
+           pColDef,
+           alterColNode->ddlXns(),
+           viewNameList, viewDefnList))
+        {
+          cliRC = -1;
+          goto label_error;
+        }
+    }
+  else if (hbaseFormatTableAlterColumnAttr
+           (catalogNamePart, schemaNamePart, objectNamePart,
+            naTable, nacol, newType, alterColNode))
+    {
+      cliRC = -1;
+      
+      goto label_error;
+    }
+
+  cliRC = updateObjectRedefTime(&cliInterface,
+                                catalogNamePart, schemaNamePart, objectNamePart,
+                                COM_BASE_TABLE_OBJECT_LIT);
   if (cliRC < 0)
     {
-      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
-      
-      processReturn();
-      return -1;
+      goto label_error;
     }
+  
+label_return:
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     alterColNode->ddlXns(), FALSE);
 
-  return 0;
+  processReturn();
+  
+  return;
 
- label_error1:
-  str_sprintf(buf, "alter table %s drop column %s",
-              naTable->getTableName().getQualifiedNameAsAnsiString().data(), 
-              tempCol.data());
-  cliRC = cliInterface.executeImmediate(buf);
-  if (cliRC < 0)
+label_error:
+  if ((cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                                  alterColNode->ddlXns())) < 0)
     {
-      processReturn();
-      return -1;
-    } 
- 
-  return -1;
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+    }
+
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     alterColNode->ddlXns(), FALSE);
+
+  processReturn();
+
+  return;
 }
 
-void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
-     StmtDDLAlterTableAlterColumnDatatype * alterColNode,
+/////////////////////////////////////////////////////////////////////
+// this method renames an existing column to the specified new name.
+//
+// A column cannot be renamed if it is a system, salt, division by,
+// computed or a lob column.
+// 
+// If any index exists on the renamed column, then the index column
+// is also renamed.
+//
+// If views exist on the table, they are dropped and recreated after
+// rename. If recreation runs into an error, then alter fails.
+//
+///////////////////////////////////////////////////////////////////
+void CmpSeabaseDDL::alterSeabaseTableAlterColumnRename(
+     StmtDDLAlterTableAlterColumnRename * alterColNode,
      NAString &currCatName, NAString &currSchName)
 {
   Lng32 cliRC = 0;
@@ -5866,6 +6593,16 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
       return;
     }
 
+  if (retcode == 0) // does not exist
+    {
+      *CmpCommon::diags() << DgSqlCode(-CAT_CANNOT_ALTER_WRONG_TYPE)
+                          << DgString0(extTableName);
+
+      processReturn();
+
+      return;
+    }
+
   ActiveSchemaDB()->getNATableDB()->useCache();
 
   BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
@@ -5907,10 +6644,9 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
       return;
     }
 
-  ElemDDLColDef *pColDef = alterColNode->getColToAlter()->castToElemDDLColDef();
-  
   const NAColumnArray &nacolArr = naTable->getNAColumnArray();
-  const NAString &colName = pColDef->getColumnName();
+  const NAString &colName = alterColNode->getColumnName();
+  const NAString &renamedColName = alterColNode->getRenamedColumnName();
 
   const NAColumn * nacol = nacolArr.getColumn(colName);
   if (! nacol)
@@ -5924,8 +6660,46 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
       return;
     }
 
+  if ((CmpCommon::getDefault(TRAF_ALLOW_RESERVED_COLNAMES) == DF_OFF) &&
+      (ComTrafReservedColName(renamedColName)))
+    {
+      NAString reason = "Renamed column " + renamedColName + " is reserved for internal system usage.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+
+      return;
+    }
+
+  if (nacol->isComputedColumn() || nacol->isSystemColumn())
+    {
+      NAString reason = "Cannot rename system or computed column.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+
+      return;
+    }
+
+  const NAColumn * renNacol = nacolArr.getColumn(renamedColName);
+  if (renNacol)
+    {
+      // column already exist. Error.
+      NAString reason = "Renamed column " + renamedColName + " already exist in the table.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+
+      processReturn();
+
+      return;
+    }
+
   const NAType * currType = nacol->getType();
-  NAType * newType = pColDef->getColumnDataType();
 
   // If column is a LOB column , error
   if ((currType->getFSDatatype() == REC_BLOB) || (currType->getFSDatatype() == REC_CLOB))
@@ -5938,17 +6712,88 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
 
   const NAFileSet * naFS = naTable->getClusteringIndex();
   const NAColumnArray &naKeyColArr = naFS->getIndexKeyColumns();
+  NABoolean isPkeyCol = FALSE;
   if (naKeyColArr.getColumn(colName))
     {
-      // key column cannot be altered
-      *CmpCommon::diags() << DgSqlCode(-1420)
-                          << DgColumnName(colName);
+      isPkeyCol = TRUE;
+    }
 
+  Int64 objUID = naTable->objectUid().castToInt64();
+  
+  NAList<NAString> viewNameList;
+  NAList<NAString> viewDefnList;
+  if (saveAndDropUsingViews(objUID, &cliInterface, viewNameList, viewDefnList))
+    {
+      NAString reason = "Error occurred while saving dependent views.";
+      *CmpCommon::diags() << DgSqlCode(-1404)
+                          << DgColumnName(colName)
+                          << DgString0(reason);
+      
       processReturn();
+       
+      return;
+    }
 
+  Lng32 colNumber = nacol->getPosition();
+  
+  char buf[4000];
+  str_sprintf(buf, "update %s.\"%s\".%s set column_name = '%s', column_class = '%s' where object_uid = %Ld and column_number = %d",
+              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
+              renamedColName.data(),
+              COM_ALTERED_USER_COLUMN_LIT,
+              objUID,
+              colNumber);
+  
+  cliRC = cliInterface.executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+      
+      processReturn();
       return;
     }
 
+  if (isPkeyCol)
+    {
+      Lng32 divColPos = -1;
+      if ((naTable->hasDivisioningColumn(&divColPos)))
+        {
+          NAString reason = "Not supported with DIVISION BY clause.";
+          *CmpCommon::diags() << DgSqlCode(-1404)
+                              << DgColumnName(colName)
+                              << DgString0(reason);
+          
+          processReturn();
+          
+          return;
+        }
+
+      Lng32 saltColPos = -1;
+      if ((naTable->hasSaltedColumn(&saltColPos)))
+        {
+          NAString saltText;
+          cliRC = getTextFromMD(&cliInterface, objUID, COM_COMPUTED_COL_TEXT,
+                                saltColPos, saltText);
+          if (cliRC < 0)
+            {
+              processReturn();
+              return;
+            }   
+          
+          // replace col reference with renamed col
+          NAString quotedColName = "\"" + colName + "\"";
+          NAString renamedQuotedColName = "\"" + renamedColName + "\"";
+          saltText = replaceAll(saltText, quotedColName, renamedQuotedColName);
+          cliRC = updateTextTable(&cliInterface, objUID, COM_COMPUTED_COL_TEXT,
+                                  saltColPos, saltText, TRUE);
+          if (cliRC < 0)
+            {
+              processReturn();
+              return;
+            }   
+        } // saltCol
+    } // pkeyCol being renamed
+
   if (naTable->hasSecondaryIndexes())
     {
       const NAFileSetList &naFsList = naTable->getIndexList();
@@ -5961,69 +6806,43 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
           if (naFS->getKeytag() == 0)
             continue;
 
-          const NAColumnArray &naIndexColArr = naFS->getAllColumns();
-          if (naIndexColArr.getColumn(colName))
+          str_sprintf(buf, "update %s.\"%s\".%s set column_name = '%s' || '@' where object_uid = %Ld and column_name = '%s' || '@'",
+                      getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
+                      renamedColName.data(),
+                      naFS->getIndexUID(),
+                      colName.data());
+  
+          cliRC = cliInterface.executeImmediate(buf);
+          if (cliRC < 0)
             {
-              // secondary index column cannot be altered
-              *CmpCommon::diags() << DgSqlCode(-1421)
-                                  << DgColumnName(colName)
-                                  << DgTableName(naFS->getExtFileSetName());
-
+              cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+              
               processReturn();
+              return;
+            }
 
+         str_sprintf(buf, "update %s.\"%s\".%s set column_name = '%s' where object_uid = %Ld and column_name = '%s'",
+                      getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
+                      renamedColName.data(),
+                      naFS->getIndexUID(),
+                      colName.data());
+  
+          cliRC = cliInterface.executeImmediate(buf);
+          if (cliRC < 0)
+            {
+              cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+              
+              processReturn();
               return;
             }
         } // for
     } // secondary indexes present
 
-  if ((NOT currType->isCompatible(*newType)) &&
-      (NOT ((currType->getTypeQualifier() == NA_CHARACTER_TYPE) &&
-            (newType->getTypeQualifier() == NA_CHARACTER_TYPE))))
-    {
-      NAString reason = "Old and New datatypes must be compatible.";
-
-      // column cannot be altered
-      *CmpCommon::diags() << DgSqlCode(-1404)
-                          << DgColumnName(colName)
-                          << DgString0(reason);
-      
-      processReturn();
-      
-      return;
-    }
-
-  // Column that can be altered by updating metadata only
-  // must meet these conditions:
-  //   -- old and new column datatype must be VARCHAR
-  //   -- old and new datatype must have the same nullable attr
-  //   -- new col length must be greater than or equal to old length
-  //   -- old and new character sets must be the same
-  NABoolean mdAlterOnly = FALSE;
-  if ((DFS2REC::isSQLVarChar(currType->getFSDatatype())) &&
-      (DFS2REC::isSQLVarChar(newType->getFSDatatype())) &&
-      (currType->getFSDatatype() == newType->getFSDatatype()) &&
-      (currType->supportsSQLnull() == newType->supportsSQLnull()) &&
-      (currType->getNominalSize() <= newType->getNominalSize()) &&
-      (((CharType*)currType)->getCharSet() == ((CharType*)newType)->getCharSet()))
-    mdAlterOnly = TRUE;
-
-  if ((NOT mdAlterOnly) &&
-      (CmpCommon::getDefault(TRAF_ALTER_COL_ATTRS) == DF_OFF))
+  cliRC = recreateUsingViews(&cliInterface, viewNameList, viewDefnList,
+                             alterColNode->ddlXns());
+  if (cliRC < 0)
     {
-      NAString reason;
-      if (NOT ((DFS2REC::isSQLVarChar(currType->getFSDatatype())) &&
-               (DFS2REC::isSQLVarChar(newType->getFSDatatype()))))
-        reason = "Old and New datatypes must be VARCHAR.";
-      else if (currType->getFSDatatype() != newType->getFSDatatype())
-        reason = "Old and New datatypes must be the same.";
-      else if (((CharType*)currType)->getCharSet() != ((CharType*)newType)->getCharSet())
-        reason = "Old and New character sets must be the same.";
-      else if (currType->getNominalSize() > newType->getNominalSize())
-        reason = "New length must be greater than or equal to old length.";
-      else if (currType->supportsSQLnull() != newType->supportsSQLnull())
-        reason = "Old and New nullability must be the same.";
-
-      // column cannot be altered
+      NAString reason = "Error occurred while recreating views due to dependency on older column definition. Drop dependent views before doing the alter.";
       *CmpCommon::diags() << DgSqlCode(-1404)
                           << DgColumnName(colName)
                           << DgString0(reason);
@@ -6033,36 +6852,6 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
       return;
     }
 
-  if (mdAlterOnly)
-    {
-      Int64 objUID = naTable->objectUid().castToInt64();
-      
-      Lng32 colNumber = nacol->getPosition();
-      
-      char buf[4000];
-      str_sprintf(buf, "update %s.\"%s\".%s set column_size = %d, column_class = '%s' where object_uid = %Ld and column_number = %d",
-                  getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
-                  newType->getNominalSize(),
-                  COM_ALTERED_USER_COLUMN_LIT,
-                  objUID,
-                  colNumber);
-      
-      cliRC = cliInterface.executeImmediate(buf);
-      if (cliRC < 0)
-        {
-          cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
-          
-          processReturn();
-          return;
-        }
-    }
-  else
-    {
-      if (alterColumnAttr(catalogNamePart, schemaNamePart, objectNamePart,
-                          naTable, nacol, newType, alterColNode))
-        return;
-    }
-  
   cliRC = updateObjectRedefTime(&cliInterface,
                                 catalogNamePart, schemaNamePart, objectNamePart,
                                 COM_BASE_TABLE_OBJECT_LIT);
@@ -6073,9 +6862,10 @@ void CmpSeabaseDDL::alterSeabaseTableAlterColumnDatatype(
   
   ActiveSchemaDB()->getNATableDB()->removeNATable
     (cn,
-     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     ComQiScope::REMOVE_FROM_ALL_USERS,
+     COM_BASE_TABLE_OBJECT,
      alterColNode->ddlXns(), FALSE);
-
+  
   processReturn();
   
   return;
@@ -6133,7 +6923,6 @@ void CmpSeabaseDDL::alterSeabaseTableAddPKeyConstraint(
       return;
     }
 
-
   BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), FALSE/*inDDL*/);
   CorrName cn(tableName.getObjectNamePart().getInternalName(),
               STMTHEAP,
@@ -6192,6 +6981,19 @@ void CmpSeabaseDDL::alterSeabaseTableAddPKeyConstraint(
       return;
     }
 
+  // if table already has a primary key, return error.
+  if ((naTable->getClusteringIndex()) && 
+      (NOT naTable->getClusteringIndex()->hasOnlySyskey()))
+    {
+      *CmpCommon::diags()
+        << DgSqlCode(-1256)
+        << DgString0(extTableName);
+      
+      processReturn();
+      
+      return;
+    }
+
  // update unique key constraint info
   NAString uniqueStr;
   if (genUniqueName(alterAddConstraint, uniqueStr))
@@ -7718,6 +8520,17 @@ void CmpSeabaseDDL::alterSeabaseTableDropConstraint(
           
           return;
         }
+
+      if (isPkeyConstr)
+        {
+          *CmpCommon::diags() << DgSqlCode(-1255)
+                              << DgString0(dropConstrName)
+                              << DgString1(extTableName);
+          
+          processReturn();
+          
+          return;
+        }
     }
   
   NATable *otherNaTable = NULL;
@@ -9410,7 +10223,7 @@ desc_struct * CmpSeabaseDDL::getSeabaseUserTableDesc(const NAString &catName,
       populateKeyInfo(keyInfoArray[idx], vi);
     }
 
-  str_sprintf(query, "select O.catalog_name, O.schema_name, O.object_name, I.keytag, I.is_unique, I.is_explicit, I.key_colcount, I.nonkey_colcount, T.num_salt_partns, T.row_format from %s.\"%s\".%s I, %s.\"%s\".%s O ,  %s.\"%s\".%s T where I.base_table_uid = %Ld and I.index_uid = O.object_uid %s and I.index_uid = T.table_uid for read committed access order by 1,2,3",
+  str_sprintf(query, "select O.catalog_name, O.schema_name, O.object_name, I.keytag, I.is_unique, I.is_explicit, I.key_colcount, I.nonkey_colcount, T.num_salt_partns, T.row_format, I.index_uid from %s.\"%s\".%s I, %s.\"%s\".%s O ,  %s.\"%s\".%s T where I.base_table_uid = %Ld and I.index_uid = O.object_uid %s and I.index_uid = T.table_uid for read committed access order by 1,2,3",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
@@ -9479,6 +10292,7 @@ desc_struct * CmpSeabaseDDL::getSeabaseUserTableDesc(const NAString &catName,
       Lng32 nonKeyColCount = *(Lng32*)vi->get(7);
       Lng32 idxNumSaltPartns = *(Lng32*)vi->get(8);
       char * format = vi->get(9);
+      Int64 indexUID = *(Int64*)vi->get(10);
       ComRowFormat idxRowFormat;
 
       if (memcmp(format, COM_ALIGNED_FORMAT_LIT, 2) == 0)
@@ -9530,6 +10344,7 @@ desc_struct * CmpSeabaseDDL::getSeabaseUserTableDesc(const NAString &catName,
         new(STMTHEAP) NAString(coIdxName.getExternalName(TRUE));
 
       indexInfoArray[idx].indexName = (char*)extIndexName->data();
+      indexInfoArray[idx].indexUID = indexUID;
       indexInfoArray[idx].keytag = keyTag;
       indexInfoArray[idx].isUnique = isUnique;
       indexInfoArray[idx].isExplicit = isExplicit;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/DefaultConstants.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/DefaultConstants.h b/core/sql/sqlcomp/DefaultConstants.h
index 20fefca..7e20226 100644
--- a/core/sql/sqlcomp/DefaultConstants.h
+++ b/core/sql/sqlcomp/DefaultConstants.h
@@ -3297,6 +3297,7 @@ enum DefaultConstants
 
   LOB_HDFS_SERVER,
   LOB_HDFS_PORT,
+  LOB_GC_LIMIT_SIZE,
 
   // Should the DISK POOL be turned on when replicating the DDL using COPY DDL
   REPLICATE_DISK_POOL,
@@ -3800,7 +3801,13 @@ enum DefaultConstants
   // If this cqd is on, then other alters (name, datatype) are also supported.
   TRAF_ALTER_COL_ATTRS,
 
-  // if ON, upsert into the table will use the default value for the omitted columns
+  // if set, let users create system reserved names. Default is OFF.
+  // This cqd should only be used to debug or if system column names are
+  // REALLY needed by users.
+  // Currently syskey, _salt_, _division_.
+  TRAF_ALLOW_RESERVED_COLNAMES,
+
+   // if ON, upsert into the table will use the default value for the omitted columns
   // with default value 
   TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS,
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrComponentOperations.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrComponentOperations.cpp b/core/sql/sqlcomp/PrivMgrComponentOperations.cpp
index f6b68fd..b58d400 100644
--- a/core/sql/sqlcomp/PrivMgrComponentOperations.cpp
+++ b/core/sql/sqlcomp/PrivMgrComponentOperations.cpp
@@ -468,11 +468,18 @@ PrivStatus PrivMgrComponentOperations::createOperationInternal(
    const std::string & operationDescription,
    const int32_t granteeID,
    const std::string & granteeName,
-   const int32_t grantDepth)
+   const int32_t grantDepth,
+   const bool checkExistence)
   
 {
 
-MyRow row(fullTableName_);
+   PrivStatus privStatus = STATUS_GOOD;
+
+   // If operation already created, no need to create
+   if (checkExistence && nameExists(componentUID,operationName))
+      return STATUS_GOOD;
+
+   MyRow row(fullTableName_);
 
    row.componentUID_ = componentUID;
    row.operationCode_ = operationCode;
@@ -480,17 +487,17 @@ MyRow row(fullTableName_);
    row.isSystem_ = isSystemOperation;
    row.operationDescription_ = operationDescription;
    
-MyTable &myTable = static_cast<MyTable &>(myTable_);
+   MyTable &myTable = static_cast<MyTable &>(myTable_);
 
-PrivStatus privStatus = myTable.insert(row);
+   privStatus = myTable.insert(row);
    
    if (privStatus != STATUS_GOOD)
       return privStatus;
       
-// Grant authority to creator
-PrivMgrComponentPrivileges componentPrivileges(metadataLocation_,pDiags_);
+   // Grant authority to creator
+   PrivMgrComponentPrivileges componentPrivileges(metadataLocation_,pDiags_);
 
-std::vector<std::string> operationCodes;
+   std::vector<std::string> operationCodes;
 
    operationCodes.push_back(operationCode);                                                     
                                                      
@@ -499,7 +506,8 @@ std::vector<std::string> operationCodes;
                                                            SYSTEM_USER,
                                                            ComUser::getSystemUserName(),
                                                            granteeID,
-                                                           granteeName,grantDepth);
+                                                           granteeName,grantDepth,
+                                                           checkExistence);
                                                      
    return privStatus;
                                                      

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrComponentOperations.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrComponentOperations.h b/core/sql/sqlcomp/PrivMgrComponentOperations.h
index a506d2f..7d0069d 100644
--- a/core/sql/sqlcomp/PrivMgrComponentOperations.h
+++ b/core/sql/sqlcomp/PrivMgrComponentOperations.h
@@ -71,7 +71,8 @@ public:
       const std::string & operationDescription,
       const int32_t granteeID,
       const std::string & granteeName,
-      const int32_t grantDepth);
+      const int32_t grantDepth,
+      const bool checkExistence);
       
   PrivStatus describeComponentOperations(
       const std::string & componentUIDString,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp b/core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp
index fae5d0e..70dd089 100644
--- a/core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp
+++ b/core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp
@@ -854,12 +854,13 @@ PrivStatus PrivMgrComponentPrivileges::grantPrivilegeInternal(
    const std::string & grantorName,
    const int32_t granteeID,
    const std::string & granteeName,
-   const int32_t grantDepth)
+   const int32_t grantDepth,
+   const bool checkExistence)
   
 {
 
-MyTable &myTable = static_cast<MyTable &>(myTable_);
-MyRow row(fullTableName_);
+   MyTable &myTable = static_cast<MyTable &>(myTable_);
+   MyRow row(fullTableName_);
 
    row.componentUID_ = componentUID;
    row.grantDepth_ = grantDepth;
@@ -868,9 +869,17 @@ MyRow row(fullTableName_);
    row.grantorID_ = grantorID;
    row.grantorName_ = grantorName;
    
+   const std::string componentUIDString = to_string((long long int)componentUID);
+
    for (size_t oc = 0; oc < operationCodes.size(); oc++)
    {
       row.operationCode_ = operationCodes[oc];
+
+      if (checkExistence &&
+          grantExists(componentUIDString, row.operationCode_, row.grantorID_,
+                      row.granteeID_, row.grantDepth_))
+         continue;
+
       PrivStatus privStatus = myTable.insert(row);
       
       if (privStatus != STATUS_GOOD)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrComponentPrivileges.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrComponentPrivileges.h b/core/sql/sqlcomp/PrivMgrComponentPrivileges.h
index 0b798a5..566b051 100644
--- a/core/sql/sqlcomp/PrivMgrComponentPrivileges.h
+++ b/core/sql/sqlcomp/PrivMgrComponentPrivileges.h
@@ -102,7 +102,8 @@ public:
       const std::string & grantorName,
       const int32_t granteeID,
       const std::string & granteeName,
-      const int32_t grantDepth);
+      const int32_t grantDepth,
+      const bool checkExistence);
       
    PrivStatus grantPrivilegeToCreator(
       const int64_t componentUID,


[05/50] [abbrv] incubator-trafodion git commit: add version info & remove unnecessory file

Posted by db...@apache.org.
add version info & remove unnecessory file


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

Branch: refs/heads/master
Commit: 28460bd8e3c86c934617fcebf1ed1594f7543847
Parents: e7b1691
Author: mashengchen <ma...@gmail.com>
Authored: Wed Mar 2 02:46:34 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Wed Mar 2 02:46:34 2016 +0000

----------------------------------------------------------------------
 .../hbase/client/transactional/HBaseDCZK.java   | 1111 ------------------
 .../hbase/client/transactional/PeerInfo.java    |  226 ----
 .../hbase/client/transactional/STRConfig.java   |  426 -------
 .../client/transactional/XDCStatusWatcher.java  |  207 ----
 .../transactional/TrxRegionEndpoint.java.tmpl   |   70 +-
 .../transactional/TrxRegionObserver.java.tmpl   |   25 +-
 core/sql/pom.xml.apache                         |   19 +-
 core/sql/pom.xml.hdp                            |   21 +-
 8 files changed, 48 insertions(+), 2057 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/HBaseDCZK.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/HBaseDCZK.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/HBaseDCZK.java
deleted file mode 100644
index 2861f87..0000000
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/HBaseDCZK.java
+++ /dev/null
@@ -1,1111 +0,0 @@
-// @@@ 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 @@@
-
-package org.apache.hadoop.hbase.client.transactional;
-
-import java.io.IOException;
-
-import java.nio.charset.Charset;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.hadoop.hbase.Abortable;
-import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.ServerName;
-
-import org.apache.hadoop.hbase.*;
-import org.apache.hadoop.hbase.client.*;
-
-import org.apache.hadoop.hbase.client.transactional.STRConfig;
-
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.CreateMode;
-
-import org.apache.hadoop.hbase.client.transactional.PeerInfo;
-import org.apache.hadoop.hbase.client.transactional.XDCStatusWatcher;
-
-/**
- * Multi Data Center specific Zookeeper operations
- */
-public class HBaseDCZK implements Abortable {
-
-    static final Log LOG = LogFactory.getLog(HBaseDCZK.class);
-
-    private static final Charset CHARSET        = Charset.forName("UTF-8");
-
-    public static final String m_my_cluster_id_string = "my_cluster_id";
-    public static final String m_lock_string          = "lock";
-    public static final String m_clusters_string      = "clusters";
-    public static final String m_quorum_string        = "quorum";
-    public static final String m_port_string          = "port";
-    public static final String m_status_string        = "status";
-    public static final String m_trafodion_up_string  = "trafodion_up";
-
-    public static final String m_base_node            = "/hbase/Trafodion/multi_dc";
-    public static final String m_clusters_node        = m_base_node + "/" + m_clusters_string;
-    public static final String m_my_cluster_id_node   = m_base_node + "/" + m_my_cluster_id_string;
-    public static final String m_lock_node            = m_base_node + "/" + m_lock_string;
-
-    private             ZooKeeperWatcher              m_zkw;
-    private             Configuration                 m_config;
-	
-    /**
-     * @param conf
-     * @throws Exception
-     */
-    public HBaseDCZK(final Configuration pv_config) 
-	throws InterruptedException, KeeperException, IOException 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("HBaseDCZK(conf) -- ENTRY");
-	m_config = pv_config;
-	this.m_zkw = new ZooKeeperWatcher(m_config, "DC", this, false);
-    }
-	
-    /**
-     * @param znode
-     * @return znode data
-     * @throws KeeperException
-     */
-    private byte [] get_znode_data (String znode) 
-	throws KeeperException, InterruptedException 
-    {
-	try {
-	    return ZKUtil.getData(m_zkw, znode);
-	}
-	catch(KeeperException.NoNodeException ke) {
-	    LOG.debug(m_zkw.prefix("Unable to list children of znode " 
-				   + znode + " because node does not exist (not an error)"));
-	    return null;
-	} 
-    }
-	
-    /**
-     * @param znode
-     * @return List<String> of children nodes
-     * @throws KeeperException
-     */
-    private List<String> get_znode_children(String pv_node) 
-	throws KeeperException 
-    {
-	return ZKUtil.listChildrenNoWatch(m_zkw, pv_node);
-    }
-
-    /**
-     * @param toDelete
-     * @throws KeeperException
-     */
-    public void delete_cluster_entry(String pv_cluster_id ) 
-	throws KeeperException 
-    {
-	LOG.info("delete_cluster_entry -- ENTRY -- key: " + pv_cluster_id);
-	ZKUtil.deleteNodeFailSilent(m_zkw, m_clusters_node + "/" + pv_cluster_id);
-	LOG.info("delete_cluster_entry -- EXIT ");
-    }
-
-    public ZooKeeperWatcher getZKW() 
-    {
-	return m_zkw;
-    }
-
-    public void register_status_listener(ZooKeeperListener pv_zkl) 
-	throws IOException, KeeperException
-    {
-	if (pv_zkl == null) {
-	    return;
-	}
-
-	m_zkw.registerListener(pv_zkl);
-    }
-
-    /**
-     * @param cluster Id
-     * @throws IOException
-     */
-    public void watch_status_znode(String pv_cluster_id)
-	throws IOException, KeeperException 
-    {
-	
-	LOG.info("HBaseDCZK:watch_status_znode"
-		 );
-		 
-	try {
-	    String lv_cluster_id_node = m_clusters_node + "/" + pv_cluster_id;
-	    String lv_status_node = lv_cluster_id_node + "/" + m_status_string;
-	    ZKUtil.setWatchIfNodeExists(m_zkw, lv_status_node);
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:watch_status_znode: ZKW. Error in setting watch: " 
-				  + m_clusters_node + "/" + pv_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @param cluster Id
-     * @throws IOException
-     */
-    public void watch_clusters_znode()
-	throws IOException, KeeperException 
-    {
-	
-	LOG.info("HBaseDCZK:watch_clusters_znode"
-		 );
-		 
-	try {
-	    ZKUtil.setWatchIfNodeExists(m_zkw, m_clusters_node);
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:watch_clusters_znode: ZKW Unable to create watch on: " 
-				  + m_clusters_node 
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @throws IOException
-     */
-    public void watch_status_all_clusters()
-	throws IOException, KeeperException 
-    {
-	
-	LOG.info("HBaseDCZK:watch_status_all_clusters"
-		 );
-		 
-	Map<Integer, PeerInfo> lv_pi_list = list_clusters();
-	
-	if (lv_pi_list == null) {
-	    return;
-	}
-
-	for (PeerInfo lv_pi : lv_pi_list.values()) {
-	    watch_status_znode(lv_pi.get_id());
-	}
-    }
-
-    public void watch_all() 
-	throws IOException, KeeperException 
-    {
-	watch_clusters_znode();
-	watch_status_all_clusters();
-    }
-
-    /**
-     * @param cluster Id
-     * @param quorum
-     * @param port
-     * @param status
-     * @throws IOException
-     */
-    public void set_peer_znode(String pv_cluster_id,
-			       String pv_quorum, 
-			       String pv_port,
-			       String pv_status
-			       )
-	throws IOException 
-    {
-
-	LOG.info("HBaseDCZK:set_peer_znode: "
-		 + " cluster_id : " + pv_cluster_id
-		 + " quorum: " + pv_quorum
-		 + " port: " + pv_port
-		 + " status: " + pv_status
-		 );
-		 
-	try {
-
-	    if (this.is_locked(pv_cluster_id)) {
-		System.out.println("Could not update info of cluster id: " + pv_cluster_id
-				   + " as it is locked.");
-		
-		return;
-	    }
-
-	    String lv_cluster_id_node = m_clusters_node + "/" + pv_cluster_id;
-	    ZKUtil.createWithParents(m_zkw, lv_cluster_id_node);
-	    
-	    if ((pv_quorum != null) && (pv_quorum.length() > 0)) {
-		String lv_quorum_node = lv_cluster_id_node + "/" + m_quorum_string;
-		ZKUtil.createSetData(m_zkw, lv_quorum_node, pv_quorum.getBytes(CHARSET));
-	    }
-
-	    if ((pv_port != null) && (pv_port.length() > 0)) {
-		String lv_port_node = lv_cluster_id_node + "/" + m_port_string;
-		ZKUtil.createSetData(m_zkw, lv_port_node, pv_port.getBytes(CHARSET));
-	    }
-
-	    if ((pv_status != null) && (pv_status.length() > 0)) {
-		String lv_status_node = lv_cluster_id_node + "/" + m_status_string;
-		ZKUtil.createSetData(m_zkw, lv_status_node, pv_status.getBytes(CHARSET));
-	    }
-
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:set_peer_znode: ZKW Unable to create peer zNode: " 
-				  + m_clusters_node + "/" + pv_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @param cluster Id
-     * @param quorum
-     * @param port
-     * @param status
-     * @throws IOException
-     */
-    public void set_trafodion_znode(String pv_cluster_id,
-				    String pv_node_id,
-				    String pv_trafodion_status_string
-				    ) 
-	throws IOException 
-    {
-
-	if (pv_cluster_id == null) {
-	    if (LOG.isTraceEnabled()) LOG.trace("set_trafodion_znode, pv_cluster_id is null");
-	    return;
-	}
-
-	if (pv_node_id == null) {
-	    if (LOG.isTraceEnabled()) LOG.trace("set_trafodion_znode, pv_node_id is null");
-	    return;
-	}
-
-	if (LOG.isInfoEnabled()) LOG.info("HBaseDCZK:set_trafodion_znode: "
-					  + " cluster_id : " + pv_cluster_id
-					  + " node_id : "    + pv_node_id
-					  + " node_data : "  + pv_trafodion_status_string
-					  );
-	
-	try {
-	    String lv_trafodion_up_node = m_clusters_node 
-		+ "/" + pv_cluster_id
-		+ "/" + m_trafodion_up_string;
-
-	    ZKUtil.createWithParents(m_zkw, lv_trafodion_up_node);
-	    
-	    String lv_ephemeral_node_id_node = lv_trafodion_up_node
-		+ "/" + pv_node_id;
-	    ZKUtil.createEphemeralNodeAndWatch(m_zkw,
-					       lv_ephemeral_node_id_node,
-					       pv_trafodion_status_string.getBytes(CHARSET));
-	} 
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:set_trafodion_znode: ZKW Unable to create zNode: " 
-				  + m_clusters_node 
-				  + "/" + pv_cluster_id
-				  + "/" + pv_node_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @param cluster Id
-     * @throws IOException
-     */
-    public PeerInfo get_peer_znode(String pv_cluster_id) 
-	throws IOException 
-    {
-
-	LOG.info("HBaseDCZK:get_peer_znode: "
-		 + " cluster_id : " + pv_cluster_id
-		 );
-
-	String lv_cluster_id_node = m_clusters_node + "/" + pv_cluster_id;
-
-	try {
-
-	    byte[] znode_data = get_znode_data(lv_cluster_id_node);
-	    if (znode_data == null) {
-		return null;
-	    }
-
-	    PeerInfo lv_pi = new PeerInfo();
-	    lv_pi.set_id(pv_cluster_id);
-
-	    String lv_quorum_node = lv_cluster_id_node + "/" + m_quorum_string;
-	    lv_pi.set_quorum(get_znode_data(lv_quorum_node));
-
-	    String lv_port_node = lv_cluster_id_node + "/" + m_port_string;
-	    lv_pi.set_port(get_znode_data(lv_port_node));
-
-	    String lv_status_node = lv_cluster_id_node + "/" + m_status_string;
-	    lv_pi.set_status(get_znode_data(lv_status_node));
-
-	    String lv_trafodion_up_node = lv_cluster_id_node + "/" + m_trafodion_up_string;
-	    List<String> lv_list_nodes = get_znode_children(lv_trafodion_up_node);
-	    if ((lv_list_nodes != null) && 
-		(lv_list_nodes.size() > 0)) {
-		lv_pi.setTrafodionStatus(true);
-	    }
-	    
-	    return lv_pi;
-
-	} 
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:get_peer_znode: ZKW Unable to get peer zNode: " 
-				  + lv_cluster_id_node
-				  + " , throwing IOException " + e
-				  );
-	} 
-	catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:get_peer_znode: ZKW Unable to get peer zNode: " 
-				  + lv_cluster_id_node
-				  + " , throwing IOException " + e
-				  );
-	}
-
-    }
-
-    /**
-     * @param cluster Id
-     * @throws IOException
-     */
-    public boolean delete_peer_znode(String pv_cluster_id) 
-	throws IOException 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("HBaseDCZK:delete_peer_znode: "
-					    + " cluster_id : " + pv_cluster_id
-					    );
-
-	try {
-	    String lv_myid = get_my_id();
-	    
-	    if (pv_cluster_id.equals(lv_myid)) {
-		System.out.println("Cannot delete your own info.");
-		return false;
-	    }
-	    
-	    Map<Integer, PeerInfo> lv_pi_list = list_clusters();
-	
-	    if (lv_pi_list == null) {
-		return false;
-	    }
-
-	    boolean lb_found = false;
-	    for (PeerInfo lv_pi : lv_pi_list.values()) {
-		if (lv_pi.get_id().equals(pv_cluster_id)) {
-		    lb_found = true;
-		}
-	    }
-
-	    if ( ! lb_found ) {
-		System.out.println("peer: " 
-				   + pv_cluster_id 
-				   + " does not exist");
-		return false;
-	    }
-
-	    ZKUtil.deleteNodeRecursively(m_zkw,
-					 m_clusters_node + "/" + pv_cluster_id
-					 );
-
-	} catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:delete_peer_znode: ZKW, KeeperException trying to delete: " 
-				  + pv_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	} catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:delete_peer_znode: ZKW, InterruptedException trying to delete: " 
-				  + pv_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-
-	return true;
-
-    }
-
-    /**
-     * @param cluster Id
-     * @throws IOException
-     */
-    public Map<Integer, PeerInfo> list_clusters() 
-	throws KeeperException, IOException 
-    {
-	LOG.info("HBaseDCZK:list_clusters"
-		 );
-
-	List<String> peer_node_strings         = new ArrayList<String>();
-	Map<Integer, PeerInfo> peer_info_list  = new HashMap<Integer, PeerInfo>();
-	
-	peer_node_strings = get_znode_children(m_clusters_node);
-	if (peer_node_strings == null) {
-	    return null;
-	}
-
-	for (String peer_node_string : peer_node_strings) {
-	    int lv_id = Integer.parseInt(peer_node_string);
-	    PeerInfo lv_pi = get_peer_znode(peer_node_string);
-	    peer_info_list.put(lv_id, lv_pi);
-	}
-
-	return peer_info_list;
-    }
-
-    /**
-     * @param cluster Id
-     * push_to ZK information from this cluster to the provided cluster
-     * @throws IOException
-     */
-    public void push_to_cluster(String   pv_cluster_id,
-				PeerInfo pv_pi) 
-	throws KeeperException, IOException 
-    {
-	LOG.info("HBaseDCZK:push_to_cluster"
-		 + " cluster id: " + pv_cluster_id
-		 + " data: " + pv_pi
-		 );
-
-	try {
-	    
-	    STRConfig     lv_STRConfig = null;
-	    Configuration lv_config  = null;
-
-	    lv_STRConfig = STRConfig.getInstance(m_config);
-	    lv_config = lv_STRConfig.getPeerConfiguration(Integer.parseInt(pv_cluster_id), false);
-	    if (lv_config == null) {
-		System.out.println("Peer ID: " + pv_cluster_id + " does not exist OR it has not been configured.");
-		return;
-	    }
-		
-	    HBaseDCZK lv_zk = new HBaseDCZK(lv_config);
-	    
-	    if (lv_zk.is_locked(pv_cluster_id)) {
-		System.out.println("Could not push info of cluster id: " + pv_pi.get_id()
-				   + " to cluster id: " + pv_cluster_id
-				   + " as it is locked.");
-	    }
-	    else {
-		lv_zk.set_peer_znode(pv_pi.get_id(),
-				     pv_pi.get_quorum(), 
-				     pv_pi.get_port(),
-				     pv_pi.get_status()
-				     );
-	    }
-	} 
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:push_to_cluster: ZKW, KeeperException: " 
-				  + " , throwing IOException " + e
-				  );
-	} 
-	catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:push_to_cluster: ZKW, InterruptedException: " 
-				  + " , throwing IOException " + e
-				  );
-	} 
-	catch (Exception e) {
-	    System.out.println("exception: " + e);
-	    System.exit(1);
-	}
-
-    }
-
-    public void push_to_clusters() 
-	throws KeeperException, IOException 
-    {
-	LOG.info("HBaseDCZK:push_to_clusters"
-		 );
-
-	Map<Integer, PeerInfo> lv_pi_list = list_clusters();
-	
-	if (lv_pi_list == null) {
-	    return;
-	}
-
-	try {
-	    
-	    String        lv_my_id   = get_my_id();
-	    PeerInfo      lv_my_pi   = lv_pi_list.get(Integer.parseInt(lv_my_id));
-	    
-	    for (PeerInfo lv_pi : lv_pi_list.values()) {
-		if (lv_pi.get_id().equals(lv_my_id)) {
-		    continue;
-		}
-		
-		push_to_cluster(lv_pi.get_id(), lv_my_pi);
-	    }
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:push_to_clusters: ZKW, KeeperException: " 
-				  + " , throwing IOException " + e
-				  );
-	}
-	catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:push_to_clusters: ZKW, InterruptedException: " 
-				  + " , throwing IOException " + e
-				  );
-	}
-
-    }
-
-    /**
-     * @param cluster Id
-     * pulls ZK information from the cluster to the provided cluster
-     * @throws IOException
-     */
-    public void pull_cluster(String pv_cluster_id)
-	throws KeeperException, IOException 
-    {
-	LOG.info("HBaseDCZK:pull_cluster"
-		 + " cluster id: " + pv_cluster_id
-		 );
-
-	try {
-	    
-	    STRConfig     lv_STRConfig = null;
-	    Configuration lv_config  = null;
-
-	    lv_STRConfig = STRConfig.getInstance(m_config);
-	    lv_config = lv_STRConfig.getPeerConfiguration(Integer.parseInt(pv_cluster_id), false);
-	    if (lv_config == null) {
-		System.out.println("Peer ID: " + pv_cluster_id + " does not exist OR it has not been configured.");
-		return;
-	    }
-		
-	    HBaseDCZK lv_zk = new HBaseDCZK(lv_config);
-
-	    PeerInfo lv_pi = lv_zk.get_peer_znode(pv_cluster_id);
-
-	    this.set_peer_znode(lv_pi.get_id(),
-				lv_pi.get_quorum(), 
-				lv_pi.get_port(),
-				lv_pi.get_status());
-	} 
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:pull_cluster: ZKW, KeeperException: " 
-				  + " , throwing IOException " + e
-				  );
-	} 
-	catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:pull_cluster: ZKW, InterruptedException: " 
-				  + " , throwing IOException " + e
-				  );
-	} 
-	catch (Exception e) {
-	    System.out.println("exception: " + e);
-	    System.exit(1);
-	}
-
-    }
-    
-    // Communicates with each cluster and gets that cluster's config information
-    public void pull_clusters() 
-	throws KeeperException, IOException 
-    {
-	LOG.info("HBaseDCZK:pull_clusters"
-		 );
-
-	try {
-
-	    String        lv_my_id   = get_my_id();
-
-	    if (this.is_locked(lv_my_id)) {
-		System.out.println("Could not pull info for cluster id: " + lv_my_id
-				   + " as it is locked.");
-
-		return;
-	    }
-
-	    Map<Integer, PeerInfo> lv_pi_list = list_clusters();
-	
-	    if (lv_pi_list == null) {
-		return;
-	    }
-
-	    for (PeerInfo lv_pi : lv_pi_list.values()) {
-		if (lv_pi.get_id().equals(lv_my_id)) {
-		    continue;
-		}
-		
-		pull_cluster(lv_pi.get_id());
-	    }
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:pull_clusters: ZKW, KeeperException: " 
-				  + " , throwing IOException " + e
-				  );
-	}
-	catch (InterruptedException e) {
-	    throw new IOException("HBaseDCZK:pull_clusters: ZKW, InterruptedException: " 
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @param my_cluster_id
-     * @throws IOException
-     */
-    public boolean is_locked(String pv_my_cluster_id) 
-	throws IOException 
-    {
-	LOG.info("HBaseDCZK:is_locked: cluster ID: " + pv_my_cluster_id);
-	int lv_exists = 0;
-
-	try {
-	    lv_exists = ZKUtil.checkExists(m_zkw, m_lock_node);
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:is_locked: ZKW Unable to check existence of znode: " 
-				  + m_lock_node
-				  + " , throwing IOException " + e
-				  );
-	}
-
-	if (lv_exists != -1) {
-	    return true;
-	}
-
-	return false;
-    }
-    
-
-    /**
-     * @param my_cluster_id
-     * @throws IOException
-     */
-    public void lock_db(String pv_my_cluster_id) 
-	throws IOException 
-    {
-	LOG.info("HBaseDCZK:lock_db: cluster ID: " + pv_my_cluster_id);
-
-	try {
-	    ZKUtil.createSetData(m_zkw, m_lock_node, pv_my_cluster_id.getBytes(CHARSET));
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:lock_db: ZKW Unable to create zNode: " 
-				  + m_lock_node
-				  + " for " + pv_my_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-    
-    /**
-     * @param my_cluster_id
-     * @throws IOException
-     */
-    public void unlock_db(String pv_my_cluster_id) 
-	throws IOException 
-    {
-	LOG.info("HBaseDCZK:unlock_db: cluster ID: " + pv_my_cluster_id);
-
-	try {
-	    ZKUtil.deleteNodeFailSilent(m_zkw, m_lock_node);
-	}
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:unlock_db: ZKW Unable to delete zNode: " 
-				  + m_lock_node 
-				  + " for " + pv_my_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-    
-    /**
-     * @param my_cluster_id
-     * @throws IOException
-     */
-    public void set_my_id(String pv_my_cluster_id) 
-	throws IOException 
-    {
-	LOG.info("HBaseDCZK:set_my_id: cluster ID: " + pv_my_cluster_id);
-
-	try {
-	    ZKUtil.createSetData(m_zkw, m_my_cluster_id_node, pv_my_cluster_id.getBytes(CHARSET));
-	    PeerInfo lv_pi = get_peer_znode(pv_my_cluster_id);
-	    if (lv_pi == null) {
-		set_peer_znode(pv_my_cluster_id,
-			       new String(m_config.get( STRConfig.ZK_QUORUM )),
-			       new String(m_config.get( STRConfig.ZK_PORT )),
-			       new String("hupsup"));
-	    }
-	} 
-	catch (KeeperException e) {
-	    throw new IOException("HBaseDCZK:set_my_id: ZKW Unable to create zNode: " 
-				  + pv_my_cluster_id
-				  + " , throwing IOException " + e
-				  );
-	}
-    }
-
-    /**
-     * @return
-     */
-    public String get_my_id() 
-	throws KeeperException, InterruptedException 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("HBaseDCZK:get_my_id");
-
-	byte[] b_my_cluster_id = get_znode_data(m_my_cluster_id_node);
-	if (b_my_cluster_id != null) {
-	    String lv_cid = new String(b_my_cluster_id);
-	    if (LOG.isTraceEnabled()) LOG.trace("get_my_id id: " + lv_cid);
-	    return lv_cid;
-	}
-
-	return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.hadoop.hbase.Abortable#abort(java.lang.String, java.lang.Throwable)
-     */
-    @Override
-	public void abort(String arg0, Throwable arg1) {
-	// TODO Auto-generated method stub
-		
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.hadoop.hbase.Abortable#isAborted()
-     */
-    @Override
-	public boolean isAborted() {
-	// TODO Auto-generated method stub
-	return false;
-    }
-
-    static void usage() {
-	
-	System.out.println("usage:");
-	System.out.println("HBaseDCZK [<command> | <options>...]");
-	System.out.println("<command>         : <   -setmyid <id>");
-	System.out.println("                  :   | -getmyid");
-	System.out.println("                  :   | -set <cluster info>");
-	System.out.println("                  :   | -get <id>");
-	System.out.println("                  :   | -list");
-	System.out.println("                  :   | -delete <id>");
-	System.out.println("                  :   | -push ");
-	System.out.println("                  :   | -pull ");
-	System.out.println("                  :   | -lock ");
-	System.out.println("                  :   | -unlock >");
-	System.out.println("<options>         : [ <peer info> | -h | -v ]");
-	System.out.println("<cluster info>    : < <cluster id> [ <quorum info> | <port info> | <status info> ]... >");
-	System.out.println("<cluster id>      : -id <id> ");
-	System.out.println("<quorum info>     : -quorum <zookeeper quorum>");
-	System.out.println("<port info>       : -port <zookeeper client port>");
-	System.out.println("<status info>     : -status <status>");
-	System.out.println("<status>          : <STR Status>");
-	System.out.println("<STR Status>      : <STR Up>      (sup)| <STR Down>       (sdn)");
-	System.out.println("<Trafodion Status>: <Trafodion Up>(tup)| <Trafodion Down> (tdn)");
-	System.out.println("<peer info>       : -peer <id>");
-	System.out.println("                  :    With this option the command is executed at the specified peer.");
-	System.out.println("                  :    (Defaults to the local cluster)");
-	System.out.println("<id>              : A number between 1 and 100 (inclusive)");
-	System.out.println("-h                : Help (this output).");
-	System.out.println("-v                : Verbose output. ");
-
-    }
-
-    public static void main(String [] Args) throws Exception {
-
-	boolean lv_retcode = true;
-
-	boolean lv_verbose = false;
-	boolean lv_test    = false;
-	int     lv_peer_id = 0;
-
-	String  lv_my_id  = new String();
-	String  lv_id     = new String();
-	String  lv_quorum = new String();
-	String  lv_port   = new String();
-	String  lv_status = new String();
-
-	boolean lv_cmd_set_my_id  = false;
-	boolean lv_cmd_get_my_id  = false;
-	boolean lv_cmd_set        = false;
-	boolean lv_cmd_get        = false;
-	boolean lv_cmd_delete     = false;
-	boolean lv_cmd_lock       = false;
-	boolean lv_cmd_unlock     = false;
-	boolean lv_cmd_list       = false;
-	boolean lv_cmd_push       = false;
-	boolean lv_cmd_pull       = false;
-
-	int lv_index = 0;
-	for (String lv_arg : Args) {
-	    lv_index++;
-	    if (lv_arg.compareTo("-h") == 0) {
-		usage();
-		System.exit(0);
-	    }
-	    if (lv_arg.compareTo("-v") == 0) {
-		lv_verbose = true;
-	    }
-	    if (lv_arg.compareTo("-t") == 0) {
-		lv_test = true;
-	    }
-	    else if (lv_arg.compareTo("-peer") == 0) {
-		lv_peer_id = Integer.parseInt(Args[lv_index]);
-		if (lv_verbose) System.out.println("Talk to Peer Cluster, ID: " + lv_peer_id);
-	    }
-	    else if (lv_arg.compareTo("-id") == 0) {
-		lv_id =Args[lv_index];
-		int lv_integer_id = Integer.parseInt(lv_id);
-		if ((lv_integer_id < 1) || (lv_integer_id > 100)) {
-		    System.out.println("The id has to be between 1 and 100 (inclusive). Exitting...");
-		    usage();
-		    System.exit(1);
-		}
-		if (lv_verbose) System.out.println("Cluster ID: " + lv_id);
-	    }
-	    else if (lv_arg.compareTo("-status") == 0) {
-		lv_status =Args[lv_index];
-		if (lv_verbose) System.out.println("Status: " + lv_status);
-	    }
-	    else if (lv_arg.compareTo("-quorum") == 0) {
-		lv_quorum =Args[lv_index];
-		if (lv_verbose) System.out.println("Quorum: " + lv_quorum);
-	    }
-	    else if (lv_arg.compareTo("-port") == 0) {
-		lv_port =Args[lv_index];
-		if (lv_verbose) System.out.println("Port: " + lv_port);
-	    }
-	    else if (lv_arg.compareTo("-setmyid") == 0) {
-		if (lv_verbose) System.out.print("Command: setmyid:");
-		lv_my_id =Args[lv_index];
-		if ((lv_my_id != null) && (lv_my_id.length() > 0)) {
-		    if (lv_verbose) System.out.println(lv_my_id);
-		    int lv_integer_id = Integer.parseInt(lv_my_id);
-		    if ((lv_integer_id < 1) || (lv_integer_id > 100)) {
-			System.out.println("The id has to be between 1 and 100 (inclusive). Exitting...");
-			usage();
-			System.exit(1);
-		    }
-		    lv_cmd_set_my_id = true;
-		}
-		else {
-		    System.out.println("Id not provided. Exitting...");
-		    System.exit(1);
-		}
-	    }
-	    else if (lv_arg.compareTo("-getmyid") == 0) {
-		if (lv_verbose) System.out.println("Command: getmyid");
-		lv_cmd_get_my_id = true;
-	    }
-	    else if (lv_arg.compareTo("-set") == 0) {
-		if (lv_verbose) System.out.println("Command: set");
-		lv_cmd_set = true;
-	    }
-	    else if (lv_arg.compareTo("-get") == 0) {
-		if (lv_verbose) System.out.println("Command: get");
-		lv_cmd_get = true;
-		if (Args.length > lv_index) {
-		    if (lv_verbose) System.out.println("Args.length: " + Args.length
-						       + " lv_index: " + lv_index);
-		    lv_id = Args[lv_index];
-		}
-		if ((lv_id != null) && (lv_id.length() > 0)) {
-		    if (lv_verbose) System.out.println("Provided id: " + lv_id);
-		}
-		else {
-		    System.out.println("Id not provided. Getting this cluster's info...");
-		}
-	    }
-	    else if (lv_arg.compareTo("-delete") == 0) {
-		if (lv_verbose) System.out.println("Command: delete");
-		if (Args.length > lv_index) {
-		    lv_id =Args[lv_index];
-		}
-		if ((lv_id != null) && (lv_id.length() > 0)) {
-		    lv_cmd_delete = true;
-		}
-		else {
-		    System.out.println("Id not provided. Exitting...");
-		    System.exit(1);
-		}
-	    }
-	    else if (lv_arg.compareTo("-list") == 0) {
-		if (lv_verbose) System.out.println("Command: list");
-		lv_cmd_list = true;
-	    }
-	    else if (lv_arg.compareTo("-lock") == 0) {
-		if (lv_verbose) System.out.println("Command: lock");
-		lv_cmd_lock = true;
-	    }
-	    else if (lv_arg.compareTo("-unlock") == 0) {
-		if (lv_verbose) System.out.println("Command: unlock");
-		lv_cmd_unlock = true;
-	    }
-	    else if (lv_arg.compareTo("-push") == 0) {
-		if (lv_verbose) System.out.println("Command: push");
-		lv_cmd_push = true;
-	    }
-	    else if (lv_arg.compareTo("-pull") == 0) {
-		if (lv_verbose) System.out.println("Command: pull");
-		lv_cmd_pull = true;
-	    }
-	}
-	    
-	STRConfig lv_STRConfig = null;
-	Configuration lv_config = HBaseConfiguration.create();
-	if (lv_peer_id > 0) {
-	    try {
-		System.setProperty("PEERS", String.valueOf(lv_peer_id));
-		lv_STRConfig = STRConfig.getInstance(lv_config);
-		lv_config = lv_STRConfig.getPeerConfiguration(lv_peer_id, false);
-		if (lv_config == null) {
-		    System.out.println("Peer ID: " + lv_peer_id + " does not exist OR it has not been configured.");
-		    System.exit(1);
-		}
-	    }
-	    catch (ZooKeeperConnectionException zke) {
-		System.out.println("Zookeeper Connection Exception trying to get STRConfig instance: " + zke);
-		System.exit(1);
-	    }
-	    catch (IOException ioe) {
-		System.out.println("IO Exception trying to get STRConfig instance: " + ioe);
-		System.exit(1);
-	    }
-	}
-
-	try {
-	    HBaseDCZK lv_zk = new HBaseDCZK(lv_config);
-	    if (lv_id.length() <= 0) {
-		lv_id = lv_zk.get_my_id();
-		if (lv_verbose) System.out.println("my id: " + lv_id);
-	    }
-	    if (lv_cmd_set_my_id) {
-		lv_zk.set_my_id(lv_my_id);
-		if (lv_test) {
-		    lv_zk.watch_all();
-		    XDCStatusWatcher lv_pw = new XDCStatusWatcher(lv_zk.getZKW());
-		    lv_pw.setDCZK(lv_zk);
-		    lv_pw.setSTRConfig(lv_STRConfig);
-		    lv_zk.register_status_listener(lv_pw);
-
-		    System.out.println("Number of listeners: " + lv_zk.getZKW().getNumberOfListeners());
-		    Scanner scanner = new Scanner(System.in);
-		    System.out.print("Enter any key when done: ");
-		    String userdata = scanner.next();
-		}					
-	    }
-	    else if (lv_cmd_get_my_id) {
-		lv_my_id = lv_zk.get_my_id();
-		if (lv_my_id != null) {
-		    System.out.println(lv_my_id);
-		}
-		else {
-		    System.out.println("0");
-		}
-	    }
-	    else if (lv_cmd_set) {
-		if ((lv_status.compareTo("sup") != 0) && 
-		    (lv_status.compareTo("sdn") != 0)) {
-		    System.out.println("Status string can only be sup or sdn");
-		    System.exit(1);
-		}
-		lv_zk.set_peer_znode(lv_id, lv_quorum, lv_port, lv_status);
-	    }
-	    else if (lv_cmd_get) {
-		if (lv_verbose) System.out.println(lv_id);
-		PeerInfo lv_pi = lv_zk.get_peer_znode(lv_id);
-		if (lv_pi != null) {
-		    System.out.println(lv_pi);
-		}
-	    }
-	    else if (lv_cmd_delete) {
-		if (lv_verbose) System.out.println(lv_id);
-		lv_retcode = lv_zk.delete_peer_znode(lv_id);
-		if (lv_retcode) {
-		    System.out.println("Successfully deleted the info about the peer: " + lv_id);
-		}		    
-	    }
-	    else if (lv_cmd_list) {
-		Map<Integer, PeerInfo> lv_pi_list = lv_zk.list_clusters();
-		if (lv_pi_list != null) {
-		    lv_my_id = lv_zk.get_my_id();
-		    for (PeerInfo lv_pi : lv_pi_list.values()) {
-			System.out.print(lv_pi);
-			if ((lv_my_id != null) && 
-			    (lv_pi.get_id() != null) && 
-			    (lv_pi.get_id().equals(lv_my_id))) {
-			    System.out.print("*");
-			    if (lv_zk.is_locked(lv_my_id)) System.out.println(":L"); else System.out.println("");
-			}
-			else {
-			    System.out.println("");
-			}
-		    }
-		}
-	    }
-	    else if (lv_cmd_lock) {
-		lv_my_id = lv_zk.get_my_id();
-		if (lv_my_id != null) {
-		    if (lv_verbose) System.out.println(lv_my_id);
-		}
-		else {
-		    if (lv_verbose) System.out.println("0");
-		}
-		lv_zk.lock_db(lv_my_id);
-	    }
-	    else if (lv_cmd_unlock) {
-		lv_my_id = lv_zk.get_my_id();
-		if (lv_my_id != null) {
-		    if (lv_verbose) System.out.println(lv_my_id);
-		}
-		else {
-		    if (lv_verbose) System.out.println("0");
-		}
-		lv_zk.unlock_db(lv_my_id);
-	    }
-	    else if (lv_cmd_push) {
-		lv_zk.push_to_clusters();
-	    }
-	    else if (lv_cmd_pull) {
-		lv_zk.pull_clusters();
-	    }
-	    else {
-		usage();
-	    }
-	}
-	catch (Exception e)
-	    {
-		System.out.println("exception: " + e);
-		System.exit(1);
-	    }
-
-	if (! lv_retcode) {
-	    System.exit(1);
-	}
-
-	System.exit(0);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/PeerInfo.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/PeerInfo.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/PeerInfo.java
deleted file mode 100644
index ec0011a..0000000
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/PeerInfo.java
+++ /dev/null
@@ -1,226 +0,0 @@
-// @@@ 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 @@@
-
-package org.apache.hadoop.hbase.client.transactional;
-import org.apache.zookeeper.KeeperException;
-
-import java.io.IOException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-
-/**
- * Multi Data Center specific
- */
-public class PeerInfo {
-
-    static final Log LOG = LogFactory.getLog(PeerInfo.class);
-
-    public static final String TRAFODION_UP             = "tup";
-    public static final String TRAFODION_DOWN           = "tdn";
-    public static final String HBASE_UP                 = "hup";
-    public static final String HBASE_DOWN               = "hdn";
-    public static final String STR_UP                   = "sup";
-    public static final String STR_DOWN                 = "sdn";
-
-    private String m_id;
-    private String m_quorum;
-    private String m_port;
-    private boolean m_HBaseUp;
-    private boolean m_TrafodionUp;
-    private boolean m_STRUp;
-
-    public PeerInfo() {
-	if (LOG.isTraceEnabled()) LOG.trace("PeerInfo (s,s,s,s) -- ENTRY");
-
-	m_id = null;
-	m_quorum = null;
-	m_port = null;
-	m_HBaseUp = false;
-	m_TrafodionUp = false;
-	m_STRUp = false;
-
-    }
-
-    public PeerInfo(String pv_id, 
-		    String pv_quorum, 
-		    String pv_port, 
-		    String pv_status) 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("PeerInfo (s,s,s,s) -- ENTRY");
-
-	m_id = pv_id;
-	m_quorum = pv_quorum;
-	m_port = pv_port;
-	m_HBaseUp = false;
-	m_TrafodionUp = false;
-	m_STRUp = false;
-	set_internal_status_fields(pv_status);
-    }
-
-    public String get_id() {
-	return m_id;
-    }
-
-    public void set_id(String pv_id) {
-	m_id = pv_id;
-    }
-
-    public String get_quorum() {
-	return m_quorum;
-    }
-
-    public void set_quorum(String pv_quorum) {
-	m_quorum = pv_quorum;
-    }
-
-    public void set_quorum(byte[] pv_quorum) {
-	if (pv_quorum != null) {
-	    m_quorum = new String(pv_quorum);
-	}
-    }
-
-    public String get_port() {
-	return m_port;
-    }
-
-    public void set_port(String pv_port) {
-	m_port = pv_port;
-    }
-
-    public void set_port(byte[] pv_port) {
-	if (pv_port != null) {
-	    m_port = new String(pv_port);
-	}
-    }
-
-    public String get_status() {
-	StringBuilder lv_sb = new StringBuilder();
-	
-	get_status(lv_sb);
-
-	return lv_sb.toString();
-    }
-
-    public void get_status(StringBuilder pv_sb) {
-
-	if (pv_sb == null) {
-	    return;
-	}
-
-	if (m_TrafodionUp) {
-	    pv_sb.append(TRAFODION_UP);
-	}
-	else {
-	    pv_sb.append(TRAFODION_DOWN);
-	}
-	pv_sb.append("-");
-
-	if (m_STRUp) {
-	    pv_sb.append(STR_UP);
-	}
-	else {
-	    pv_sb.append(STR_DOWN);
-	}
-
-    }
-
-    private void set_internal_status_fields(String pv_status) {
-	if (pv_status.contains(HBASE_UP)) {
-	    m_HBaseUp = true;
-	}
-	if (pv_status.contains(HBASE_DOWN)) {
-	    m_HBaseUp = false;
-	}
-	if (pv_status.contains(TRAFODION_UP)) {
-	    m_TrafodionUp = true;
-	}
-	if (pv_status.contains(TRAFODION_DOWN)) {
-	    m_TrafodionUp = false;
-	}
-	if (pv_status.contains(STR_UP)) {
-	    m_STRUp = true;
-	}
-	if (pv_status.contains(STR_DOWN)) {
-	    m_STRUp = false;
-	}
-    }
-
-    public void set_status(String pv_status) {
-	set_internal_status_fields(pv_status);
-    }
-	
-    public void set_status(byte[] pv_status) {
-	if (pv_status != null) {
-	    String lv_status = new String(pv_status);
-	    set_internal_status_fields(lv_status);
-	}
-    }
-
-    public void setHBaseStatus(boolean pv_status) {
-	m_HBaseUp = pv_status;
-    }
-
-    public void setTrafodionStatus(boolean pv_status) {
-	m_TrafodionUp = pv_status;
-    }
-
-    public void setSTRStatus(boolean pv_status) {
-	m_STRUp = pv_status;
-    }
-
-    public boolean isHBaseUp() {
-	return m_HBaseUp;
-    }
-
-    public boolean isTrafodionUp() {
-	return m_TrafodionUp;
-    }
-
-    public boolean isSTRUp() {
-	return m_STRUp;
-    }
-
-    public String toString()  
-    {
-	StringBuilder lv_sb = new StringBuilder();
-	lv_sb = lv_sb
-	    .append(m_id)
-	    .append(":")
-	    .append(m_quorum)
-	    .append(":")
-	    .append(m_port)
-	    .append(":");
-
-	get_status(lv_sb);
-
-
-	return lv_sb.toString();
-    }
-
-    public static void main(String [] Args) throws Exception 
-    {
-	PeerInfo lv_peer = new PeerInfo("1", "q", "24000", "sup");
-	System.exit(0);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/STRConfig.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/STRConfig.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/STRConfig.java
deleted file mode 100644
index 3236e6a..0000000
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/STRConfig.java
+++ /dev/null
@@ -1,426 +0,0 @@
-// @@@ 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 @@@
-
-package org.apache.hadoop.hbase.client.transactional;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.HashMap;
-
-import org.apache.commons.codec.binary.Hex;
-
-import org.apache.hadoop.fs.Path;
-
-import org.apache.hadoop.hbase.ServerName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.MasterNotRunningException;
-import org.apache.hadoop.hbase.TableNotFoundException;
-import org.apache.hadoop.hbase.TableNotEnabledException;
-import org.apache.hadoop.hbase.TableNotDisabledException;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.HRegionLocation;
-import org.apache.hadoop.hbase.ZooKeeperConnectionException;
-import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
-import org.apache.hadoop.hbase.client.HConnection;
-import org.apache.hadoop.hbase.client.HConnectionManager;
-import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.client.coprocessor.Batch;
-import org.apache.hadoop.hbase.client.Durability;
-import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos;
-
-import org.apache.hadoop.hbase.exceptions.DeserializationException;
-import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
-import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
-import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
-import org.apache.hadoop.hbase.ipc.ServerRpcController;
-import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
-import org.apache.hadoop.hbase.regionserver.BloomType;
-import org.apache.hadoop.hbase.regionserver.KeyPrefixRegionSplitPolicy;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Pair;
-import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
-
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-
-import org.apache.hadoop.hbase.client.transactional.PeerInfo;
-import org.apache.hadoop.ipc.RemoteException;
-
-import org.apache.zookeeper.KeeperException;
-
-import com.google.protobuf.ByteString;
-
-/**
- * STR Config.
- */
-public class STRConfig {
-
-    static final Log LOG = LogFactory.getLog(STRConfig.class);
-
-    static final String ZK_QUORUM = "hbase.zookeeper.quorum";
-    static final String ZK_PORT   = "hbase.zookeeper.property.clientPort";
-
-    private static boolean                     sb_replicate = false;
-    private static Map<Integer, Configuration> peer_configs;
-    private static Map<Integer, HConnection>   peer_connections;
-    private static Map<Integer, PeerInfo>      peer_info_list;
-    private static HBaseDCZK                   sv_dc_zk;
-    private static String                      sv_my_cluster_id;
-    private static int                         sv_peer_count = 0;
-    private static int                         sv_trafodion_node_count = -1;
-
-    private static STRConfig s_STRConfig = null; 
-
-    private static void add_peer(Configuration pv_config,
-				 int           pv_peer_num)
-	throws InterruptedException, KeeperException, IOException 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("Adding config info in the map for cluster id: " + pv_peer_num
-					    + " peer config: " + pv_config.get(ZK_QUORUM));
-	peer_configs.put(pv_peer_num, pv_config);
-	if (LOG.isTraceEnabled()) LOG.trace("Added config info in the peer_configs map for cluster id: " + pv_peer_num);
-
-	try {
-	    HConnection lv_connection = HConnectionManager.createConnection(pv_config);
-	    if (LOG.isTraceEnabled()) LOG.trace("Created connection for peer: " + pv_peer_num
-						+ " connection: " + lv_connection);
-	    peer_connections.put(pv_peer_num, lv_connection);
-	    if (LOG.isTraceEnabled()) LOG.trace("Added connection in the peer_connections map for cluster id: " + pv_peer_num);
-	}
-	catch (Exception e) {
-	    LOG.error("Exception while creating the connection: " + e);
-	    e.printStackTrace();
-	    LOG.error("cause: " + e.getCause());
-	}
-
-	if (LOG.isInfoEnabled()) LOG.info("peer#" 
-					  + pv_peer_num 
-					  + ":zk quorum: " + (peer_configs.get(pv_peer_num)).get(ZK_QUORUM)
-					  + ":zk clientPort: " + (peer_configs.get(pv_peer_num)).get(ZK_PORT)
-					  );
-    }
-
-    private static void add_peer(Configuration pv_config,
-				 String pv_peer_num_string,
-				 String pv_quorum,
-				 String pv_port)
-	throws InterruptedException, KeeperException, IOException 
-    {
-	Configuration lv_config = HBaseConfiguration.create(pv_config);
-
-	lv_config.set(ZK_QUORUM, pv_quorum);
-	lv_config.set(ZK_PORT, pv_port);
-
-	int lv_peer_num = Integer.parseInt(pv_peer_num_string);
-	lv_config.setInt("esgyn.cluster.id", lv_peer_num);
-
-	add_peer(lv_config,
-		 lv_peer_num);
-
-    }
-
-    public static void initObjects(Configuration pv_config)
-	throws InterruptedException, KeeperException, IOException 
-    {
-	if (pv_config == null) {
-	    return;
-	}
-
-	pv_config.set("hbase.hregion.impl", "org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion");
-	pv_config.setInt("hbase.client.retries.number", 3);
-
-	peer_configs = new HashMap<Integer, Configuration>();
-	peer_connections = new HashMap<Integer, HConnection>();
-
-	sv_dc_zk = new HBaseDCZK(pv_config);
-	peer_info_list = sv_dc_zk.list_clusters();
-	sv_my_cluster_id = sv_dc_zk.get_my_id();
-	if (sv_my_cluster_id == null) {
-	    sv_my_cluster_id = "0";
-	}
-
-	if (LOG.isTraceEnabled()) LOG.trace("My cluster id: " + sv_my_cluster_id);
-	pv_config.setInt("esgyn.cluster.id", Integer.parseInt(sv_my_cluster_id));
-
-    }
-
-    public static void initClusterConfigsZK(Configuration pv_config) 
-	throws InterruptedException, KeeperException, IOException 
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("initClusterConfigsZK ENTRY");
-
-	initObjects(pv_config);
-
-	// Put myself in the list of configurations
-	add_peer(pv_config,
-		 0);
-
-	try {
-
-	    if (peer_info_list == null) {
-		if (LOG.isTraceEnabled()) LOG.trace("initClusterConfigsZK: list_clusters returned null");
-		return;
-	    }
-
-	    for (PeerInfo lv_pi : peer_info_list.values()) {
-		if (LOG.isTraceEnabled()) LOG.trace("initClusterConfigsZK: " + lv_pi);
-
-		if (lv_pi.get_id().equals(sv_my_cluster_id)) {
-		    continue;
-		}
-
-		add_peer(pv_config,
-			 lv_pi.get_id(),
-			 lv_pi.get_quorum(),
-			 lv_pi.get_port());
-
-		sv_peer_count++;
-	    }
-	}
-	catch (Exception e) {
-	    LOG.error("Exception while adding peer info to the config: " + e);
-	}
-	
-    }
-
-    public PeerInfo getPeerInfo(int pv_cluster_id) {
-	PeerInfo lv_pi = peer_info_list.get(pv_cluster_id);
-
-	return lv_pi;
-    }
-
-    public synchronized void setPeerStatus(int    pv_cluster_id,
-					   String pv_status) 
-    {
-
-	if (LOG.isTraceEnabled()) LOG.trace("setPeerStatus" 
-					    + " cluster id: " + pv_cluster_id
-					    + " status: " + pv_status
-					    );
-
-	if (pv_status == null) {
-	    return;
-	}
-
-	PeerInfo lv_pi = getPeerInfo(pv_cluster_id);
-	if (lv_pi != null) {
-	    boolean previouslySTRUp = lv_pi.isSTRUp();
-	    lv_pi.set_status(pv_status);
-	    boolean nowSTRUp = lv_pi.isSTRUp();
-	    if (previouslySTRUp && ! nowSTRUp) {
-		--sv_peer_count;
-	    }
-	    else if (! previouslySTRUp && nowSTRUp) {
-		++sv_peer_count;
-	    }
-	}
-
-	if (LOG.isTraceEnabled()) LOG.trace("setPeerStatus" 
-					    + " peer count: " + sv_peer_count
-					    );
-	return;
-    }
-
-
-    public String getPeerStatus(int    pv_cluster_id)
-    {
-
-	if (LOG.isTraceEnabled()) LOG.trace("getPeerStatus" 
-					    + " cluster id: " + pv_cluster_id
-					    );
-
-	PeerInfo lv_pi = getPeerInfo(pv_cluster_id);
-	if (lv_pi != null) {
-	    return lv_pi.get_status();
-	}
-	return "";
-    }
-    public int getPeerCount() 
-    {
-	return sv_peer_count;
-    }
-
-    public Configuration getPeerConfiguration(int pv_cluster_id, boolean pv_STR_should_be_up) 
-    {
-	if (pv_STR_should_be_up) {
-	    PeerInfo lv_pi = getPeerInfo(pv_cluster_id);
-	    if (lv_pi == null) {
-		return null;
-	    }
-	    if (! lv_pi.isSTRUp()) {
-		return null;
-	    }
-	} 
-
-	return peer_configs.get(pv_cluster_id);
-    }
-
-    public Configuration getPeerConfiguration(int pv_cluster_id) 
-    {
-	boolean lv_STR_should_be_up_flag;
-	
-	lv_STR_should_be_up_flag = true;
-	if (pv_cluster_id == 0) {
-	    lv_STR_should_be_up_flag = false;
-	}
-	
-	return getPeerConfiguration(pv_cluster_id, lv_STR_should_be_up_flag);
-    }
-
-    public Map<Integer, Configuration> getPeerConfigurations() 
-    {
-	return peer_configs;
-    }
-
-    public HConnection getPeerConnection(int pv_peer_id) 
-    {
-	return peer_connections.get(pv_peer_id);
-    }
-
-    public Map<Integer, HConnection> getPeerConnections() 
-    {
-	return peer_connections;
-    }
-
-    public Map<Integer, PeerInfo> getPeerInfos() 
-    {
-	return peer_info_list;
-    }
-
-    public String getMyClusterId() 
-    {
-	return sv_my_cluster_id;
-    }
-
-    public int getMyClusterIdInt() 
-    {
-	return Integer.parseInt(sv_my_cluster_id);
-    }
-
-    public static void setTrafodionNodeCount() 
-    {
-	String lv_trafodion_node_count_string = System.getenv("TRAFODION_NODE_COUNT");
-	if (lv_trafodion_node_count_string != null) {
-	    sv_trafodion_node_count = Integer.parseInt(lv_trafodion_node_count_string);
-	}
-	else {
-	    sv_trafodion_node_count = 0;
-	}
-	LOG.info("TRAFODION_NODE_COUNT = " + sv_trafodion_node_count);
-    }
-
-    public int getTrafodionNodeCount() 
-    {
-	return sv_trafodion_node_count;
-    }
-
-    // getInstance to return the singleton object for TransactionManager
-    public synchronized static STRConfig getInstance(final Configuration conf) 
-	throws 	IOException, InterruptedException, KeeperException, ZooKeeperConnectionException 
-    {
-	if (s_STRConfig == null) {
-	
-	    s_STRConfig = new STRConfig(conf);
-	}
-	return s_STRConfig;
-    }
-
-    /**
-     * @param conf
-     * @throws ZooKeeperConnectionException
-     */
-    private STRConfig(final Configuration conf) 
-	throws InterruptedException, KeeperException, ZooKeeperConnectionException, IOException 
-    
-    {
-	setTrafodionNodeCount();
-	
-	initClusterConfigsZK(conf);
-
-	if (sv_dc_zk != null) {
-	    sv_dc_zk.watch_all();
-	    XDCStatusWatcher lv_pw = new XDCStatusWatcher(sv_dc_zk.getZKW());
-	    lv_pw.setDCZK(sv_dc_zk);
-	    lv_pw.setSTRConfig(this);
-	    sv_dc_zk.register_status_listener(lv_pw);
-	}
-    }
-
-    public String toString() 
-    {
-	StringBuilder lv_sb = new StringBuilder();
-	String lv_str;
-	lv_str = "Number of peers: " + sv_peer_count;
-	lv_sb.append(lv_str);
-	for ( Map.Entry<Integer, Configuration> e : peer_configs.entrySet() ) {
-	    lv_str = "\n======\nID: " + e.getKey() + "\n";
-	    lv_sb.append(lv_str);
-	    lv_str = ZK_QUORUM + ": " + e.getValue().get(ZK_QUORUM);
-	    lv_sb.append(lv_str);
-	    lv_str = ZK_PORT + ": " + e.getValue().get(ZK_PORT);
-	    lv_sb.append(lv_str);
-	}
-
-	return lv_sb.toString();
-    }
-
-    public static void main(String[] args) {
-	STRConfig pSTRConfig = null;
-	Configuration lv_config = HBaseConfiguration.create();
-	try {
-	    pSTRConfig = STRConfig.getInstance(lv_config);
-	}
-	catch (InterruptedException int_exception) {
-	    System.out.println("Interrupted Exception trying to get STRConfig instance: " + int_exception);
-	}
-	catch (IOException ioe) {
-	    System.out.println("IO Exception trying to get STRConfig instance: " + ioe);
-	}
-	catch (KeeperException kpe) {
-	    System.out.println("Keeper Exception trying to get STRConfig instance: " + kpe);
-	}
-	
-	System.out.println(pSTRConfig);
-    }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/XDCStatusWatcher.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/XDCStatusWatcher.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/XDCStatusWatcher.java
deleted file mode 100644
index c34e507..0000000
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/XDCStatusWatcher.java
+++ /dev/null
@@ -1,207 +0,0 @@
-// @@@ 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 @@@
-
-package org.apache.hadoop.hbase.client.transactional;
-
-import java.io.IOException;
-
-import java.nio.charset.Charset;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.hadoop.hbase.Abortable;
-import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.ServerName;
-
-import org.apache.hadoop.hbase.*;
-import org.apache.hadoop.hbase.client.*;
-
-import org.apache.hadoop.hbase.client.transactional.STRConfig;
-
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.CreateMode;
-
-import org.apache.hadoop.hbase.client.transactional.PeerInfo;
-import org.apache.hadoop.hbase.client.transactional.HBaseDCZK;
-
-/**
- * Watcher used to follow the creation and deletion of peer clusters.
- */
-public class XDCStatusWatcher extends ZooKeeperListener {
-
-    static final Log LOG = LogFactory.getLog(XDCStatusWatcher.class);
-
-    private HBaseDCZK m_zk;
-    private STRConfig m_str;
-
-    /**
-     * Construct a ZooKeeper event listener.
-     */
-    public XDCStatusWatcher(ZooKeeperWatcher pv_watcher) 
-    {
-	super(pv_watcher);
-    }
-
-    public void setDCZK(HBaseDCZK pv_zk) 
-    {
-	m_zk = pv_zk;
-    }
-
-    public void setSTRConfig(STRConfig pv_str)
-    {
-	m_str = pv_str;
-    }
-
-    /**
-     * Called when a node has been deleted
-     * @param path full path of the deleted node
-     */
-    public void nodeDeleted(String path) {
-	if (LOG.isInfoEnabled()) LOG.info(path + " znode deleted");
-	try {
-	    if (m_zk != null) m_zk.watch_all();
-	}
-	catch (Exception e)
-	    {
-		LOG.error("Exception raised by watch_all: " + e);
-	    }
-    }
-
-    public PeerInfo getPeerInfo(String path)
-    {
-	if (LOG.isTraceEnabled()) LOG.trace("getPeerInfo: "
-					  + path
-					  );
-	if ( ! path.startsWith(HBaseDCZK.m_clusters_node)) {
-	    return null;
-	}
-
-	String[] lv_elements = path.split("/");
-	int lv_length = lv_elements.length;
-	if (LOG.isTraceEnabled()) LOG.trace("Number of elements:" + lv_length);
-
-	if (lv_length <= 1) {
-	    return null;
-	}
-
-	int lv_id_index = lv_length - 2;
-	String lv_id = lv_elements[lv_id_index];
-	if (LOG.isTraceEnabled()) LOG.trace("Node element[" + lv_id_index + "]: " + lv_id);
-	try {
-	    PeerInfo lv_pi = m_zk.get_peer_znode(lv_id);
-	    if (lv_pi != null) {
-		if (LOG.isInfoEnabled()) LOG.info("Peer info: " + lv_pi);
-		return lv_pi;
-	    }
-	}
-	catch (Exception e)
-	    {
-		LOG.error("Exception raised by get_peer_znode: " + e);
-	    }
-
-	return null;
-    }
-
-    void updateSTRConfig(PeerInfo pv_pi)
-    {
-	if (LOG.isInfoEnabled()) LOG.info("updateSTRConfig: PeerInfo: "
-					  + ((pv_pi != null) ? pv_pi :"")
-					  );
-	if (m_str == null) {
-	    if (LOG.isInfoEnabled()) LOG.info("updateSTRConfig: STRConfig is null");
-	    return;
-	}
-
-	if (pv_pi == null) {
-	    return;
-	}
-
-	String lv_id = pv_pi.get_id();
-	if (lv_id == null) {
-	    return;
-	}
-
-	int lv_integer_id = Integer.parseInt(lv_id);
-	m_str.setPeerStatus(lv_integer_id,
-			    pv_pi.get_status());
-
-    }
-
-    /**
-     * Called when an existing node has changed data.
-     * @param path full path of the updated node
-     */
-    public void nodeDataChanged(String path) {
-
-	LOG.info(path + " znode changed");
-
-	try {
-	    if (m_zk != null) m_zk.watch_all();
-	}
-	catch (Exception e)
-	    {
-		LOG.error("Exception raised by watch_all: " + e);
-	    }
-
-	if (m_zk != null) {
-	    PeerInfo lv_pi = getPeerInfo(path);
-	    if (lv_pi == null) {
-		return;
-	    }
-
-	    updateSTRConfig(lv_pi);
-		
-	}
-    }
-
-    /**
-     * Called when an existing node has a child node added or removed.
-     * @param path full path of the node whose children have changed
-     */
-    public void nodeChildrenChanged(String path) {
-
-	try {
-	    if (m_zk != null) m_zk.watch_all();
-	}
-	catch (Exception e)
-	    {
-		LOG.error("Exception raised by watch_all: " + e);
-	    }
-
-	if (LOG.isInfoEnabled()) LOG.info(path + " znode children changed");
-	
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
index 476f761..9c14965 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
@@ -107,7 +107,6 @@ import org.apache.hadoop.hbase.client.transactional.OutOfOrderProtocolException;
 import org.apache.hadoop.hbase.client.transactional.UnknownTransactionException;
 import org.apache.hadoop.hbase.client.transactional.BatchException;
 import org.apache.hadoop.hbase.client.transactional.TransState;
-import org.apache.hadoop.hbase.client.transactional.STRConfig;
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
@@ -419,7 +418,6 @@ CoprocessorService, Coprocessor {
   public static final String trxkeyEPCPinstance = "EPCPinstance";
   // TBD Maybe we should just use HashMap to improve the performance, ConcurrentHashMap could be too strict
   static ConcurrentHashMap<String, Object> transactionsEPCPMap;
-  STRConfig pSTRConfig;
   // TrxRegionService methods
     
   @Override
@@ -2929,12 +2927,6 @@ CoprocessorService, Coprocessor {
 
       org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.RecoveryRequestResponse.Builder recoveryResponseBuilder = RecoveryRequestResponse.newBuilder();
 
-      try {
-          pSTRConfig = STRConfig.getInstance(config);
-      } catch (Exception xe) {
-          LOG.error("An ERROR occurred while getting the STR Configuration");
-      }
-
       List<Long> indoubtTransactions = new ArrayList<Long>();
       if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: recoveryRequest Trafodion Recovery: region " + regionInfo.getEncodedName() + " receives recovery request from TM " + tmId  + " with region state " + regionState);
       switch(regionState) {
@@ -2943,16 +2935,9 @@ CoprocessorService, Coprocessor {
                     if (LOG.isInfoEnabled()) LOG.info("TRAF RCOV:recoveryRequest in region starting" + regionInfo.getEncodedName() + " has in-doubt transaction " + indoubtTransactionsById.size());
                     for (Entry<Long, List<WALEdit>> entry : indoubtTransactionsById.entrySet()) {
                           long tid = entry.getKey();
-                          int clusterid = (int) TransactionState.getClusterId(tid);
-                          int nodeid = (int) TransactionState.getNodeId(tid);
-
-                          boolean add = false;
-                          if ((clusterid == 0 || (clusterid == pSTRConfig.getMyClusterIdInt())) && nodeid == tmId) add = true; // match local TM
-                          else if (((clusterid != pSTRConfig.getMyClusterIdInt()) && clusterid != 0) && tmId == -2) add = true; // for any peer
-                        
-                          if (add) {
+                          if ((int) (tid >> 32) == tmId) {
                               indoubtTransactions.add(tid);
-                              if (LOG.isInfoEnabled()) LOG.info("TrxRegionEndpoint coprocessor: recoveryRequest - txId " + transactionId + ", Trafodion Recovery: region " + regionInfo.getEncodedName() + " in-doubt transaction " + tid + " has been added into the recovery reply to Cluster " + clusterid + " Node " + nodeid + " TM " + tmId + " during recovery ");
+                              if (LOG.isInfoEnabled()) LOG.info("TrxRegionEndpoint coprocessor: recoveryRequest - txId " + transactionId + ", Trafodion Recovery: region " + regionInfo.getEncodedName() + " in-doubt transaction " + tid + " has been added into the recovery reply to TM " + tmId + " during recovery ");
                           }
                      }
                      if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: recoveryRequest " + indoubtTransactions.size());
@@ -2971,22 +2956,10 @@ CoprocessorService, Coprocessor {
                      if (LOG.isInfoEnabled()) LOG.info("TRAF RCOV:recoveryRequest in region started" + regionInfo.getEncodedName() + " has in-doubt transaction " + commitPendingCopy.size());
                      for (TrxTransactionState commitPendingTS : commitPendingCopy) {
                          long tid = commitPendingTS.getTransactionId();
-                         int clusterid = (int) TransactionState.getClusterId(tid);
-                         int nodeid = (int) TransactionState.getNodeId(tid);
-
-                         boolean add = false;
-                         if (((clusterid == pSTRConfig.getMyClusterIdInt()) || clusterid == 0) && nodeid == tmId) add = true; // match local TM
-                         if (((clusterid != pSTRConfig.getMyClusterIdInt()) && clusterid != 0) && tmId == -2) add = true; // for any peer
-
-                         if (add) {
+                         if ((int) (tid >> 32) == tmId) {
                              indoubtTransactions.add(tid);
-                             if (LOG.isInfoEnabled()) {
-                                 LOG.info("TrxRegionEndpoint coprocessor: recoveryRequest - Trafodion Recovery: region "
-                                    + regionInfo.getEncodedName() + " in-doubt transaction " + tid
-                                    + " has been added into the recovery reply to Cluster " + clusterid + " Node "
-                                    + nodeid + " TM " + tmId + " during start ");
-                              }
-                          }                        
+                             if (LOG.isInfoEnabled()) LOG.info("TrxRegionEndpoint coprocessor: recoveryRequest - Trafodion Recovery: region " + regionInfo.getEncodedName() + " in-doubt transaction " + tid + " has been added into the recovery reply to TM " + tmId + " during start ");
+                         }
                      }
                      // now remove the ZK node after TM has initiated the ecovery request   
                     String lv_encoded = m_Region.getRegionInfo().getEncodedName();
@@ -3522,12 +3495,6 @@ CoprocessorService, Coprocessor {
 
     this.config = tmp_env.getConfiguration();
 
-    try {
-        pSTRConfig = STRConfig.getInstance(config);
-    } catch (Exception xe) {
-        LOG.error("An ERROR occurred while getting the STR Configuration");
-    }
-    
     synchronized (stoppableLock) {
       try {
         this.transactionLeaseTimeout = config.getInt(LEASE_CONF, MINIMUM_LEASE_TIME);
@@ -3925,7 +3892,7 @@ CoprocessorService, Coprocessor {
       List<Integer> staleBranchforTMId = new ArrayList<Integer>();
       List<TrxTransactionState> commitPendingCopy = new ArrayList<TrxTransactionState>(commitPendingTransactions);
       Map<Long, List<WALEdit>> indoubtTransactionsMap = new TreeMap<Long, List<WALEdit>>(indoubtTransactionsById);
-      int tmid, clusterid, tm;
+      int tmid, tm;
 
       // selected printout for CP
       long currentEpoch = controlPointEpoch.get();
@@ -3943,11 +3910,7 @@ CoprocessorService, Coprocessor {
                transactionId = entry.getKey();
                if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor:choreThreadDetectStaleTransactionBranch: indoubt branch Txn id "
                        + transactionId + " region info bytes " + new String(lv_byte_region_info));
-               clusterid = (int) TransactionState.getClusterId(transactionId);
-               tmid = (int) TransactionState.getNodeId(transactionId);
-               LOG.info("Traf Reco Thread detect stale branch tid " + transactionId + " cluster id " + clusterid + " node " + tmid + " PSTRConfig " + pSTRConfig.getMyClusterId());
-               if ((clusterid != pSTRConfig.getMyClusterIdInt()) && clusterid != 0) tmid = -2; // for any peer
-
+               tmid = (int) (transactionId >> 32);
                if (!staleBranchforTMId.contains(tmid)) {staleBranchforTMId.add(tmid);}
          }
       }
@@ -3957,11 +3920,7 @@ CoprocessorService, Coprocessor {
                transactionId = commitPendingTS.getTransactionId();
                if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor:choreThreadDetectStaleTransactionBranch: stale branch Txn id "
                   + transactionId + " region info bytes " + new String(lv_byte_region_info));
-               clusterid = (int) TransactionState.getClusterId(transactionId);
-               tmid = (int) TransactionState.getNodeId(transactionId);
-               LOG.info("Traf Reco Thread detect stale branch tid " + transactionId + " cluster id " + clusterid + " node " + tmid + " PSTRConfig " + pSTRConfig.getMyClusterId());
-               if ((clusterid != pSTRConfig.getMyClusterIdInt()) && clusterid != 0) tmid = -2; // for any peer
-
+               tmid = (int) (transactionId >> 32);
                if (!staleBranchforTMId.contains(tmid)) {staleBranchforTMId.add(tmid);}
             }
          }
@@ -4336,9 +4295,7 @@ CoprocessorService, Coprocessor {
     if (state.isReinstated()) {
       synchronized(indoubtTransactionsById) {
         indoubtTransactionsById.remove(state.getTransactionId());
-        int clusterid = (int) TransactionState.getClusterId(transactionId);
-        int tmid = (int) TransactionState.getNodeId(transactionId);
-        if ((clusterid != pSTRConfig.getMyClusterIdInt()) && (clusterid != 0)) tmid = -2; // for any peer
+        int tmid = (int) (transactionId >> 32);
         int count = 0;
         if (indoubtTransactionsCountByTmid.containsKey(tmid)) {
           count =  (int) indoubtTransactionsCountByTmid.get(tmid) - 1;
@@ -4891,9 +4848,8 @@ CoprocessorService, Coprocessor {
                        //throw exp;
                     }   
                     if (LOG.isTraceEnabled()) LOG.trace("TrxRegion endpoint CP: reconstruct transaction: rewrite to HLOG CR edit for transaction " + transactionId);
-		    int clusterid = (int) TransactionState.getClusterId(transactionId);
-		    int tmid = (int) TransactionState.getNodeId(transactionId);
-                    if (LOG.isTraceEnabled()) LOG.trace("TrxRegion endpoint CP " + regionInfo.getRegionNameAsString() + " reconstruct transaction " + transactionId + " for Cluster " + clusterid + " TM " + tmid);                    
+                    int tmid = (int) (transactionId >> 32);
+                    if (LOG.isTraceEnabled()) LOG.trace("TrxRegion endpoint CP " + regionInfo.getRegionNameAsString() + " reconstruct transaction " + transactionId + " for TM " + tmid);
              } // for all txns in indoubt transcation list
              } // not reconstruct indoubtes yet
              reconstructIndoubts = 1;
@@ -5492,9 +5448,7 @@ CoprocessorService, Coprocessor {
       synchronized(indoubtTransactionsById) {
         if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: Trafodion Recovery: abort reinstated indoubt transactions " + transactionId);
         indoubtTransactionsById.remove(state.getTransactionId());
-        int clusterid = (int) TransactionState.getClusterId(transactionId);
-        int tmid = (int) TransactionState.getNodeId(transactionId);
-        if ((clusterid != pSTRConfig.getMyClusterIdInt()) && (clusterid != 0)) tmid = -2; // for any peer
+        int tmid = (int) (transactionId >> 32);
         int count = 0;
 
         // indoubtTransactionsCountByTmid protected by 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java.tmpl
index aa27db4..7de9391 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionObserver.java.tmpl
@@ -63,7 +63,6 @@ import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
 import org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegionScannerHolder;
 import org.apache.hadoop.hbase.regionserver.transactional.TrxTransactionState;
 import org.apache.hadoop.hbase.regionserver.transactional.TransactionState;
-import org.apache.hadoop.hbase.client.transactional.STRConfig;
 import org.apache.hadoop.hbase.wal.WAL;
 //import org.apache.hadoop.hbase.regionserver.wal.HLog;
 import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
@@ -178,7 +177,6 @@ private static ZooKeeperWatcher zkw1 = null;
 private static Object zkRecoveryCheckLock = new Object();
 
 SplitBalanceHelper sbHelper;
-STRConfig pSTRConfig;
 // Region Observer Coprocessor START
 @Override
 public void start(CoprocessorEnvironment e) throws IOException {
@@ -538,35 +536,20 @@ public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) {
     //for each indoubt transaction from pendingTransactionsById, build related transaction state object and add it into required lists for endPoint
 
     //build a list of TMs for in-doubt transactions, -2 is used for all peer's transactions
-    try {
-         pSTRConfig = STRConfig.getInstance(my_config);
-    } catch (Exception xe) {
-            LOG.error("An ERROR occurred while getting the STR Configuration");
-    }
     for (Entry<Long, List<WALEdit>> entry : pendingTransactionsById.entrySet()) {
         synchronized (recoveryCheckLock) {
                       long transactionId = entry.getKey();
 		      String key = String.valueOf(transactionId);
                       if ((m_isTrafodionMetadata) || LOG.isTraceEnabled()) LOG.info("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " process in-doubt transaction " + transactionId);
-
-                      int clusterid = (int) TransactionState.getClusterId(transactionId);
-                      int tmid = (int) TransactionState.getNodeId(transactionId);
+                      int tmid = (int) (transactionId >> 32);
                       int count = 1;
-                      if ((m_isTrafodionMetadata) || LOG.isTraceEnabled()) LOG.info("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " add prepared " + transactionId + " to TM " + tmid);
-                      if ((clusterid == 0) || (clusterid == pSTRConfig.getMyClusterIdInt())) {                      
-                          if ((m_isTrafodionMetadata) || LOG.isTraceEnabled()) LOG.info("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " add local prepared " + transactionId);
-                      }
-                      else {
-                           tmid = -2; // peer transactions is always sent to -1 ZK, which LDTM peer recovery thread will pick up
-			   if ((m_isTrafodionMetadata) || (LOG.isTraceEnabled())) 
-			       LOG.info("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() 
-					+ " add peer prepared " + transactionId);
-                      }
+                      if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " add prepared " + transactionId + " to TM " + tmid);
                       if (indoubtTransactionsCountByTmid.containsKey(tmid))
                             count =  (int) indoubtTransactionsCountByTmid.get(tmid) + 1;
 
                       indoubtTransactionsCountByTmid.put(tmid, count);
-                      if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " has " + count + " in-doubt-transaction from TM " + tmid);
+                      if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery Region Observer CP: Region " + regionInfo.getRegionNameAsString() + " has " + count +
+                                                    " in-doubt-transaction from TM " + tmid);
 
                       //TBD may need to write the LOG again for reinstated txn (redo does not generate edits)
                       //since after open, HBase may toss out split-log while there are indoubt list in memory

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sql/pom.xml.apache
----------------------------------------------------------------------
diff --git a/core/sql/pom.xml.apache b/core/sql/pom.xml.apache
index c3f9907..6500b66 100644
--- a/core/sql/pom.xml.apache
+++ b/core/sql/pom.xml.apache
@@ -39,8 +39,21 @@
 
   <build>
     <defaultGoal>package</defaultGoal>
-      <outputDirectory>${project.build.directory}/classes_${hbase-flavor-id}</outputDirectory>
-      <finalName>${project.artifactId}-${project.version}</finalName>
+    <outputDirectory>${project.build.directory}/classes_${hbase-flavor-id}</outputDirectory>
+    <finalName>${project.artifactId}-${project.version}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>
+              src/main/resources/trafodion-sql.jar.mf
+            </manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
   </build>
 
   <dependencies>
@@ -112,7 +125,7 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>trafodion-sql-apache1_0_2</artifactId>
   <version>${env.TRAFODION_VER}</version>
-  <name>trafodion-sql</name>
+  <name>trafodion-sql-apache1_0_2</name>
   <description>Java code for SQL engine in Trafodion</description>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/28460bd8/core/sql/pom.xml.hdp
----------------------------------------------------------------------
diff --git a/core/sql/pom.xml.hdp b/core/sql/pom.xml.hdp
index b7e78cf..8a28586 100644
--- a/core/sql/pom.xml.hdp
+++ b/core/sql/pom.xml.hdp
@@ -39,10 +39,22 @@
   
   <build>
     <defaultGoal>package</defaultGoal>
-      <outputDirectory>${project.build.directory}/classes_${hbase-flavor-id}</outputDirectory>
-      <finalName>${project.artifactId}-${project.version}</finalName>
-  </build>
-  
+    <outputDirectory>${project.build.directory}/classes_${hbase-flavor-id}</outputDirectory>
+    <finalName>${project.artifactId}-${project.version}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>
+              src/main/resources/trafodion-sql.jar.mf
+            </manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build> 
   <dependencies>
     <dependency>
       <groupId>org.apache.hbase</groupId>
@@ -95,5 +107,4 @@
   <name>trafodion-sql</name>
   <description>Java code for SQL engine in Trafodion</description>
 
-  
 </project>


[47/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
update


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

Branch: refs/heads/master
Commit: ead1b40a9b17ea59bc2cc57ea50213ecb3e63e16
Parents: c86d238 f34fceb
Author: mashengchen <ma...@gmail.com>
Authored: Mon Mar 28 09:03:27 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Mon Mar 28 09:03:27 2016 +0000

----------------------------------------------------------------------

----------------------------------------------------------------------



[06/50] [abbrv] incubator-trafodion git commit: remove duplicate copyright & roll back some change

Posted by db...@apache.org.
remove duplicate copyright & roll back some change


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

Branch: refs/heads/master
Commit: 73c164b78d682aae95a2132f62d97385b5e27b08
Parents: 28460bd
Author: mashengchen <ma...@gmail.com>
Authored: Fri Mar 4 03:05:31 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Fri Mar 4 03:05:31 2016 +0000

----------------------------------------------------------------------
 .../backuprestore/TrafExportSnapshot.java       |  7 +------
 core/sqf/sqenvcom.sh                            |  4 ++++
 core/sqf/sql/scripts/install_local_hadoop       | 18 +++++------------
 .../SsccTransactionalScanner.java.tmpl          | 21 --------------------
 .../CleanOldTransactionsChore.java.tmpl         | 10 ----------
 .../transactional/MemoryUsageChore.java.tmpl    | 10 ----------
 .../transactional/TrxTransactionState.java.tmpl | 10 ----------
 7 files changed, 10 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java
----------------------------------------------------------------------
diff --git a/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java b/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java
index 7fa8fed..3abf8ac 100644
--- a/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java
+++ b/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java
@@ -119,10 +119,7 @@ public class TrafExportSnapshot extends Configured implements Tool {
   private static final String INPUT_FOLDER_PREFIX = "export-files.";
 
   // Export Map-Reduce Counters, to keep track of the progress
-  public enum Counter {
-    MISSING_FILES, FILES_COPIED, FILES_SKIPPED, COPY_FAILED,
-    BYTES_EXPECTED, BYTES_SKIPPED, BYTES_COPIED
-  }
+  public enum Counter { MISSING_FILES, COPY_FAILED, BYTES_EXPECTED, BYTES_COPIED, FILES_COPIED };
 
   private static class ExportMapper extends Mapper<BytesWritable, NullWritable,
                                                    NullWritable, NullWritable> {
@@ -263,8 +260,6 @@ public class TrafExportSnapshot extends Configured implements Tool {
         FileStatus outputStat = outputFs.getFileStatus(outputPath);
         if (outputStat != null && sameFile(inputStat, outputStat)) {
           LOG.info("Skip copy " + inputStat.getPath() + " to " + outputPath + ", same file.");
-          context.getCounter(Counter.FILES_SKIPPED).increment(1);
-          context.getCounter(Counter.BYTES_SKIPPED).increment(inputStat.getLen());
           return;
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index b1b5231..5555bc6 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -345,6 +345,8 @@ elif [[ -n "$(ls /usr/lib/hadoop/hadoop-*cdh*.jar 2>/dev/null)" ]]; then
   export CURL_INC_DIR=/usr/include
   export CURL_LIB_DIR=/usr/lib64
 
+  lv_hbase_cp=`hbase classpath`
+
   # directories with jar files and list of jar files
   # (could try to reduce the number of jars in the classpath)
   export HADOOP_JAR_DIRS="/usr/lib/hadoop
@@ -390,6 +392,8 @@ elif [[ -n "$(ls /etc/init.d/ambari* 2>/dev/null)" ]]; then
   export CURL_INC_DIR=/usr/include
   export CURL_LIB_DIR=/usr/lib64
 
+  lv_hbase_cp=`hbase classpath`
+
   # directories with jar files and list of jar files
   export HADOOP_JAR_DIRS="/usr/hdp/current/hadoop-client
                           /usr/hdp/current/hadoop-client/lib"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_local_hadoop b/core/sqf/sql/scripts/install_local_hadoop
index 6f5daaf..2c10839 100755
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@ -391,19 +391,7 @@ else
     MY_START_PORT=`expr 24000 + $MY_START_PORT '*' 200`
   elif [ $MY_START_PORT == "rand" ]; then
     # pick a random number between 12000 and 24000 that is divisible by 200
-    lv_number=0   #initialize
-    FLOOR=10000
-    RANGE=31200
-    while [ "$lv_number" -le $FLOOR ]
-    do
-	lv_number=$RANDOM
-	let "lv_number %= $RANGE"  # Scales $lv_number down within $RANGE.
-    done
-    echo "Random lv_number between $FLOOR and $RANGE ---  $lv_number"
-    echo
-    let "lv_remainder=$lv_number % 200"
-    let "MY_START_PORT=$lv_number - $lv_remainder"
-    echo "Start Port ---  $MY_START_PORT"
+    MY_START_PORT=`expr $RANDOM '%' 60 '*' 200 + 12000`
   elif [ $MY_START_PORT == "available" ]; then
 
      portMsg=`python findPort.py`
@@ -621,6 +609,10 @@ if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
     HIVE_TAR=${HIVE_PREFIX}.tar.gz
 fi
 
+if [[ "$HBASE_DISTRO" = "HDP" ]]; then
+    HIVE_PREFIX=apache-hive-1.2.1.2.3.2.0-2950-bin
+    HIVE_TAR=${HIVE_PREFIX}.tar.gz
+fi
 
 HBASE_MIRROR_URL=http://archive.cloudera.com/cdh5/cdh/5
 HBASE_TAR=hbase-1.0.0-cdh5.4.4.tar.gz

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java.tmpl
index 72c5666..a2fa801 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/SsccTransactionalScanner.java.tmpl
@@ -21,27 +21,6 @@
 * @@@ END COPYRIGHT @@@
 **/
 
-// @@@ 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 @@@
-
 package org.apache.hadoop.hbase.client.transactional;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java.tmpl
index 4507f66..6e81a8a 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/CleanOldTransactionsChore.java.tmpl
@@ -21,16 +21,6 @@
 * @@@ END COPYRIGHT @@@
 **/
 
-/**
- * Copyright 2009 The Apache Software Foundation 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.
- */
 package org.apache.hadoop.hbase.regionserver.transactional;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java.tmpl
index 512b5d1..07c66ef 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/MemoryUsageChore.java.tmpl
@@ -21,16 +21,6 @@
 * @@@ END COPYRIGHT @@@
 **/
 
-/**
- * Copyright 2015 The Apache Software Foundation 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.
- */
 package org.apache.hadoop.hbase.regionserver.transactional;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/73c164b7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
index 13974ac..6994745 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
@@ -21,16 +21,6 @@
 * @@@ END COPYRIGHT @@@
 **/
 
-/**
- * Copyright 2009 The Apache Software Foundation 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.
- */
 package org.apache.hadoop.hbase.regionserver.transactional;
 
 import java.io.IOException;


[08/50] [abbrv] incubator-trafodion git commit: remove support hdp2_3

Posted by db...@apache.org.
remove support hdp2_3


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

Branch: refs/heads/master
Commit: 71f80f6e7e6f4c8364cabaa0817e983ba695156e
Parents: f1c7f3a
Author: mashengchen <ma...@gmail.com>
Authored: Mon Mar 7 09:52:34 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Mon Mar 7 09:52:34 2016 +0000

----------------------------------------------------------------------
 core/sqf/conf/install_features                  |  1 -
 core/sqf/hbase_utilities/pom.xml                |  2 +-
 core/sqf/sqenvcom.sh                            | 42 +++++++++++++-------
 core/sqf/sql/scripts/install_local_hadoop       | 32 +++++++--------
 core/sqf/src/seatrans/hbase-trx/pom.xml.apache  |  2 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.cdh     |  2 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.hdp     |  4 +-
 core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml    |  4 +-
 .../src/seatrans/tm/hbasetmlib2/pom.xml.apache  |  4 +-
 .../sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp |  4 +-
 core/sql/pom.xml                                |  6 +--
 core/sql/pom.xml.apache                         |  8 ++--
 core/sql/pom.xml.hdp                            |  9 +++--
 13 files changed, 63 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/conf/install_features
----------------------------------------------------------------------
diff --git a/core/sqf/conf/install_features b/core/sqf/conf/install_features
index b5d3470..15a1789 100644
--- a/core/sqf/conf/install_features
+++ b/core/sqf/conf/install_features
@@ -63,4 +63,3 @@
 # perform some additional support for this.
 export CDH_5_3_HDP_2_2_SUPPORT="N"
 export CDH_5_4_SUPPORT="Y"
-export HDP_2_3_SUPPORT="Y"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/hbase_utilities/pom.xml
----------------------------------------------------------------------
diff --git a/core/sqf/hbase_utilities/pom.xml b/core/sqf/hbase_utilities/pom.xml
index c7081e4..e0c7a74 100644
--- a/core/sqf/hbase_utilities/pom.xml
+++ b/core/sqf/hbase_utilities/pom.xml
@@ -29,7 +29,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.6.0</hadoop.version>
-    <hbase.version>${env.HBASE_DEP_VER}</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_CDH}</hbase.version>
     <java.version>1.7</java.version>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 34d4f7a..6c96ef4 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -139,29 +139,41 @@ fi
 export MY_SQROOT=$PWD
 export SQ_HOME=$PWD
 
+# set common version to be consistent between shared lib and maven dependencies
+export HBASE_DEP_VER_CDH=1.0.0-cdh5.4.4
+export HIVE_DEP_VER_CDH=1.1.0-cdh5.4.4
+export HBASE_DEP_VER_HDP=1.1.2.2.3.2.0-2950
+export HIVE_DEP_VER_HDP=1.2.1.2.3.2.0-2950
+export HBASE_DEP_VER_APACHE=1.0.2
+export HIVE_DEP_VER_APACHE=1.1.0
+export THRIFT_DEP_VER=0.9.0
+export HBASE_TRX_ID_CDH=hbase-trx-cdh5_4
+export HBASE_TRX_ID_APACHE=hbase-trx-apache1_0_2
+export HBASE_TRX_ID_HDP=hbase-trx-hdp2_3
+
 # general Hadoop & TRX dependencies - not distro specific, choose one to build against
 export HBASE_TRXDIR=$MY_SQROOT/export/lib
-export HBASE_TRX_ID=hbase-trx-cdh5_4
-export HBASE_DEP_VER=hbase-1.0.0-cdh5.4.4.tar.gz
-export HBASE_TRX_JAR=${HBASE_TRX_ID}-${TRAFODION_VER}.jar
+export HBASE_TRX_JAR=${HBASE_TRX_ID_CDH}-${TRAFODION_VER}.jar
+if [[ "$HBASE_DISTRO" = "HDP" ]]; then
+    export HBASE_TRX_JAR=${HBASE_TRX_ID_HDP}-${TRAFODION_VER}.jar
+fi
+if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
+    export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
+fi
 export DTM_COMMON_JAR=trafodion-dtm-${TRAFODION_VER}.jar
 export SQL_JAR=trafodion-sql-${TRAFODION_VER}.jar
-export UTIL_JAR=trafodion-utility-${TRAFODION_VER}.jar
+HBVER=""
 if [[ "$HBASE_DISTRO" = "HDP" ]]; then
-    export HBASE_VERSION_ID=hdp2_3
-    export HBASE_TRX_JAR=hbase-trx-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
-    export DTM_COMMON_JAR=trafodion-dtm-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
-    export SQL_JAR=trafodion-sql-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
+    HBVER="hdp2_3"
+    export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
+    export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
 if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
-    export HBASE_VERSION_ID=apache1_0_2
-    export HBASE_TRX_JAR=hbase-trx-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
-    export DTM_COMMON_JAR=trafodion-dtm-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
-    export SQL_JAR=trafodion-sql-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
+    HBVER="apache1_0_2"
+    export DTM_COMMON_JAR=trafodion-dtm-${HBVER}-${TRAFODION_VER}.jar
+    export SQL_JAR=trafodion-sql-${HBVER}-${TRAFODION_VER}.jar
 fi
-# set common version to be consistent between shared lib and maven dependencies
-export THRIFT_DEP_VER=0.9.0
-export HIVE_DEP_VER=0.13.1
+export UTIL_JAR=trafodion-utility-${TRAFODION_VER}.jar
 
 # check for workstation env
 # want to make sure SQ_VIRTUAL_NODES is set in the shell running sqstart

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_local_hadoop b/core/sqf/sql/scripts/install_local_hadoop
index e0081c2..4cc74c4 100755
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@ -601,28 +601,24 @@ MYSQL_JDBC_URL=http://cdn.mysql.com/archives/mysql-connector-java-5.1
 MYSQL_JDBC_TAR=mysql-connector-java-5.1.23.tar.gz
 
 HIVE_MIRROR_URL=http://archive.cloudera.com/cdh5/cdh/5
-HIVE_PREFIX=hive-1.1.0-cdh5.4.4
-HIVE_TAR=${HIVE_PREFIX}.tar.gz
-
+HIVE_PREFIX=hive-${HIVE_DEP_VER_CDH}
 if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
-    HIVE_MIRROR_URL=https://archive.apache.org/dist/hive/hive-${HIVE_DEP_VER}
-    HIVE_PREFIX=apache-hive-${HIVE_DEP_VER}-bin
-    HIVE_TAR=${HIVE_PREFIX}.tar.gz
+    HIVE_MIRROR_URL=https://archive.apache.org/dist/hive/hive-${HIVE_DEP_VER_APACHE}
+    HIVE_PREFIX=apache-hive-${HIVE_DEP_VER_APACHE}-bin
 fi
-
 if [[ "$HBASE_DISTRO" = "HDP" ]]; then
-    HIVE_PREFIX=apache-hive-1.2.1.2.3.2.0-2950-bin
-    HIVE_TAR=${HIVE_PREFIX}.tar.gz
+    HIVE_PREFIX=apache-hive-${HIVE_DEP_VER_HDP}-bin
 fi
+HIVE_TAR=${HIVE_PREFIX}.tar.gz
 
 HBASE_MIRROR_URL=http://archive.cloudera.com/cdh5/cdh/5
-HBASE_TARR=hbase-${HBASE_DEP_VER}.tar.gz
-
+HBASE_TAR=hbase-${HBASE_DEP_VER_CDH}.tar.gz
 if [[ "$HBASE_DISTRO" = "HDP" ]]; then
-    HBASE_TAR=hbase-1.1.2.2.3.2.0-2950.tar.gz
+    HBASE_TAR=hbase-${HBASE_DEP_VER_HDP}.tar.gz
 fi
 if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
-    HBASE_TAR=hbase-1.0.2-bin.tar.gz
+    HBASE_MIRROR_URL=https://archive.apache.org/dist/hbase/hbase-${HBASE_DEP_VER_APACHE}
+    HBASE_TAR=hbase-${HBASE_DEP_VER_APACHE}-bin.tar.gz
 fi
 
 echo "Checking for existing Hadoop processes..."
@@ -1019,7 +1015,7 @@ if [ -d hadoop/bin ]; then
 else
   echo "Setting up Hadoop..."
   #####################################################
-
+echo "$MY_LOCAL_SW_DIST/${HADOOP_TAR}"
   if [ -f $MY_LOCAL_SW_DIST/${HADOOP_TAR} ]; then
     cp $MY_LOCAL_SW_DIST/${HADOOP_TAR} .
     echo "Copied Hadoop tar file from: $MY_LOCAL_SW_DIST/${HADOOP_TAR}" 
@@ -1239,7 +1235,7 @@ if [ -d mysql/bin ]; then
 else
   #####################################################
   echo "Setting up MySQL..."
-
+echo "$MY_LOCAL_SW_DIST/${MYSQL_TAR}"
   if [ -f $MY_LOCAL_SW_DIST/${MYSQL_TAR} ]; then
     cp $MY_LOCAL_SW_DIST/${MYSQL_TAR} .
     echo "Copied MySql tar file from: $MY_LOCAL_SW_DIST/${MYSQL_TAR}"
@@ -1318,7 +1314,7 @@ if [ -f mysql-connector-java-*/mysql-connector-java-*.jar ]; then
 else
   #####################################################
   echo "Setting up MySQL JDBC driver..."
-
+echo "$MY_LOCAL_SW_DIST/${MYSQL_JDBC_TAR}"
   if [ -f $MY_LOCAL_SW_DIST/${MYSQL_JDBC_TAR} ]; then
     cp $MY_LOCAL_SW_DIST/${MYSQL_JDBC_TAR} .
     echo "Copied MySql JDBC tar file from: $MY_LOCAL_SW_DIST/${MYSQL_JDBC_TAR}"
@@ -1344,7 +1340,7 @@ if [ -d hive/bin ]; then
 else
   #####################################################
   echo "Setting up Hive..."
-
+echo "$MY_LOCAL_SW_DIST/${HIVE_TAR}"
   if [ -f $MY_LOCAL_SW_DIST/${HIVE_TAR} ]; then
     cp $MY_LOCAL_SW_DIST/${HIVE_TAR} .
     echo "Copied Hive tar file from: $MY_LOCAL_SW_DIST/${HIVE_TAR}"
@@ -1472,7 +1468,7 @@ if [ -d hbase/bin ]; then
 else
   #####################################################
   echo "Setting up HBase..."
-
+echo "$MY_LOCAL_SW_DIST/${HBASE_TAR}"
   if [ -f $MY_LOCAL_SW_DIST/${HBASE_TAR} ]; then
     cp $MY_LOCAL_SW_DIST/${HBASE_TAR} .
     echo "Copied HBase tar file from: $MY_LOCAL_SW_DIST/${HBASE_TAR}"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/hbase-trx/pom.xml.apache
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/pom.xml.apache b/core/sqf/src/seatrans/hbase-trx/pom.xml.apache
index fc55593..250b7ae 100755
--- a/core/sqf/src/seatrans/hbase-trx/pom.xml.apache
+++ b/core/sqf/src/seatrans/hbase-trx/pom.xml.apache
@@ -29,7 +29,7 @@
 
   <properties>
     <hadoop.version>2.4.0</hadoop.version>
-    <hbase.version>1.0.2</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_APACHE}</hbase.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <protobuf.version>2.5.0</protobuf.version>                                                                                              
     <protocVersion>2.5.0</protocVersion>                                                                                                    

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/hbase-trx/pom.xml.cdh
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/pom.xml.cdh b/core/sqf/src/seatrans/hbase-trx/pom.xml.cdh
index 5b453de..57f458b 100755
--- a/core/sqf/src/seatrans/hbase-trx/pom.xml.cdh
+++ b/core/sqf/src/seatrans/hbase-trx/pom.xml.cdh
@@ -28,7 +28,7 @@
 
   <properties>
     <hadoop.version>2.6.0</hadoop.version>
-    <hbase.version>1.0.0-cdh5.4.4</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_CDH}</hbase.version>
     <protobuf.version>2.5.0</protobuf.version>
     <protocVersion>2.5.0</protocVersion>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/hbase-trx/pom.xml.hdp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/pom.xml.hdp b/core/sqf/src/seatrans/hbase-trx/pom.xml.hdp
index 1885931..045772c 100755
--- a/core/sqf/src/seatrans/hbase-trx/pom.xml.hdp
+++ b/core/sqf/src/seatrans/hbase-trx/pom.xml.hdp
@@ -50,9 +50,7 @@
 
   <properties>
     <hadoop.version>2.7.1.2.3.2.0-2950</hadoop.version>
-    <hbase.version>1.1.2.2.3.2.0-2950</hbase.version>
-    <!--<hbase.version>0.98.3-hadoop2</hbase.version>-->
-    <!--<hbase.version>0.98.3-hadoop1</hbase.version>-->
+    <hbase.version>${env.HBASE_DEP_VER_HDP}</hbase.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <java.version>1.7</java.version>
     <trx-suffix>hdp2_3</trx-suffix>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml
index af93afd..928229a 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml
@@ -28,8 +28,8 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <hbase.version>${env.HBASE_DEP_VER}</hbase.version>
-    <hbase-trx.id>${env.HBASE_TRX_ID}</hbase-trx.id>
+    <hbase.version>${env.HBASE_DEP_VER_CDH}</hbase.version>
+    <hbase-trx.id>${env.HBASE_TRX_ID_CDH}</hbase-trx.id>
     <java.version>1.7</java.version>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.apache
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.apache b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.apache
index 7b0a48b..ef305a9 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.apache
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.apache
@@ -29,9 +29,9 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.6.0</hadoop.version>
-    <hbase.version>1.0.2</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_APACHE}</hbase.version>
     <hbase-flavor-id>apache1_0_2</hbase-flavor-id>
-    <hbase-trx.id>hbase-trx-${hbase-flavor-id}</hbase-trx.id>
+    <hbase-trx.id>${env.HBASE_TRX_ID_APACHE}</hbase-trx.id>
     <java.version>1.7</java.version>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp
index 5142636..31f4a5a 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp
@@ -29,9 +29,9 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.7.1.2.3.2.0-2950</hadoop.version>
-    <hbase.version>1.1.2.2.3.2.0-2950</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_HDP}</hbase.version>
     <hbase-flavor-id>hdp2_3</hbase-flavor-id>
-    <hbase-trx.id>hbase-trx-${hbase-flavor-id}</hbase-trx.id>
+    <hbase-trx.id>${env.HBASE_TRX_ID_HDP}</hbase-trx.id>
     <java.version>1.7</java.version>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sql/pom.xml
----------------------------------------------------------------------
diff --git a/core/sql/pom.xml b/core/sql/pom.xml
index f96c38f..5c6b5c5 100644
--- a/core/sql/pom.xml
+++ b/core/sql/pom.xml
@@ -29,9 +29,9 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.6.0-cdh5.4.4</hadoop.version>
-    <hbase.version>${env.HBASE_DEP_VER}</hbase.version>
-    <hbase-trx.id>${env.HBASE_TRX_ID}</hbase-trx.id>
-    <hive.version>${env.HIVE_DEP_VER}</hive.version>
+    <hbase.version>${env.HBASE_DEP_VER_CDH}</hbase.version>
+    <hbase-trx.id>${env.HBASE_TRX_ID_CDH}</hbase-trx.id>
+    <hive.version>${env.HIVE_DEP_VER_CDH}</hive.version>
     <thrift.version>${env.THRIFT_DEP_VER}</thrift.version>
     <java.version>1.7</java.version>
   </properties>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sql/pom.xml.apache
----------------------------------------------------------------------
diff --git a/core/sql/pom.xml.apache b/core/sql/pom.xml.apache
index 6500b66..bc8e86f 100644
--- a/core/sql/pom.xml.apache
+++ b/core/sql/pom.xml.apache
@@ -29,11 +29,11 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.6.0</hadoop.version>
-    <hbase.version>1.0.2</hbase.version>
     <hbase-flavor-id>apache1_0_2</hbase-flavor-id>
-    <hbase-trx.id>hbase-trx-${hbase-flavor-id}</hbase-trx.id>
-    <hive.version>1.1.0</hive.version>
-    <thrift.version>0.9.0</thrift.version>
+    <hbase.version>${env.HBASE_DEP_VER_APACHE}</hbase.version>
+    <hbase-trx.id>${env.HBASE_TRX_ID_APACHE}</hbase-trx.id>
+    <hive.version>${env.HIVE_DEP_VER_APACHE}</hive.version>
+    <thrift.version>${THRIFT_DEP_VER}</thrift.version>
     <java.version>1.7</java.version>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/71f80f6e/core/sql/pom.xml.hdp
----------------------------------------------------------------------
diff --git a/core/sql/pom.xml.hdp b/core/sql/pom.xml.hdp
index 8a28586..fee21e4 100644
--- a/core/sql/pom.xml.hdp
+++ b/core/sql/pom.xml.hdp
@@ -29,10 +29,10 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <hadoop.version>2.7.1.2.3.2.0-2950</hadoop.version>
-    <hbase.version>1.1.2.2.3.2.0-2950</hbase.version>
+    <hbase.version>${env.HBASE_DEP_VER_HDP}</hbase.version>
+    <hbase-trx.id>${env.HBASE_TRX_ID_HDP}</hbase-trx.id>
+    <hive.version>${env.HIVE_DEP_VER_HDP}</hive.version>
     <hbase-flavor-id>hdp2_3</hbase-flavor-id>
-    <hbase-trx.id>hbase-trx-${hbase-flavor-id}</hbase-trx.id>
-    <hive.version>1.2.1</hive.version>
     <thrift.version>0.9.0</thrift.version>
     <java.version>1.7</java.version>
   </properties>
@@ -54,7 +54,8 @@
         </configuration>
       </plugin>
     </plugins>
-  </build> 
+  </build>
+ 
   <dependencies>
     <dependency>
       <groupId>org.apache.hbase</groupId>


[23/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED010
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED010 b/core/sql/regress/seabase/EXPECTED010
index 1253abb..c6f739f 100644
--- a/core/sql/regress/seabase/EXPECTED010
+++ b/core/sql/regress/seabase/EXPECTED010
@@ -55,19 +55,20 @@
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:24:52 2016
+-- Definition current  Tue Mar  8 05:44:04 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:24:53 2016
+-- Definition current  Tue Mar  8 05:44:04 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -80,12 +81,13 @@
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:24:53 2016
+-- Definition current  Tue Mar  8 05:44:04 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -93,6 +95,7 @@
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -215,7 +218,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885094893012
+PLAN_ID .................. 212324175846829763
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -258,7 +261,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977067
+  ObjectUIDs ............. 4560549616040773770
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -298,7 +301,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885094974287
+PLAN_ID .................. 212324175846906889
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -342,7 +345,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977067
+  ObjectUIDs ............. 4560549616040773770
   select_list ............ %(1), %('1')
   input_variables ........ %(1), %('1')
 
@@ -381,7 +384,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885095061744
+PLAN_ID .................. 212324175846969122
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -424,7 +427,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977067
+  ObjectUIDs ............. 4560549616040773770
   select_list ............ TRAFODION.SCH.T010T1.A, %('1')
   input_variables ........ %('1')
 
@@ -464,7 +467,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885093467820
+PLAN_ID .................. 212324175845471717
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a = 2;
@@ -508,7 +511,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977067
+  ObjectUIDs ............. 4560549616040773770
   select_list ............ %(2), TRAFODION.SCH.T010T1.B
   input_variables ........ %(2)
 
@@ -771,7 +774,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885096382137
+PLAN_ID .................. 212324175848182134
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -816,7 +819,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -850,7 +853,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885096449206
+PLAN_ID .................. 212324175848230338
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -896,7 +899,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -931,7 +934,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885096528149
+PLAN_ID .................. 212324175848288383
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -976,7 +979,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -1011,7 +1014,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885096610874
+PLAN_ID .................. 212324175848362739
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -1056,7 +1059,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   input_variables ........ %('a')
 
 
@@ -1120,7 +1123,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885096769866
+PLAN_ID .................. 212324175848523585
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -1167,7 +1170,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   input_variables ........ %('upd'), %(4)
 
 
@@ -1194,7 +1197,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885096839283
+PLAN_ID .................. 212324175848610087
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -1240,7 +1243,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -1274,7 +1277,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885096892358
+PLAN_ID .................. 212324175848664515
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -1321,7 +1324,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -1356,7 +1359,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885096964168
+PLAN_ID .................. 212324175848732834
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -1402,7 +1405,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -1437,7 +1440,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885097028060
+PLAN_ID .................. 212324175848803150
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -1483,7 +1486,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   input_variables ........ %('a')
 
 
@@ -1547,7 +1550,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885097193080
+PLAN_ID .................. 212324175848938512
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -1595,7 +1598,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177977162
+  ObjectUIDs ............. 4560549616040773848
   input_variables ........ %('uuu'), %(4)
 
 
@@ -1772,19 +1775,20 @@ _SALT_      A            B           C            D
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:25:15 2016
+-- Definition current  Tue Mar  8 05:44:33 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:25:15 2016
+-- Definition current  Tue Mar  8 05:44:33 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -1797,12 +1801,13 @@ _SALT_      A            B           C            D
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:25:15 2016
+-- Definition current  Tue Mar  8 05:44:33 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -1810,6 +1815,7 @@ _SALT_      A            B           C            D
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -1932,7 +1938,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885117562364
+PLAN_ID .................. 212324175874760960
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -1975,7 +1981,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979649
+  ObjectUIDs ............. 4560549616040776750
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -2015,7 +2021,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885117630076
+PLAN_ID .................. 212324175874820914
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -2059,7 +2065,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979649
+  ObjectUIDs ............. 4560549616040776750
   select_list ............ 1, '1'
 
 
@@ -2097,7 +2103,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885117688131
+PLAN_ID .................. 212324175874880851
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -2140,7 +2146,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979649
+  ObjectUIDs ............. 4560549616040776750
   select_list ............ TRAFODION.SCH.T010T1.A, '1'
 
 
@@ -2179,7 +2185,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885117743655
+PLAN_ID .................. 212324175874938755
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1;
@@ -2223,7 +2229,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979649
+  ObjectUIDs ............. 4560549616040776750
   select_list ............ 1, TRAFODION.SCH.T010T1.B
 
 
@@ -2485,7 +2491,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885119498869
+PLAN_ID .................. 212324175876688173
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -2530,7 +2536,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -2564,7 +2570,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885119535261
+PLAN_ID .................. 212324175876724288
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -2610,7 +2616,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -2657,7 +2663,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885119574822
+PLAN_ID .................. 212324175876780593
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -2702,7 +2708,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -2740,7 +2746,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885119613489
+PLAN_ID .................. 212324175876833674
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -2785,7 +2791,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -2852,7 +2858,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885119716625
+PLAN_ID .................. 212324175876909335
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -2899,7 +2905,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -2929,7 +2935,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885119793180
+PLAN_ID .................. 212324175876971746
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -2975,7 +2981,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -3010,7 +3016,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885119836459
+PLAN_ID .................. 212324175877010951
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -3057,7 +3063,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -3093,7 +3099,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885119870483
+PLAN_ID .................. 212324175877059861
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -3139,7 +3145,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -3175,7 +3181,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885119915606
+PLAN_ID .................. 212324175877104899
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -3221,7 +3227,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -3285,7 +3291,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885119998609
+PLAN_ID .................. 212324175877185429
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -3333,7 +3339,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177979769
+  ObjectUIDs ............. 4560549616040776809
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -3510,19 +3516,20 @@ _SALT_      A            B           C            D
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:25:37 2016
+-- Definition current  Tue Mar  8 05:44:59 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:25:37 2016
+-- Definition current  Tue Mar  8 05:44:59 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -3535,12 +3542,13 @@ _SALT_      A            B           C            D
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:25:37 2016
+-- Definition current  Tue Mar  8 05:44:59 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -3548,6 +3556,7 @@ _SALT_      A            B           C            D
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -3670,7 +3679,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885139456457
+PLAN_ID .................. 212324175901195506
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -3713,7 +3722,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981872
+  ObjectUIDs ............. 4560549616040779258
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -3753,7 +3762,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885139522620
+PLAN_ID .................. 212324175901265852
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -3797,7 +3806,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981872
+  ObjectUIDs ............. 4560549616040779258
   select_list ............ %(1), %('1')
   input_variables ........ %(1), %('1')
 
@@ -3836,7 +3845,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885139598890
+PLAN_ID .................. 212324175901340557
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -3879,7 +3888,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981872
+  ObjectUIDs ............. 4560549616040779258
   select_list ............ TRAFODION.SCH.T010T1.A, %('1')
   input_variables ........ %('1')
 
@@ -3919,7 +3928,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885138325650
+PLAN_ID .................. 212324175899984759
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a = 2;
@@ -3963,7 +3972,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981872
+  ObjectUIDs ............. 4560549616040779258
   select_list ............ %(2), TRAFODION.SCH.T010T1.B
   input_variables ........ %(2)
 
@@ -4226,7 +4235,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885141453521
+PLAN_ID .................. 212324175903165153
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4271,7 +4280,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -4306,7 +4315,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885141492306
+PLAN_ID .................. 212324175903203605
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4352,7 +4361,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -4388,7 +4397,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885141528792
+PLAN_ID .................. 212324175903242740
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4433,7 +4442,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -4469,7 +4478,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885141575489
+PLAN_ID .................. 212324175903283921
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -4514,7 +4523,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   input_variables ........ %('a')
 
 
@@ -4578,7 +4587,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885141664461
+PLAN_ID .................. 212324175903360153
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -4625,7 +4634,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   input_variables ........ %('upd'), %(4)
 
 
@@ -4652,7 +4661,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885141733289
+PLAN_ID .................. 212324175903436779
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4698,7 +4707,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -4733,7 +4742,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885141769945
+PLAN_ID .................. 212324175903476720
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4780,7 +4789,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -4816,7 +4825,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885141803748
+PLAN_ID .................. 212324175903512047
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select *
@@ -4862,7 +4871,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -4898,7 +4907,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885141846512
+PLAN_ID .................. 212324175903553526
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -4944,7 +4953,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   input_variables ........ %('a')
 
 
@@ -5008,7 +5017,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885141938820
+PLAN_ID .................. 212324175903632779
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -5056,7 +5065,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... OFF
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177981941
+  ObjectUIDs ............. 4560549616040779320
   input_variables ........ %('uuu'), %(4)
 
 
@@ -5233,19 +5242,20 @@ _SALT_      A            B           C            D
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:26:00 2016
+-- Definition current  Tue Mar  8 05:45:25 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:00 2016
+-- Definition current  Tue Mar  8 05:45:25 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -5258,12 +5268,13 @@ _SALT_      A            B           C            D
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:00 2016
+-- Definition current  Tue Mar  8 05:45:25 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -5271,6 +5282,7 @@ _SALT_      A            B           C            D
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -5393,7 +5405,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885161677240
+PLAN_ID .................. 212324175927123261
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -5436,7 +5448,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984042
+  ObjectUIDs ............. 4560549616040781936
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -5476,7 +5488,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885161745895
+PLAN_ID .................. 212324175927192763
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -5520,7 +5532,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984042
+  ObjectUIDs ............. 4560549616040781936
   select_list ............ 1, '1'
 
 
@@ -5558,7 +5570,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885161799613
+PLAN_ID .................. 212324175927251686
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -5601,7 +5613,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984042
+  ObjectUIDs ............. 4560549616040781936
   select_list ............ TRAFODION.SCH.T010T1.A, '1'
 
 
@@ -5640,7 +5652,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885161866012
+PLAN_ID .................. 212324175927312652
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1;
@@ -5684,7 +5696,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984042
+  ObjectUIDs ............. 4560549616040781936
   select_list ............ 1, TRAFODION.SCH.T010T1.B
 
 
@@ -5946,7 +5958,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885163649284
+PLAN_ID .................. 212324175928946210
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -5991,7 +6003,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -6024,7 +6036,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885163703104
+PLAN_ID .................. 212324175929005102
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -6070,7 +6082,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -6104,7 +6116,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885163762184
+PLAN_ID .................. 212324175929068640
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -6149,7 +6161,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -6183,7 +6195,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885163841840
+PLAN_ID .................. 212324175929139799
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -6228,7 +6240,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -6291,7 +6303,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885164005046
+PLAN_ID .................. 212324175929266354
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -6338,7 +6350,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... OFF
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -6368,7 +6380,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885164071839
+PLAN_ID .................. 212324175929346869
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -6414,7 +6426,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -6447,7 +6459,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885164141735
+PLAN_ID .................. 212324175929409191
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -6494,7 +6506,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -6528,7 +6540,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885164217816
+PLAN_ID .................. 212324175929479669
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -6574,7 +6586,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -6608,7 +6620,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885164282567
+PLAN_ID .................. 212324175929545793
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -6654,7 +6666,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -6717,7 +6729,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885164415433
+PLAN_ID .................. 212324175929666763
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -6765,7 +6777,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177984162
+  ObjectUIDs ............. 4560549616040781998
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -6962,19 +6974,20 @@ _SALT_      A            B           C            D
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:26:23 2016
+-- Definition current  Tue Mar  8 05:45:52 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:23 2016
+-- Definition current  Tue Mar  8 05:45:52 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -6987,12 +7000,13 @@ _SALT_      A            B           C            D
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:23 2016
+-- Definition current  Tue Mar  8 05:45:52 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -7000,6 +7014,7 @@ _SALT_      A            B           C            D
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -7122,7 +7137,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885185091978
+PLAN_ID .................. 212324175953641296
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -7165,7 +7180,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986351
+  ObjectUIDs ............. 4560549616040784604
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -7205,7 +7220,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885185152819
+PLAN_ID .................. 212324175953734141
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -7249,7 +7264,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986351
+  ObjectUIDs ............. 4560549616040784604
   select_list ............ %(1), %('1')
   input_variables ........ %(1), %('1')
 
@@ -7288,7 +7303,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885185203931
+PLAN_ID .................. 212324175953816734
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -7331,7 +7346,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986351
+  ObjectUIDs ............. 4560549616040784604
   select_list ............ TRAFODION.SCH.T010T1.A, %('1')
   input_variables ........ %('1')
 
@@ -7372,7 +7387,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885183743840
+PLAN_ID .................. 212324175952493666
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a = 2;
@@ -7416,7 +7431,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986351
+  ObjectUIDs ............. 4560549616040784604
   select_list ............ %(2), TRAFODION.SCH.T010T1.B
   input_variables ........ %(2)
 
@@ -7679,7 +7694,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885186898865
+PLAN_ID .................. 212324175955526117
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -7724,7 +7739,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -7758,7 +7773,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885186959156
+PLAN_ID .................. 212324175955589592
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -7804,7 +7819,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -7839,7 +7854,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885187022838
+PLAN_ID .................. 212324175955661668
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -7884,7 +7899,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -7919,7 +7934,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885187080416
+PLAN_ID .................. 212324175955727413
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -7964,7 +7979,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   input_variables ........ %('a')
 
 
@@ -8028,7 +8043,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885187212767
+PLAN_ID .................. 212324175955856497
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -8075,7 +8090,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   input_variables ........ %('upd'), %(4)
 
 
@@ -8102,7 +8117,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885187278448
+PLAN_ID .................. 212324175955924581
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -8148,7 +8163,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'), %(1),
                              TRAFODION.SCH.T010T2.D
   input_variables ........ %('a'), %(1)
@@ -8182,7 +8197,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885187324046
+PLAN_ID .................. 212324175955973846
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -8229,7 +8244,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -8264,7 +8279,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885187382745
+PLAN_ID .................. 212324175956030695
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -8310,7 +8325,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   select_list ............ TRAFODION.SCH.T010T2.A, %('a'),
                              TRAFODION.SCH.T010T2.C, TRAFODION.SCH.T010T2.D
   input_variables ........ %('a')
@@ -8345,7 +8360,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885187439570
+PLAN_ID .................. 212324175956088526
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -8391,7 +8406,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   input_variables ........ %('a')
 
 
@@ -8455,7 +8470,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885187560565
+PLAN_ID .................. 212324175956213485
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -8503,7 +8518,7 @@ DESCRIPTION
   QUERY_CACHE ........ 1,024
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177986475
+  ObjectUIDs ............. 4560549616040784661
   input_variables ........ %('uuu'), %(4)
 
 
@@ -8680,19 +8695,20 @@ _SALT_      A            B           C            D
 >>invoke t010t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T010T1
--- Definition current  Wed Feb 10 17:26:44 2016
+-- Definition current  Tue Mar  8 05:46:17 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_CELL_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_CELL_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:44 2016
+-- Definition current  Tue Mar  8 05:46:17 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -8705,12 +8721,13 @@ _SALT_      A            B           C            D
   , COL_VALUE                        VARCHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_"."TRAFODION.SCH.T010T1";
 
 -- Definition of Trafodion table HBASE."_ROW_"."TRAFODION.SCH.T010T1"
--- Definition current  Wed Feb 10 17:26:44 2016
+-- Definition current  Tue Mar  8 05:46:17 2016
 
   (
     ROW_ID                           VARCHAR(10) CHARACTER SET ISO88591 COLLATE
@@ -8718,6 +8735,7 @@ _SALT_      A            B           C            D
   , COLUMN_DETAILS                   VARCHAR(60) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -8840,7 +8858,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885206481311
+PLAN_ID .................. 212324175978975431
 ROWS_OUT ................ 11
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 or b='1';
@@ -8883,7 +8901,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988580
+  ObjectUIDs ............. 4560549616040787190
   select_list ............ TRAFODION.SCH.T010T1.A, TRAFODION.SCH.T010T1.B
 
 
@@ -8923,7 +8941,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885206545625
+PLAN_ID .................. 212324175979034252
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1 and b='1';
@@ -8967,7 +8985,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988580
+  ObjectUIDs ............. 4560549616040787190
   select_list ............ 1, '1'
 
 
@@ -9005,7 +9023,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885206601773
+PLAN_ID .................. 212324175979087509
 ROWS_OUT ................ 10
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where b='1';
@@ -9048,7 +9066,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988580
+  ObjectUIDs ............. 4560549616040787190
   select_list ............ TRAFODION.SCH.T010T1.A, '1'
 
 
@@ -9088,7 +9106,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... XX
-PLAN_ID .................. 212321885206657193
+PLAN_ID .................. 212324175979144151
 ROWS_OUT ................. 1
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t010t1 where a=1;
@@ -9132,7 +9150,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988580
+  ObjectUIDs ............. 4560549616040787190
   select_list ............ 1, TRAFODION.SCH.T010T1.B
 
 
@@ -9394,7 +9412,7 @@ A            B           C            D
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X1
-PLAN_ID .................. 212321885208444428
+PLAN_ID .................. 212324175980723729
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -9439,7 +9457,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -9472,7 +9490,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X2
-PLAN_ID .................. 212321885208506444
+PLAN_ID .................. 212324175980766745
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -9518,7 +9536,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -9552,7 +9570,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X3
-PLAN_ID .................. 212321885208569011
+PLAN_ID .................. 212324175980834930
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -9597,7 +9615,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -9631,7 +9649,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X4
-PLAN_ID .................. 212321885208626953
+PLAN_ID .................. 212324175980894503
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -9676,7 +9694,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -9739,7 +9757,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... X5
-PLAN_ID .................. 212321885208874924
+PLAN_ID .................. 212324175981003233
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -9786,7 +9804,7 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... ON
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -9816,7 +9834,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y1
-PLAN_ID .................. 212321885208941580
+PLAN_ID .................. 212324175981066009
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -9862,7 +9880,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', 1,
                              TRAFODION.SCH.T010T2.D
 
@@ -9895,7 +9913,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y2
-PLAN_ID .................. 212321885208994111
+PLAN_ID .................. 212324175981117543
 ROWS_OUT ................. 5
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -9942,7 +9960,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -9976,7 +9994,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y3
-PLAN_ID .................. 212321885209059552
+PLAN_ID .................. 212324175981174168
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0
 STATEMENT ................ select *
@@ -10022,7 +10040,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
   select_list ............ TRAFODION.SCH.T010T2.A, 'a', TRAFODION.SCH.T010T2.C,
                              TRAFODION.SCH.T010T2.D
 
@@ -10056,7 +10074,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y4
-PLAN_ID .................. 212321885209136694
+PLAN_ID .................. 212324175981243822
 ROWS_OUT ................. 4
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ delete from t010t2
@@ -10102,7 +10120,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
 
 
 TUPLE_FLOW ================================  SEQ_NO 3        CHILDREN 1, 2
@@ -10165,7 +10183,7 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... Y5
-PLAN_ID .................. 212321885209255812
+PLAN_ID .................. 212324175981365129
 ROWS_OUT ................. 2
 EST_TOTAL_COST ........... 0
 STATEMENT ................ update t010t2
@@ -10213,7 +10231,7 @@ DESCRIPTION
   QUERY_CACHE ............ 0
   MDAM_SCAN_METHOD ....... ON
   HBASE_MAX_NUM_SEARCH_KE  1
-  ObjectUIDs ............. 5395965056177988641
+  ObjectUIDs ............. 4560549616040787250
 
 
 TRAFODION_UPDATE ==========================  SEQ_NO 1        NO CHILDREN
@@ -10721,12 +10739,12 @@ CREATE TABLE TRAFODION.SCH."delim_tab"
 --- SQL operation complete.
 >>get all volatile schemas;
 
-Schema(Active  ): VOLATILE_SCHEMA_MXID110000259692123218850742930010000000002
+Schema(Active  ): VOLATILE_SCHEMA_MXID110000244852123241758147790010000000002
 
 --- SQL operation complete.
 >>get all volatile tables;
 
-Schema(Active  ): VOLATILE_SCHEMA_MXID110000259692123218850742930010000000002
+Schema(Active  ): VOLATILE_SCHEMA_MXID110000244852123241758147790010000000002
   Table: VTAB1
   Table: VTAB2
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED011
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED011 b/core/sql/regress/seabase/EXPECTED011
index 400317e..53ee692 100644
--- a/core/sql/regress/seabase/EXPECTED011
+++ b/core/sql/regress/seabase/EXPECTED011
@@ -7,13 +7,14 @@
 >>invoke T011T1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T011T1
--- Definition current  Wed Mar  2 05:16:53 2016
+-- Definition current  Tue Mar  8 05:49:30 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , B                                CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (A ASC)
 
 --- SQL operation complete.
 >>
@@ -142,7 +143,7 @@ A            B
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212323655814425974
+PLAN_ID .................. 212324176171390042
 ROWS_OUT ................. 7
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t011t1 where a >= 3 and a < 5;
@@ -182,7 +183,7 @@ DESCRIPTION
   SCHEMA ................. TRAFODION.SCH
   QUERY_CACHE ............ 0
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 4553793696580766799
+  ObjectUIDs ............. 7433846178641183029
   select_list ............ TRAFODION.SCH.T011T1.A, TRAFODION.SCH.T011T1.B
 
 
@@ -1269,7 +1270,7 @@ METRIC_TEXT_TABLE
 >>invoke trafodion."_REPOS_".metric_query_table;
 
 -- Definition of Trafodion table TRAFODION."_REPOS_".METRIC_QUERY_TABLE
--- Definition current  Wed Mar  2 05:18:55 2016
+-- Definition current  Tue Mar  8 05:51:31 2016
 
   (
     INSTANCE_ID                      INT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1424,7 +1425,10 @@ METRIC_TEXT_TABLE
   , NUM_NODES                        LARGEINT DEFAULT NULL
   , UDR_PROCESS_BUSY_TIME            LARGEINT DEFAULT NULL
   , PERTABLE_STATS                   INT DEFAULT NULL
+  , "_SALT_"                         INT UNSIGNED NO DEFAULT NOT NULL NOT
+      DROPPABLE
   )
+  PRIMARY KEY ("_SALT_" ASC, EXEC_START_UTC_TS ASC, QUERY_ID ASC)
 
 --- SQL operation complete.
 >>
@@ -1451,7 +1455,7 @@ METRIC_TEXT_TABLE
 >>-- get qid for the prepared stmt
 >>get qid for statement explstmt;
 
-MXID11000008089212323655795185001000000000206U3333300_1994_EXPLSTMT
+MXID11000029589212324176152856001000000000206U3333300_1994_EXPLSTMT
 
 --- SQL operation complete.
 >>
@@ -1503,7 +1507,7 @@ SEQ_NUM      OPERATOR
 --- SQL command prepared.
 >>get qid for statement explstmt2;
 
-MXID11000008089212323655795185001000000000206U3333300_2005_EXPLSTMT2
+MXID11000029589212324176152856001000000000206U3333300_2005_EXPLSTMT2
 
 --- SQL operation complete.
 >>set qid MXID123456 for explstmt2;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED012
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED012 b/core/sql/regress/seabase/EXPECTED012
index e4ba376..4db69b5 100644
--- a/core/sql/regress/seabase/EXPECTED012
+++ b/core/sql/regress/seabase/EXPECTED012
@@ -41,7 +41,7 @@
 >>invoke t012t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T012T1
--- Definition current  Fri Feb  5 15:58:51 2016
+-- Definition current  Thu Feb 25 09:14:19 2016
 
   (
     A                                SMALLINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -55,6 +55,7 @@
       DEFAULT DEFAULT NULL
   , G                                NUMERIC(5, 2) DEFAULT NULL
   )
+  PRIMARY KEY (A DESC)
 
 --- SQL operation complete.
 >>
@@ -64,7 +65,7 @@
 >>invoke t012v1;
 
 -- Definition of Trafodion view TRAFODION.SCH.T012V1
--- Definition current  Fri Feb  5 15:58:54 2016
+-- Definition current  Thu Feb 25 09:14:22 2016
 
   (
     A                                SMALLINT NO DEFAULT NOT NULL NOT DROPPABLE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED020
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED020 b/core/sql/regress/seabase/EXPECTED020
index b1e8606..08bfb7c 100644
--- a/core/sql/regress/seabase/EXPECTED020
+++ b/core/sql/regress/seabase/EXPECTED020
@@ -6,13 +6,14 @@
 >>invoke test020t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.TEST020T1
--- Definition current  Fri Jun  5 10:06:01 2015
+-- Definition current  Sun Mar 13 06:02:17 2016
 
   (
     C1                               INT NO DEFAULT NOT NULL NOT DROPPABLE
   , C2                               CHAR(20) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT _ISO88591't20t1''s column c2'
   )
+  PRIMARY KEY (C1 ASC)
 
 --- SQL operation complete.
 >>showddl test020t1;
@@ -48,13 +49,14 @@ C1           C2
 >>invoke test020t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.TEST020T2
--- Definition current  Fri Jun  5 10:06:03 2015
+-- Definition current  Tue Mar  8 22:57:08 2016
 
   (
     C                                CHAR(15) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (C ASC, D ASC)
 
 --- SQL operation complete.
 >>showddl test020t2;
@@ -142,15 +144,16 @@ G0
 >>-- Test columns named SYSKEY
 >>--
 >>
->>-- Expecting error 1080 message: Duplicate references to column SYSKEY
->>--                               in the create request
->>-- when the following Create Table command is executed.
+>>-- Expecting error 1269 message: Col name SYSKEY is reserved.
 >>create table test020t5(syskey int);
 
-*** ERROR[1080] The DDL request has duplicate references to column SYSKEY.
+*** ERROR[1269] Column name SYSKEY is reserved for internal system usage. It cannot be specified as a user column.
 
 --- SQL operation failed with errors.
 >>
+>>cqd traf_allow_reserved_colnames 'ON';
+
+--- SQL operation complete.
 >>create table test020t5(c int not null not droppable primary key not droppable,
 +>                    syskey char(4));
 
@@ -158,13 +161,14 @@ G0
 >>invoke test020t5;
 
 -- Definition of Trafodion table TRAFODION.SCH.TEST020T5
--- Definition current  Fri Jun  5 10:06:10 2015
+-- Definition current  Tue Mar  8 22:57:24 2016
 
   (
     C                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , SYSKEY                           CHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT DEFAULT NULL
   )
+  PRIMARY KEY (C ASC)
 
 --- SQL operation complete.
 >>showddl test020t5;
@@ -215,6 +219,11 @@ ALTER TABLE TRAFODION.SCH.TEST020T5 ADD CONSTRAINT TRAFODION.SCH.TEST020T5C1
 *** ERROR[8101] The operation is prevented by check constraint TRAFODION.SCH.TEST020T5C1 on table TRAFODION.SCH.TEST020T5.
 
 --- 0 row(s) inserted.
+>>
+>>cqd traf_allow_reserved_colnames reset;
+
+--- SQL operation complete.
+>>
 >>--------------------------------------------
 >>-- test cases for solution 10-040607-6721 --
 >>--------------------------------------------
@@ -251,10 +260,11 @@ ALTER TABLE TRAFODION.SCH.TEST020T5 ADD CONSTRAINT TRAFODION.SCH.TEST020T5C1
 >>invoke test020t6;
 
 -- Definition of Trafodion table TRAFODION.SCH.TEST020T6
--- Definition current  Fri Jun  5 10:06:54 2015
+-- Definition current  Tue Mar  8 22:58:27 2016
 
   (
-    C                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                INT DEFAULT NULL
   )
 
 --- SQL operation complete.
@@ -415,10 +425,10 @@ ATEST        BTEST        CTEST        DTEST
 A          
 -----------
 
-          ?
           1
-          ?
           3
+          ?
+          ?
 
 --- 4 row(s) selected.
 >>
@@ -3496,4 +3506,24 @@ E@           A
           6                     5
 
 --- 5 row(s) selected.
+>>
+>>create table test020t43(c1 int, c2 int ) attribute aligned format ;
+
+--- SQL operation complete.
+>>upsert into test020t43 values (1,1);
+
+--- 1 row(s) inserted.
+>>upsert into test020t43 (c1) values(1);
+
+--- 1 row(s) inserted.
+>>select * from test020t43 ;
+
+C1           C2
+-----------  -----------
+
+          1            1
+          1            ?
+
+--- 2 row(s) selected.
+>>
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED022
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED022 b/core/sql/regress/seabase/EXPECTED022
index 49c30f6..48b4c23 100644
--- a/core/sql/regress/seabase/EXPECTED022
+++ b/core/sql/regress/seabase/EXPECTED022
@@ -426,7 +426,7 @@ ROW_ID      (EXPR)
 >>invoke hbase."_CELL_".t022hbt2;
 
 -- Definition of Trafodion table HBASE."_CELL_".T022HBT2
--- Definition current  Mon Jul 27 15:00:54 2015
+-- Definition current  Thu Feb 25 09:47:53 2016
 
   (
     ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
@@ -439,12 +439,13 @@ ROW_ID      (EXPR)
   , COL_VALUE                        VARCHAR(1000) CHARACTER SET ISO88591
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_".t022hbt2;
 
 -- Definition of Trafodion table HBASE."_ROW_".T022HBT2
--- Definition current  Mon Jul 27 15:00:54 2015
+-- Definition current  Thu Feb 25 09:47:53 2016
 
   (
     ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
@@ -452,6 +453,7 @@ ROW_ID      (EXPR)
   , COLUMN_DETAILS                   VARCHAR(10000) CHARACTER SET ISO88591
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>cqd hbase_max_column_val_length '100000';
@@ -463,7 +465,7 @@ ROW_ID      (EXPR)
 >>invoke hbase."_CELL_".t022hbt2;
 
 -- Definition of Trafodion table HBASE."_CELL_".T022HBT2
--- Definition current  Mon Jul 27 15:00:54 2015
+-- Definition current  Thu Feb 25 09:47:53 2016
 
   (
     ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
@@ -476,12 +478,13 @@ ROW_ID      (EXPR)
   , COL_VALUE                        VARCHAR(100000) CHARACTER SET ISO88591
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>invoke hbase."_ROW_".t022hbt2;
 
 -- Definition of Trafodion table HBASE."_ROW_".T022HBT2
--- Definition current  Mon Jul 27 15:00:54 2015
+-- Definition current  Thu Feb 25 09:47:53 2016
 
   (
     ROW_ID                           VARCHAR(100) CHARACTER SET ISO88591
@@ -489,6 +492,7 @@ ROW_ID      (EXPR)
   , COLUMN_DETAILS                   VARCHAR(100000) CHARACTER SET ISO88591
       COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (ROW_ID ASC)
 
 --- SQL operation complete.
 >>insert into hbase."_CELL_".t022hbt2 values ('1', 'cf', 'a', -1, repeat('a', 100000));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/seabase/EXPECTED025
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED025 b/core/sql/regress/seabase/EXPECTED025
index 5834ac7..522f424 100644
--- a/core/sql/regress/seabase/EXPECTED025
+++ b/core/sql/regress/seabase/EXPECTED025
@@ -1884,7 +1884,7 @@ CREATE TABLE TRAFODION.S025.T025T004
 >>insert into T025T003 values  	
 +>(DEFAULT,-3,0,1,'dasf',2.1,'dfaf','dfa','dfa','d');
 
-*** ERROR[8101] The operation is prevented by check constraint TRAFODION.S025.T025T003_953976361_2228 on table TRAFODION.S025.T025T003.
+*** ERROR[8101] The operation is prevented by check constraint TRAFODION.S025.T025T003_527751321_8674 on table TRAFODION.S025.T025T003.
 
 --- 0 row(s) inserted.
 >>
@@ -1894,7 +1894,7 @@ CREATE TABLE TRAFODION.S025.T025T004
 +>(DEFAULT,-2,1,1,'dasf',2.1,'dfaf','dfa','dfa','d'),	
 +>(DEFAULT,-1,2,1,'dasf',2.1,'dfaf','dfa','dfa','d');
 
-*** ERROR[8101] The operation is prevented by check constraint TRAFODION.S025.T025T003_953976361_2228 on table TRAFODION.S025.T025T003.
+*** ERROR[8101] The operation is prevented by check constraint TRAFODION.S025.T025T003_527751321_8674 on table TRAFODION.S025.T025T003.
 
 --- 0 row(s) inserted.
 >>
@@ -2603,7 +2603,7 @@ CREATE VOLATILE TABLE T025T00V2
 >>invoke T025T00V2;
 
 -- Definition of Trafodion volatile table T025T00V2
--- Definition current  Sun May 31 00:47:11 2015
+-- Definition current  Thu Feb 25 09:56:14 2016
 
   (
     SURROGATE_KEY                    SMALLINT UNSIGNED GENERATED BY DEFAULT AS
@@ -2612,6 +2612,7 @@ CREATE VOLATILE TABLE T025T00V2
       DROPPABLE
   , C                                INT UNSIGNED DEFAULT NULL
   )
+  PRIMARY KEY (SURROGATE_KEY ASC)
 
 --- SQL operation complete.
 >>


[32/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBaccess.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.h b/core/sql/exp/ExpLOBaccess.h
index e68c2eb..bcdba44 100644
--- a/core/sql/exp/ExpLOBaccess.h
+++ b/core/sql/exp/ExpLOBaccess.h
@@ -46,7 +46,7 @@
 #include "ExpLOBstats.h"
 #include "ExpLOBinterface.h"
 #include "ComSmallDefs.h"
-
+#include "Globals.h"
 #include <seabed/ms.h>
 #include <seabed/fs.h>
 
@@ -79,6 +79,79 @@ using namespace std;
 #define LOB_CURSOR_PREFETCH_BYTES_MAX (1 << 27) // 128MB
 
 class ExLobGlobals;
+// This class defines the request used to construct the message to send over 
+// to the mxlobsrvr process. It's currently not used. All lob functionailty is 
+// now in te master process. We are retaining it here for furture use.
+class ExLobRequest
+{
+  public:
+    ExLobRequest();
+    ~ExLobRequest();
+    Ex_Lob_Error send();
+
+    void setValues(char *descFileName, Int64 descNumIn, Int64 handleInLen, 
+                   char *handleIn, LobsStorage storage, Int64 transId,
+                   SB_Transid_Type transIdBig,
+                   SB_Transseq_Type transStartId,
+                   char *blackBox, Int64 blackBoxLen);
+    void getValues(Int64 &descNumOut, Int64 &handleOutLen, 
+                   char *handleOut, Ex_Lob_Error &requestStatus,
+                   Int64 &cliError,
+                   char *blackBox, Int64 &blackBoxLen);
+
+    Int64 getDescNumIn() { return descNumIn_; }
+    void setDescNumIn(Int64 descNum) { descNumIn_ = descNum; }
+    Int64 getDescNumOut() { return descNumOut_; }
+    void setDescNumOut(Int64 descNum) { descNumOut_ = descNum; }
+    Int64 getDataOffset() { return dataOffset_; }
+    void setDataOffset(int dataOffset) { dataOffset_ = dataOffset; }
+    LobsRequest getType() { return type_; }
+    void setType(LobsRequest type) { type_ = type; }
+    char *getDescFileName() { return descFileName_; }
+    Int64 getOperLen() { return operLen_; }
+    void setOperLen(Int64 len) { operLen_ = len; }
+    void log();   
+    void setError(Ex_Lob_Error err) { error_ = err; }
+    Ex_Lob_Error getError() { return error_; }
+    Ex_Lob_Error getStatus() { return status_; }
+    char *getHandleIn() { return handleIn_; }
+    Int64 getHandleInLen() { return handleInLen_; }
+    char *getHandleOut() { return handleOut_; }
+    void setHandleOutLen(Lng32 len) { handleOutLen_ = len; }
+    void setCliError(int cliErr) { cliError_ = cliErr; }
+    int getCliError() { return (int)cliError_; }
+    Int64 getTransId() { return transId_; }
+    SB_Transid_Type getTransIdBig() { return transIdBig_; }
+    SB_Transseq_Type getTransStartId() { return transStartId_; }
+    Int64 getBlackBoxLen() { return blackBoxLen_; };
+    void setBlackBoxLen(Int64 len) { blackBoxLen_ = len; }
+    char *getBlackBox() { return blackBox_; }
+    
+    void incrReqNum() { reqNum_++; }
+    Int64 getReqNum() { return reqNum_; }
+
+  private:
+    Int64 reqNum_;
+    Int64 descNumIn_;
+    Int64 descNumOut_;
+    char handleIn_[MAX_HANDLE_IN_LEN];
+    Int64 handleInLen_;
+    char handleOut_[MAX_HANDLE_OUT_LEN];
+    Int64 handleOutLen_;
+    Int64 dataOffset_;
+    LobsRequest type_;
+    LobsStorage storage_;
+    Int64 operLen_;
+    Ex_Lob_Error error_;
+    Int64 cliError_;
+    Ex_Lob_Error status_;
+    Int64 transId_;
+    SB_Transid_Type transIdBig_;
+    SB_Transseq_Type transStartId_;
+    char descFileName_[MAX_LOB_FILE_NAME_LEN];
+    char blackBox_[MAX_BLACK_BOX_LEN];
+    Int64 blackBoxLen_;
+};
 
 ///////////////////////////////////////////////////////////////////////////////
 // THE SQL LOB API
@@ -87,11 +160,11 @@ class ExLobGlobals;
 Ex_Lob_Error ExLobsOper (
     char        *lobName,          // lob name
     char        *handleIn,         // input handle (for cli calls)
-    Int64       handleInLen,       // input handle len
+    Int32       handleInLen,       // input handle len
     char       *hdfsServer,       // server where hdfs fs resides
     Int64       hdfsPort,          // port number to access hdfs server
     char        *handleOut,        // output handle (for cli calls)
-    Int64       &handleOutLen,     // output handle len
+    Int32       &handleOutLen,     // output handle len
     Int64       descNumIn,         // input desc Num (for flat files only)
     Int64       &descNumOut,       // output desc Num (for flat files only)
     Int64       &retOperLen,       // length of data involved in this operation
@@ -111,9 +184,10 @@ Ex_Lob_Error ExLobsOper (
     void        *&globPtr,         // ptr to the Lob objects. 
     Int64       transId,
     void        *blackBox,         // black box to be sent to cli
-    Int64       blackBoxLen,        // length of black box
+    Int32       blackBoxLen,        // length of black box
     Int64       lobMaxSize = 0,        // max size of lob.
     Int64       lobMaxChunkMemSize = 0 ,//max length of intermediate mem buffer used to do i/o.
+    Int64 lobGCLimit = 0, // size at which GC must be triggered
     int         bufferSize =0,
     short       replication =0,
     int         blocksize=0,
@@ -160,7 +234,7 @@ class ExLobDescHeader
     int getDataOffset() { return dataOffset_; }
     void incDataOffset(int size) { dataOffset_ += size; }
     
-    Ex_Lob_Error print(char *descFileName);
+  
 
   private:
 
@@ -200,7 +274,6 @@ class ExLobDesc
     void setOffset(int offset) { dataOffset_ = offset; }
     void setDataState(int dataState) { dataState_ = dataState; }
 
-    Ex_Lob_Error print();
 
   private:
 
@@ -213,79 +286,46 @@ class ExLobDesc
     int nextFree_;
 };
 
-class ExLobRequest
+class ExLobInMemoryDescChunksEntry
 {
-  public:
-    ExLobRequest();
-    ~ExLobRequest();
-    Ex_Lob_Error send();
-
-    void setValues(char *descFileName, Int64 descNumIn, Int64 handleInLen, 
-                   char *handleIn, LobsStorage storage, Int64 transId,
-                   SB_Transid_Type transIdBig,
-                   SB_Transseq_Type transStartId,
-                   char *blackBox, Int64 blackBoxLen);
-    void getValues(Int64 &descNumOut, Int64 &handleOutLen, 
-                   char *handleOut, Ex_Lob_Error &requestStatus,
-                   Int64 &cliError,
-                   char *blackBox, Int64 &blackBoxLen);
-
-    Int64 getDescNumIn() { return descNumIn_; }
-    void setDescNumIn(Int64 descNum) { descNumIn_ = descNum; }
-    Int64 getDescNumOut() { return descNumOut_; }
-    void setDescNumOut(Int64 descNum) { descNumOut_ = descNum; }
-    Int64 getDataOffset() { return dataOffset_; }
-    void setDataOffset(int dataOffset) { dataOffset_ = dataOffset; }
-    LobsRequest getType() { return type_; }
-    void setType(LobsRequest type) { type_ = type; }
-    char *getDescFileName() { return descFileName_; }
-    Int64 getOperLen() { return operLen_; }
-    void setOperLen(Int64 len) { operLen_ = len; }
-    void log();
-    void getDescOut(ExLobDesc &desc); 
-    void putDescIn(ExLobDesc &desc); 
-    ExLobDesc &getDesc() { return desc_; }
-    void setError(Ex_Lob_Error err) { error_ = err; }
-    Ex_Lob_Error getError() { return error_; }
-    Ex_Lob_Error getStatus() { return status_; }
-    char *getHandleIn() { return handleIn_; }
-    Int64 getHandleInLen() { return handleInLen_; }
-    char *getHandleOut() { return handleOut_; }
-    void setHandleOutLen(Lng32 len) { handleOutLen_ = len; }
-    void setCliError(int cliErr) { cliError_ = cliErr; }
-    int getCliError() { return (int)cliError_; }
-    Int64 getTransId() { return transId_; }
-    SB_Transid_Type getTransIdBig() { return transIdBig_; }
-    SB_Transseq_Type getTransStartId() { return transStartId_; }
-    Int64 getBlackBoxLen() { return blackBoxLen_; };
-    void setBlackBoxLen(Int64 len) { blackBoxLen_ = len; }
-    char *getBlackBox() { return blackBox_; }
-    
-    void incrReqNum() { reqNum_++; }
-    Int64 getReqNum() { return reqNum_; }
-
-  private:
-    Int64 reqNum_;
-    Int64 descNumIn_;
-    Int64 descNumOut_;
-    char handleIn_[MAX_HANDLE_IN_LEN];
-    Int64 handleInLen_;
-    char handleOut_[MAX_HANDLE_OUT_LEN];
-    Int64 handleOutLen_;
-    Int64 dataOffset_;
-    LobsRequest type_;
-    LobsStorage storage_;
-    Int64 operLen_;
-    ExLobDesc desc_;
-    Ex_Lob_Error error_;
-    Int64 cliError_;
-    Ex_Lob_Error status_;
-    Int64 transId_;
-    SB_Transid_Type transIdBig_;
-    SB_Transseq_Type transStartId_;
-    char descFileName_[MAX_LOB_FILE_NAME_LEN];
-    char blackBox_[MAX_BLACK_BOX_LEN];
-    Int64 blackBoxLen_;
+public:
+  ExLobInMemoryDescChunksEntry():
+       currentOffset_ (-1),
+       newOffset_( -1),
+       descPartnKey_(-1),
+       descSyskey_(-1),
+       chunkLen_(-1),
+       chunkNum_(-1)
+  {}
+    ExLobInMemoryDescChunksEntry(Int64 co,Int64 partnKey,Int64 syskey,Int64 chunkLen,Int32 chunkNum)
+  {
+    currentOffset_ = co; newOffset_ = -1;descPartnKey_ = partnKey; descSyskey_ = syskey; chunkLen_ = chunkLen; chunkNum_ =chunkNum;
+  }
+
+  void setCurrentOffset(Int64 co) { currentOffset_ = co;}
+  Int64 getCurrentOffset(){return currentOffset_;}
+  
+  void setNewOffset(Int64 no) { newOffset_ = no;}
+  Int64 getNewOffset(){return newOffset_;}
+
+  void setDescPartnKey(Int64 dk) { descPartnKey_ = dk;}
+  Int64 getDescPartnKey(){return descPartnKey_;}
+
+  void setSyskey(Int64 sk) { descSyskey_ = sk;}
+  Int64 getSyskey(){return descSyskey_;}
+
+  void setChunkLen(Int64 cl) { chunkLen_ = cl;}
+  Int64 getChunkLen(){return chunkLen_;}
+
+  void setChunkNum(Int32 cn) { chunkNum_ = cn;}
+  Int32 getChunkNum(){return chunkNum_;}
+private:
+  Int64 currentOffset_;
+  Int64 newOffset_;
+  Int64 descPartnKey_;
+  Int64 descSyskey_;
+  Int64 chunkLen_;
+  Int32 chunkNum_;
 };
 
 class ExLobCursorBuffer
@@ -369,105 +409,103 @@ class ExLob
 
     Ex_Lob_Error initialize(char *lobFile, Ex_Lob_Mode mode, char *dir, 
                             LobsStorage storage, char *hdfsServer, Int64 hdfsPort,
-                            int bufferSize = 0, short replication =0, int blocksize=0, Int64 lobMaxSize = 0, ExLobGlobals *lobGlobals = NULL);
+                            char *lobLocation,
+                            int bufferSize = 0, short replication =0, 
+                            int blocksize=0, Int64 lobMaxSize = 0, 
+                            ExLobGlobals *lobGlobals = NULL);
     Ex_Lob_Error initialize(char *lobFile);
-    Ex_Lob_Error writeDesc(Int64 &sourceLen, char *source, LobsSubOper subOperation, Int64 &descNumOut, Int64 &operLen, Int64 lobMaxSize);
+  Ex_Lob_Error writeDesc(Int64 &sourceLen, char *source, LobsSubOper subOperation, Int64 &descNumOut, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize,Int64 lobGCLimit, char * handleIn, Int32 handleInLen, char *blackBox, Int32 *blackBoxLen, char * handleOut, Int32 &handleOutLen, void *lobGlobals);
     Ex_Lob_Error writeLobData(char *source, Int64 sourceLen, 
 			      LobsSubOper subOperation, 
 			      Int64 tgtOffset,Int64 &operLen, 
 			      Int64 lobMaxMemChunkLen);
     Ex_Lob_Error writeDataSimple(char *data, Int64 size, LobsSubOper subOperation, Int64 &operLen,
                                  int bufferSize = 0, short replication =0, int blocksize=0);
-    Ex_Lob_Error readToMem(char *memAddr, Int64 size,  Int64 &operLen);
-    Ex_Lob_Error readToFile(char *fileName, Int64 tgtLen,Int64 &operLen,Int64 lobMaxChunkMemLen, Int32 fileflags);
-    Ex_Lob_Error readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int64 handleInLen, Int64 &operLen);
-    Ex_Lob_Error readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen);
+    Ex_Lob_Error readToMem(char *memAddr, Int64 size,  Int64 &operLen,char * handleIn, Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, Int64 transId);
+  Ex_Lob_Error readToFile(char *fileName, Int64 tgtLen,Int64 &operLen,Int64 lobMaxChunkMemLen, Int32 fileflags, char *handleIn,Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, Int64 transId);
+  Ex_Lob_Error readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int32 handleInLen, Int64 &operLen,Int64 transId);
+  Ex_Lob_Error readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen,char *handleIn, Int32 handeLenIn,Int64 transId);
     Ex_Lob_Error readCursorDataSimple(char *tgt, Int64 tgtSize, cursor_t &cursor, Int64 &operLen);
     Ex_Lob_Error readDataCursorSimple(char *fileName, char *tgt, Int64 tgtSize, Int64 &operLen, ExLobGlobals *lobGlobals);
     bool hasNoOpenCursors() { return lobCursors_.empty(); }
-    Ex_Lob_Error openCursor(char *handleIn, Int64 handleInLen);
+  Ex_Lob_Error openCursor(char *handleIn, Int32 handleInLen,Int64 transId);
     Ex_Lob_Error openDataCursor(char *fileName, LobsCursorType type, Int64 range, 
                                 Int64 bytesLeft, Int64 bufMaxSize, Int64 prefetch, ExLobGlobals *lobGlobals);
     Ex_Lob_Error deleteCursor(char *cursorName, ExLobGlobals *lobGlobals);
-    Ex_Lob_Error fetchCursor();
-    Ex_Lob_Error selectCursorDesc(ExLobRequest *request);
-    Ex_Lob_Error fetchCursorDesc(ExLobRequest *request);
-    Ex_Lob_Error insertData(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize);
-    Ex_Lob_Error append(char *data, Int64 size, LobsSubOper so, Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemLen);
-    Ex_Lob_Error append(ExLobRequest *request);
-    Ex_Lob_Error update(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize,Int64 lobMaxChunkMemLen);
-    Ex_Lob_Error update(ExLobRequest *request);
+  Ex_Lob_Error fetchCursor(char *handleIn, Int32 handleLenIn, Int64 &outOffset, Int64 &outSize,NABoolean &isEOD,Int64 transId);
+  Ex_Lob_Error insertData(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemSize,char *handleIn,Int32 handleInLen, char *blackBox, Int32 blackBoxLen, char * handleOut, Int32 &handleOutLen, void *lobGlobals);
+  Ex_Lob_Error append(char *data, Int64 size, LobsSubOper so, Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize, Int64 lobMaxChunkMemLen,Int64 lobGCLimit, char *handleIn,Int32 handleInLen, char * handleOut, Int32 &handleOutLen, void *lobGlobals);
+  Ex_Lob_Error update(char *data, Int64 size, LobsSubOper so,Int64 headDescNum, Int64 &operLen, Int64 lobMaxSize,Int64 lobMaxChunkMemLen,Int64 lobGCLimit,char *handleIn,Int32 handleInLen, char * handleOut, Int32 &handleOutLen, void *lobGlobals);
     Ex_Lob_Error readSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset);
     Ex_Lob_Error readHdfsSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset);
     Ex_Lob_Error readLocalSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset);
     Ex_Lob_Error readExternalSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset);
     Ex_Lob_Error statSourceFile(char *srcfile, Int64 &sourceEOF);
-    Ex_Lob_Error delDesc();
-    Ex_Lob_Error delDesc(ExLobRequest *request);
+    Ex_Lob_Error delDesc(char *handleIn, Int32 handleInLen, Int64 transId);
     Ex_Lob_Error purgeLob();
     Ex_Lob_Error closeFile();
     LobInputOutputFileType fileType(char *ioFileName);
-    Ex_Lob_Error closeCursor(char *handleIn, Int64 handleInLen);
+    Ex_Lob_Error closeCursor(char *handleIn, Int32 handleInLen);
     Ex_Lob_Error closeDataCursorSimple(char *fileName, ExLobGlobals *lobGlobals);
-    Ex_Lob_Error closeCursorDesc(ExLobRequest *request);
+   
     Ex_Lob_Error doSanityChecks(char *dir, LobsStorage storage,
-                                Int64 handleInLen, Int64 handleOutLen, 
-                                Int64 blackBoxLen);
-    Ex_Lob_Error allocateDesc(unsigned int size, Int64 &descNum, Int64 &dataOffset,Int64 lobMaxSize);
+                                Int32 handleInLen, Int32 handleOutLen, 
+                                Int32 blackBoxLen);
+  Ex_Lob_Error allocateDesc(unsigned int size, Int64 &descNum, Int64 &dataOffset,Int64 lobMaxSize,Int64 lobMaxChunkMemSize, char *handleIn, Int32 handleInLen,Int64 lobGCLimit, void *lobGlobals);
     Ex_Lob_Error readStats(char *buffer);
     Ex_Lob_Error initStats();
 
-    Ex_Lob_Error insertDesc(ExLobRequest *request) ;
-
-    ExLobRequest *getRequest() { return &request_; }
+    Ex_Lob_Error insertDesc(Int64 offset, Int64 size,  char *handleIn, Int32 handleInLen,  char *handleOut, Int32 &handleOutLen, char *blackBox, Int32 blackBoxLen,void *lobGlobals) ;
 
     Ex_Lob_Error lockDesc();
     Ex_Lob_Error unlockDesc();
-    //int getfdDesc() { return fdDesc_; }
-    hdfsFile *getfdDesc() { return &fdDesc_;}
-    char *getDescFileName() { return lobDescFile_; }
     char *getDataFileName() { return lobDataFile_; }
-
-    Ex_Lob_Error print();
+   
     int getErrNo();
 
-    Ex_Lob_Error delDesc(Int64 descNum);
-    Ex_Lob_Error getDesc(ExLobDesc &desc);
-    Ex_Lob_Error putDesc(ExLobDesc &desc, Int64 descNum);
-    Ex_Lob_Error getDesc(ExLobRequest *request);
+  
+    Ex_Lob_Error getDesc(ExLobDesc &desc,char * handleIn, Int32 handleInLen, char *blackBox, Int32 *blackBoxLen, char * handleOut, Int32 &handleOutLen, Int64 transId);
 
     Ex_Lob_Error writeData(Int64 offset, char *data, Int32 size, Int64 &operLen);
-    Ex_Lob_Error readDataToMem(char *memAddr, Int64 offset, Int64 size, Int64 &operLen);
+  Ex_Lob_Error readDataToMem(char *memAddr, Int64 offset, Int64 size,
+                             Int64 &operLen,char *handleIn, Int32 handleLenIn, 
+                             NABoolean multipleChunks, Int64 transId);
    
-    Ex_Lob_Error readDataToLocalFile(char *fileName, Int64 offset, Int64 size,Int64 &operLen,Int64 lobMaxChunkMemLen ,Int32 fileFlags);
-    Ex_Lob_Error readCursorDataToLocalFile(char *fileName,  Int64 offset, Int64 size, Int64 &writeOperLen, Int64 lobMaxChunkMemSize, Int32 fileflags);
-    Ex_Lob_Error readDataToHdfsFile(char *fileName, Int64 offset, Int64 size, Int64 &operLen,Int64 lobMaxChunkMemLen, Int32 fileflags);
-    Ex_Lob_Error readDataToExternalFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &operLen, Int64 lobMaxChunkMemLen, Int32 fileflags);
-    Ex_Lob_Error readDataFromFile(char *memAddr, Int64 len, Int64 &operLen);
+  Ex_Lob_Error readDataToLocalFile(char *fileName, Int64 offset, Int64 size,Int64 &operLen,Int64 lobMaxChunkMemLen ,Int32 fileFlags,char *handleIn,Int32 handleInLen, NABoolean multipleChunks,Int64 transId);
+  Ex_Lob_Error readDataToHdfsFile(char *fileName, Int64 offset, Int64 size, Int64 &operLen,Int64 lobMaxChunkMemLen, Int32 fileflags,char *handleIn,Int32 handleInLen, NABoolean multipleChunks,Int64 transId);
+  Ex_Lob_Error readDataToExternalFile(char *tgtFileName,  Int64 offset, Int64 size, Int64 &operLen, Int64 lobMaxChunkMemLen, Int32 fileflags,char *handleIn,Int32 handleInLen, NABoolean multipleChunks,Int64 transId);
+  Ex_Lob_Error readDataFromFile(char *memAddr, Int64 len, Int64 &operLen);
+  Ex_Lob_Error compactLobDataFile(ExLobInMemoryDescChunksEntry *dcArray,Int32 numEntries);
+  Ex_Lob_Error  restoreLobDataFile();
+  Ex_Lob_Error purgeBackupLobDataFile();
 
     Ex_Lob_Error emptyDirectory();
-
     ExLobStats *getStats() { return &stats_; }
     NAHeap *getLobGlobalHeap() { return lobGlobalHeap_;}
+  ExLobRequest *getRequest() { return &request_; }
+
+  //The next 2 functions are not active at this point. They serve as an example
+  //on how to send requests across to the mxlobsrvr process from the master 
+  //process
+  Ex_Lob_Error getDesc(ExLobRequest *request);
+  Ex_Lob_Error sendReqToLobServer() ;
   public:
 
     char lobDataFile_[MAX_LOB_FILE_NAME_LEN];
-    char lobDescFile_[MAX_LOB_FILE_NAME_LEN];
-    //int fdDesc_;
-    hdfsFile fdDesc_;
     lobCursors_t lobCursors_;
     ExLobLock lobCursorLock_;
     LobsStorage storage_;
     string dir_; // lob data directory
     char *hdfsServer_;
     Int64 hdfsPort_;
+    char *lobLocation_;
     hdfsFS fs_;
     hdfsFile fdData_;
     int openFlags_;
-    ExLobRequest request_; 
     ExLobStats stats_;
     bool prefetchQueued_;
     NAHeap *lobGlobalHeap_;
+    ExLobRequest request_;
 };
 
 typedef map<string, ExLob *> lobMap_t;
@@ -537,8 +575,6 @@ class ExLobGlobals
     ~ExLobGlobals();
 
     Ex_Lob_Error initialize();
-    Ex_Lob_Error setServerPhandle();
-    Ex_Lob_Error resetServerPhandle();
     lobMap_t * getLobMap() { return lobMap_; }
     Ex_Lob_Error getLobPtr(char *lobName, ExLob *& lobPtr);
     Ex_Lob_Error delLobPtr(char *lobName);
@@ -598,4 +634,6 @@ class ExLobGlobals
     NAHeap *heap_;
 };
 
+
+
 #endif 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBenums.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBenums.h b/core/sql/exp/ExpLOBenums.h
index 67f5f43..99e072d 100644
--- a/core/sql/exp/ExpLOBenums.h
+++ b/core/sql/exp/ExpLOBenums.h
@@ -237,7 +237,10 @@ typedef enum {
 
    Lob_Empty_Directory,
 
-   Lob_Cleanup // destroy everything under globals
+   Lob_Cleanup, // destroy everything under globals
+   Lob_PerformGC,
+   Lob_RestoreLobDataFile,
+   Lob_PurgeBackupLobDataFile
 } LobsOper;
 
 typedef enum {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBexternal.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBexternal.h b/core/sql/exp/ExpLOBexternal.h
index b21b97d..e8080f6 100644
--- a/core/sql/exp/ExpLOBexternal.h
+++ b/core/sql/exp/ExpLOBexternal.h
@@ -93,7 +93,11 @@ enum LOBcliQueryType
     LOB_DATA_EXTRACT,
 
     // returns length of lob given a lobhandle
-    LOB_CLI_SELECT_LOBLENGTH
+    LOB_CLI_SELECT_LOBLENGTH,
+   
+    // performs GC of lob file
+    LOB_CLI_PERFORM_LOB_GC
+
   };
 
 enum LOBcliQueryPhase
@@ -116,7 +120,7 @@ Lng32 SQL_EXEC_LOBcliInterface
  /*IN*/     char * inLobHandle,
  /*IN*/     Lng32  inLobHandleLen,
  /*IN*/     char * blackBox,
- /*IN*/     Lng32* blackBoxLen,
+ /*IN*/     Int32* blackBoxLen,
  /*OUT*/    char * outLobHandle,
  /*OUT*/    Lng32 * outLobHandleLen,
  /*IN*/     LOBcliQueryType qType,
@@ -135,6 +139,16 @@ Lng32 SQL_EXEC_LOBcliInterface
            				in */
  /*IN*/     Int64 xnId          /* xn id of the parent process, if non-zero */
  );
+Lng32 SQL_EXEC_LOB_GC_Interface
+(
+ /*IN*/     void *lobGlobals, // can be passed or NULL
+ /*IN*/     char * handle,
+ /*IN*/     Lng32  handleLen,
+ /*IN*/     char*  hdfsServer,
+ /*IN*/     Lng32  hdfsPort,
+ /*IN*/     char *lobLocation,
+ /*IN*/     Int64 lobMaxMemChunkLen // if passed in as 0, will use default value of 1G for the in memory buffer to do compaction.
+ );
 
 Lng32 SQL_EXEC_LOBddlInterface
 (
@@ -146,6 +160,8 @@ Lng32 SQL_EXEC_LOBddlInterface
  /*IN*/     short *lobNumList,
  /*IN*/     short *lobTypList,
  /*IN*/     char* *lobLocList,
+ /*IN*/     char*  hdfsServer,
+ /*IN*/     Lng32  hdfsPort,
  /*IN*/     Int64 lobMaxSize
  );
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBinterface.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBinterface.cpp b/core/sql/exp/ExpLOBinterface.cpp
index d55bab9..188fed4 100644
--- a/core/sql/exp/ExpLOBinterface.cpp
+++ b/core/sql/exp/ExpLOBinterface.cpp
@@ -41,13 +41,13 @@ Lng32 ExpLOBinterfaceInit(void *& lobGlob, void * lobHeap,NABoolean isHive, Int6
   Int64 dummyParam = 0;
   Int64 cliError = -1; 
   Ex_Lob_Error status;
-  
+  Int32 dummyParam2 = 0;
   char dir[100];
-  strcpy(dir, "/h/temp");
+  strcpy(dir, "/lobs");
   err = ExLobsOper(dir,
 		   NULL, 0,
 		   NULL, 0, 
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError,
 		   dir, Lob_HDFS_File,
 		   NULL, 0, 
@@ -76,22 +76,101 @@ Lng32 ExpLOBinterfaceInit(void *& lobGlob, void * lobHeap,NABoolean isHive, Int6
     return 0;
 }
 
-Lng32 ExpLOBinterfaceCleanup(void *& lobGlob, void * lobHeap)
+Lng32 ExpLOBinterfacePerformGC(void *& lobGlob, char *lobName,void *descChunksArray, Int32 numEntries, char *hdfsServer, Int32 hdfsPort,char *lobLoc,Int64 lobMaxChunkMemSize)
 {
   Ex_Lob_Error err;
+  Ex_Lob_Error status;
+  Int64 dummyParam = 0;
+  Int64 cliError = -1; 
+  Int32 dummyParam2 = 0;
+  err = ExLobsOper(lobName,
+		   NULL, 0,
+		   hdfsServer, hdfsPort, 
+		   NULL, dummyParam2, 0, dummyParam, 
+                   dummyParam, 0, dummyParam, status, cliError,
+		   lobLoc, Lob_HDFS_File,
+                   (char *)descChunksArray, numEntries, 		  
+		   0,NULL,
+		   Lob_PerformGC, // Lob_GC
+		   Lob_None,
+                   1, // waited op
+		   lobGlob,
+		   0,
+		   NULL, 0
+		   );
+  if (err != LOB_OPER_OK)
+    return -1;
+  else
+    return 0;
+}
 
+Lng32 ExpLOBinterfaceRestoreLobDataFile(void *& lobGlob, char *hdfsServer, Int32 hdfsPort,char *lobLoc,char *lobName)
+{
+  Ex_Lob_Error err;
+  Ex_Lob_Error status;
   Int64 dummyParam = 0;
   Int64 cliError = -1; 
+  Int32 dummyParam2 = 0;
+  err = ExLobsOper(lobName,
+		   NULL, 0,
+		   hdfsServer, hdfsPort, 
+		   NULL, dummyParam2, 0, dummyParam, 
+                   dummyParam, 0, dummyParam, status, cliError,
+		   lobLoc, Lob_HDFS_File,
+		   NULL, 0,
+		   0,NULL,
+		   Lob_RestoreLobDataFile, // Lob_GC
+		   Lob_None,
+                   1, // waited op
+		   lobGlob,
+		   0,
+		   NULL, 0
+		   );
+  if (err != LOB_OPER_OK)
+    return -1;
+  else
+    return 0;
+}
+Lng32 ExpLOBinterfacePurgeBackupLobDataFile(void *& lobGlob, char *hdfsServer, Int32 hdfsPort,char *lobLoc,char *lobName)
+{
+  Ex_Lob_Error err;
   Ex_Lob_Error status;
-  
-  char dir[100];
-  strcpy(dir, "/h/temp");
-  err = ExLobsOper(dir,
+  Int64 dummyParam = 0;
+  Int64 cliError = -1; 
+  Int32 dummyParam2 = 0;
+  err = ExLobsOper(lobName,
+		   NULL, 0,
+		   hdfsServer, hdfsPort, 
+		   NULL, dummyParam2, 0, dummyParam, 
+                   dummyParam, 0, dummyParam, status, cliError,
+		   lobLoc, Lob_HDFS_File,
+		   NULL, 0, 
+		   0,NULL,
+		   Lob_PurgeBackupLobDataFile, // Lob_GC
+		   Lob_None,
+                   1, // waited op
+		   lobGlob,
+		   0,
+		   NULL, 0
+		   );
+  if (err != LOB_OPER_OK)
+    return -1;
+  else
+    return 0;
+}
+Lng32 ExpLOBinterfaceCleanup(void *& lobGlob, void * lobHeap)
+{
+  Ex_Lob_Error err;
+  Ex_Lob_Error status;
+  Int64 dummyParam = 0;
+  Int64 cliError = -1; 
+  Int32 dummyParam2 = 0;
+  err = ExLobsOper((char *)"dummy",
 		   NULL, 0,
 		   NULL, 0, 
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError,
-		   dir, Lob_HDFS_File,
+		   NULL, Lob_HDFS_File,
 		   NULL, 0, 
 		   0,NULL,
 		   Lob_Cleanup, // Lob_Cleanup
@@ -119,14 +198,15 @@ Lng32 ExpLOBinterfaceCreate(
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam = 0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
   
   err = ExLobsOper(lobName,
 		   NULL, 0, 
 		   lobHdfsServer, lobHdfsPort,
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError, 
 		   lobLoc, (LobsStorage)lobType, //Lob_HDFS_File,
 		   NULL, 0,
@@ -148,17 +228,7 @@ Lng32 ExpLOBinterfaceCreate(
   else
     return 0;
 }
-/*
- * Lng32 ExpLOBinterfaceEmptyDirectory(void * lobGlob,
-                            char * lobName,
-                            char * lobLoc,
-                            Lng32 lobType = (Lng32)Lob_Empty_Directory,
-                            char * lobHdfsServer = NULL,
-                            Lng32 lobHdfsPort = 0,
-                            int    bufferSize = 0,
-                            short  replication =0,
-                            int    blocksize=0);
- */
+
 Lng32 ExpLOBinterfaceEmptyDirectory(
                             void * lobGlob,
                             char * lobName,
@@ -172,14 +242,15 @@ Lng32 ExpLOBinterfaceEmptyDirectory(
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
 
   err = ExLobsOper(lobName,
                    NULL, 0,
                    lobHdfsServer, lobHdfsPort,
-                   NULL, dummyParam, 0, dummyParam,
+                   NULL, dummyParam2, 0, dummyParam,
                    dummyParam, 0, dummyParam, status, cliError,
                    lobLoc, (LobsStorage)lobType, //Lob_HDFS_File,
                    NULL, 0,
@@ -204,14 +275,15 @@ Lng32 ExpLOBinterfaceDrop(void * lobGlob,  char * lobHdfsServer ,
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam = 0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
   
   err = ExLobsOper(lobName,
 		   NULL, 0,
 		   lobHdfsServer, lobHdfsPort, 
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError,
 		   lobLoc, Lob_HDFS_File,
 		   NULL, 0,
@@ -230,21 +302,20 @@ Lng32 ExpLOBinterfaceDrop(void * lobGlob,  char * lobHdfsServer ,
 }
 
 Lng32 ExpLOBInterfacePurgedata(void * lobGlob,  
-			       char * lobHdfsServer ,
-			       Lng32 lobHdfsPort ,char * lobName, char * lobLoc)
+			       char * lobName, char * lobLoc)
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
   
-  //  char dir[100];
-  //  strcpy(dir, "/h/vshah");
+  
   err = ExLobsOper(lobName, 
-		   lobHdfsServer, lobHdfsPort, 
+		   NULL,0, 
 		   NULL, 0,
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError,
 		   lobLoc, Lob_HDFS_File,
 		   NULL, 0,
@@ -271,7 +342,8 @@ Lng32 ExpLOBinterfaceCloseFile(void * lobGlob,
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
   
@@ -280,7 +352,7 @@ Lng32 ExpLOBinterfaceCloseFile(void * lobGlob,
   err = ExLobsOper(lobName, 
 		   NULL, 0, 
 		   lobHdfsServer, lobHdfsPort,
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError,
 		   lobLoc, ls, //Lob_HDFS_File,
 		   NULL, 0,
@@ -309,7 +381,7 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
 
 			    Lng32 handleLen,
 			    char * lobHandle,
-			    Int64 *outHandleLen,
+			    Int32 *outHandleLen,
 			    char * outLobHandle,
 
 			    Int64 blackBoxLen,
@@ -329,6 +401,7 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
 			    Int64  srcLobLen,
 			    Int64 lobMaxSize,
 			    Int64 lobMaxChunkMemSize,
+                            Int64 lobGCLimit,
 			    int   bufferSize ,
 			    short replication ,
 			    int   blockSize)
@@ -373,22 +446,14 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
 		   blackBox, blackBoxLen,
 		   lobMaxSize,
 		   lobMaxChunkMemSize,
+                   lobGCLimit,
 		   bufferSize,
 		   replication,
 		   blockSize
 		   );
 
 
-  if ((err == LOB_OPER_OK) &&
-      (status == LOB_OPER_REQ_IN_PROGRESS))
-    {
-      // this request has been sent and is in progress.
-      // requestTag contains the id of the request.
-      return LOB_ACCESS_PREEMPT;      
-    }
-    
-  // done with the request (success or error)
-  requestTag = -1;
+ 
   if (err != LOB_OPER_OK)
     {
       if ((cliError) &&
@@ -399,14 +464,9 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
     }
 
   descSyskey = outDescSyskey;
-  if ((waitedOp) ||
-      ((Ex_Lob_Error)status == LOB_OPER_OK))
-    {
-      return LOB_ACCESS_SUCCESS;
-    }
-
-  // error. Status contains the error code.
-  return -(short)status;
+  
+ 
+  return 0;
 }
 
 Lng32 ExpLOBInterfaceInsertSelect(void * lobGlob, 
@@ -434,13 +494,14 @@ Lng32 ExpLOBInterfaceInsertSelect(void * lobGlob,
 
   LobsSubOper lso = Lob_Foreign_Lob;
   Ex_Lob_Error status;
-  Int64 dummyParam;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Int64 cliError = -1;
 
   err = ExLobsOper(tgtLobName, 
 		   lobHandle, handleLen, 
 		   NULL, 0, // hdfs server/port
-                   NULL, dummyParam, -1, descSyskey, lobLen,
+                   NULL, dummyParam2, -1, descSyskey, lobLen,
                    0, dummyParam, status, cliError, 
 		   lobStorageLocation, Lob_HDFS_File,
 		   lobData, lobLen, //strlen(srcLobData),
@@ -465,7 +526,7 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
 				  char * lobStorageLocation,
 				  Lng32 handleLen,
 				  char * lobHandle,
-				  Int64 *outHandleLen,
+				  Int32 *outHandleLen,
 				  char * outLobHandle,
 				  Int64 &requestTag,
 				  Int64 xnId,
@@ -482,7 +543,8 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
 				  Int64 srcDescKey, 
 				  Int64 srcDescTS,
 				  Int64 lobMaxSize,
-				  Int64 lobMaxChunkMemSize
+				  Int64 lobMaxChunkMemSize,
+                                  Int64 lobGCLimit
 				  )
 {
   Ex_Lob_Error err;
@@ -512,32 +574,19 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
                    lobGlob,
                    xnId, NULL, 0,
 		   lobMaxSize,
-		   lobMaxChunkMemSize
+		   lobMaxChunkMemSize,
+                   lobGCLimit
                    );
 
-  if ((err == LOB_OPER_OK) &&
-      (status == LOB_OPER_REQ_IN_PROGRESS))
-    {
-      // this request has been sent and is in progress.
-      // requestTag contains the id of the request.
-      return LOB_ACCESS_PREEMPT;      
-    }
+  
     
-  // done with the request (success or error)
-  requestTag = -1;
   if (err != LOB_OPER_OK)
     {
       return -(short)err;
     }
 
-  if ((waitedOp) ||
-      ((Ex_Lob_Error)status == LOB_OPER_OK))
-    {
-      return LOB_ACCESS_SUCCESS;
-    }
 
-  // error. Status contains the error code.
-  return -(short)status;
+  return 0;
 }
 
 Lng32 ExpLOBInterfaceUpdate(void * lobGlob, 
@@ -548,7 +597,7 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
 			    char * lobStorageLocation,
 			    Lng32 handleLen,
 			    char * lobHandle,
-			    Int64 *outHandleLen,
+			    Int32 *outHandleLen,
 			    char * outLobHandle,
 			    Int64 &requestTag,
 			    Int64 xnId,
@@ -565,7 +614,8 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
 			    Int64 srcDescKey, 
 			    Int64 srcDescTS,
 			    Int64 lobMaxSize ,
-			    Int64 lobMaxChunkMemSize )
+			    Int64 lobMaxChunkMemSize,
+                            Int64 lobGCLimit)
 {
   Ex_Lob_Error err;
 
@@ -596,32 +646,20 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
                    xnId, 
 		   NULL, 0,
 		   lobMaxSize,
-		   lobMaxChunkMemSize
+		   lobMaxChunkMemSize,
+                   lobGCLimit
                    );
 
-  if ((err == LOB_OPER_OK) &&
-      (status == LOB_OPER_REQ_IN_PROGRESS))
-    {
-      // this request has been sent and is in progress.
-      // requestTag contains the id of the request.
-      return LOB_ACCESS_PREEMPT;      
-    }
+  
     
-  // done with the request (success or error)
-  requestTag = -1;
   if (err != LOB_OPER_OK)
     {
       return -(short)err;
     }
 
-  if ((waitedOp) ||
-      ((Ex_Lob_Error)status == LOB_OPER_OK))
-    {
-      return LOB_ACCESS_SUCCESS;
-    }
 
-  // error. Status contains the error code.
-  return -(short)status;
+  
+  return 0;
 }
 
 Lng32 ExpLOBInterfaceDelete(void * lobGlob, 
@@ -639,7 +677,8 @@ Lng32 ExpLOBInterfaceDelete(void * lobGlob,
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
 
@@ -655,7 +694,7 @@ Lng32 ExpLOBInterfaceDelete(void * lobGlob,
   err = ExLobsOper(lobName, 
 		   lobHandle, handleLen, 
 		   lobHdfsServer, lobHdfsPort, // hdfs server/port
-                   NULL, dummyParam, 
+                   NULL, dummyParam2, 
 		   descSyskey, dummyParam, 
 		   dummyParam,
 		   requestTag, requestTag,
@@ -671,29 +710,14 @@ Lng32 ExpLOBInterfaceDelete(void * lobGlob,
 		   NULL, 0
 		   );
 
-  if ((err == LOB_OPER_OK) &&
-      (status == LOB_OPER_REQ_IN_PROGRESS))
-    {
-      // this request has been sent and is in progress.
-      // requestTag contains the id of the request.
-      return LOB_ACCESS_PREEMPT;      
-    }
     
-  // done with the request (success or error)
-  requestTag = -1;
   if (err != LOB_OPER_OK)
     {
       return -(short)err;
     }
 
-  if ((waitedOp) ||
-      ((Ex_Lob_Error)status == LOB_OPER_OK))
-    {
-      return LOB_ACCESS_SUCCESS;
-    }
 
-  // error. Status contains the error code.
-  return -(short)status;
+  return 0;
 
 }
 
@@ -719,15 +743,14 @@ Lng32 ExpLOBInterfaceSelect(void * lobGlob,
 			    )
 {
   Ex_Lob_Error err;
-
-  Int64 dummyParam;
   Ex_Lob_Error status;
+  Int64 dummyParam=0;
+  Int32 dummyParam2 = 0;
   Int64 cliError;
   
   LobsOper lo;
-  if (checkStatus)
-    lo = Lob_Check_Status;
-  else if (lobHandle == NULL)
+  
+   if (lobHandle == NULL)
     {
       requestTag = -1;
       lo = Lob_ReadDataSimple;
@@ -743,7 +766,7 @@ Lng32 ExpLOBInterfaceSelect(void * lobGlob,
   err = ExLobsOper(lobName, 
 		   lobHandle, handleLen, 
 		   lobHdfsServer, lobHdfsPort,
-                   NULL, dummyParam, 
+                   NULL, dummyParam2, 
 		   srcOffset, dummyParam, 
 		   outLen,
                    requestTag, requestTag,
@@ -759,17 +782,10 @@ Lng32 ExpLOBInterfaceSelect(void * lobGlob,
 		   NULL, 0,
 		   0,
 		   lobMaxMemChunkLen,
-		   0,0,0,inputFlags
+		   0,0,0,0,inputFlags
 		   );
 
-  if ((err == LOB_OPER_OK) &&
-      (status == LOB_OPER_REQ_IN_PROGRESS))
-    {
-      // this request has been sent and is in progress.
-      // requestTag contains the id of the request.
-      return LOB_ACCESS_PREEMPT;      
-    }
-
+  
   // done with the request (success or error)
   requestTag = -1;
   if (err != LOB_OPER_OK)
@@ -777,14 +793,9 @@ Lng32 ExpLOBInterfaceSelect(void * lobGlob,
       return -(short)err;
     }
 
-  if ((waitedOp) ||
-      ((Ex_Lob_Error)status == LOB_OPER_OK))
-    {
-      return LOB_ACCESS_SUCCESS;
-    }
 
   // error. Status contains the error code.
-  return -(short)status;
+  return 0;
 }
 
 Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob, 
@@ -794,7 +805,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
 				  char * lobHdfsServer,
 				  Lng32 lobHdfsPort,
 
-				  Int64 handleLen, 
+				  Int32 handleLen, 
 				  char * lobHandle,
 
 				  Int64 cursorBytes,
@@ -815,6 +826,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
   Ex_Lob_Error err;
   
   Int64 dummyParam = 0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError;
   
@@ -853,7 +865,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
   err = ExLobsOper(lobName, 
 		   lobHandle, handleLen, 
 		   lobHdfsServer, lobHdfsPort,
-                   NULL, dummyParam, 
+                   NULL, dummyParam2, 
 		   srcOffset, dummyParam, 
 		   outLen,
                    requestTag, requestTag,
@@ -866,7 +878,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
                    waitedOp,
 		   lobGlob,
 		   0,
-		   NULL, 0,0,0,0,0,0,
+		   NULL, 0,0,0,0,0,0,0,
                    openType
 		   );
 
@@ -888,14 +900,15 @@ Lng32 ExpLOBinterfaceStats(
 {
   Ex_Lob_Error err;
 
-  Int64 dummyParam;
+  Int64 dummyParam= 0;
+  Int32 dummyParam2 = 0;
   Ex_Lob_Error status;
   Int64 cliError = -1;
   
   err = ExLobsOper(lobName,
 		   NULL, 0, 
 		   lobHdfsServer, lobHdfsPort,
-		   NULL, dummyParam, 0, dummyParam, 
+		   NULL, dummyParam2, 0, dummyParam, 
                    dummyParam, 0, dummyParam, status, cliError, 
 		   lobLoc, (LobsStorage)lobType, 
 		   (char*)lobStats, 0,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBinterface.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBinterface.h b/core/sql/exp/ExpLOBinterface.h
index 646d846..26f2ad4 100644
--- a/core/sql/exp/ExpLOBinterface.h
+++ b/core/sql/exp/ExpLOBinterface.h
@@ -98,9 +98,7 @@ Lng32 ExpLOBinterfaceDrop(void * lobGlob,
 			  char * lobName,
 			  char * lobLoc);
 
-Lng32 ExpLOBInterfacePurgedata(void * lobGlob, 
-			       char * lobHdfsServer ,
-			       Lng32 lobHdfsPort ,
+Lng32 ExpLOBInterfacePurgedata(void * lobGlob, 			      
 			       char * lobName,
 			       char * lobLoc);
 
@@ -135,7 +133,7 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
 
 			    Lng32 handleLen,
 			    char * lobHandle,
-			    Int64 * outHandleLen,
+			    Int32 * outHandleLen,
 			    char * outLobHandle,
 
 			    Int64 blackBoxLen,
@@ -156,6 +154,7 @@ Lng32 ExpLOBInterfaceInsert(void * lobGlob,
 			    Int64  srcLobLen  = 0,
 			    Int64 lobMaxSize = 0,
 			    Int64 lobMaxChunkMemSize = 0,
+                            Int64 lobGCLimit = 0,
 			    int    bufferSize = 0,
 			    short  replication =0,
 			    int    blocksize=0
@@ -168,7 +167,7 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
 			    char * lobLocation,
 			    Lng32 handleLen,
 			    char * lobHandle,
-			    Int64 *outHandleLen,
+			    Int32 *outHandleLen,
 			    char * outLobHandle,
 			    Int64 &requestTag,
 			    Int64 xnId,	
@@ -188,7 +187,8 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
 			    Int64 srcDescKey, 
 			    Int64 srcDescTS,
 			    Int64 lobMaxSize = 0,
-			    Int64 lobMaxChunkMemSize = 0);
+			    Int64 lobMaxChunkMemSize = 0,
+                            Int64 lobGCLimit = 0);
 
 Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob, 
 				  char * lobHdfsServer ,
@@ -197,7 +197,7 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
 				  char * lobLocation,
 				  Lng32 handleLen,
 				  char * lobHandle,
-				  Int64 *outHandleLen,
+				  Int32 *outHandleLen,
 				  char * outLobHandle,
 				  Int64 &requestTag,
 				  Int64 xnId,	
@@ -217,7 +217,8 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
 				  Int64 srcDescKey, 
 				  Int64 srcDescTS,
 				  Int64 lobMaxSize = 0,
-				  Int64 lobMaxChunkMemSize = 0
+				  Int64 lobMaxChunkMemSize = 0,
+                                  Int64 lobGCLimit = 0
 				  );
 
 Lng32 ExpLOBInterfaceDelete(void * lobGlob, 
@@ -260,7 +261,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
 				  char * lobHdfsServer,
 				  Lng32 lobHdfsPort,
 
-				  Int64 handleLen,  
+				  Int32 handleLen,  
 				  char * lobHandle,
 				  Int64 cusrorBytes,
 				  char *cursorId,
@@ -286,6 +287,11 @@ Lng32 ExpLOBinterfaceStats(void * lobGlob,
 
 char * getLobErrStr(Lng32 errEnum);
 
+Lng32 ExpLOBinterfacePerformGC(void *& lobGlob, char *lobName,void *descChunksArray, Int32 numEntries, char *hdfsServer, Int32 hdfsPort,char *LOBlOC,Int64 lobMaxChunkMemSize);
+Lng32 ExpLOBinterfaceRestoreLobDataFile(void *& lobGlob, char *hdfsServer, Int32 hdfsPort,char *lobLoc,char *lobName);
+Lng32 ExpLOBinterfacePurgeBackupLobDataFile(void *& lobGlob,  char *hdfsServer, Int32 hdfsPort,char *lobLoc,char *lobName);
+
+
 Lng32 ExpLOBinterfaceEmptyDirectory(void * lobGlob,
                             char * lobName,
                             char * lobLoc,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBprocess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBprocess.cpp b/core/sql/exp/ExpLOBprocess.cpp
index d456c34..e520c4c 100644
--- a/core/sql/exp/ExpLOBprocess.cpp
+++ b/core/sql/exp/ExpLOBprocess.cpp
@@ -23,8 +23,8 @@
 /* -*-C++-*-
  *****************************************************************************
  *
- * File:         ex_lob.C
- * Description:  class to store and retrieve LOB data.
+ * File:         ExpLOBprocess.cpp
+ * Description:  class to store and retrieve LOB info from mxlobsrvr process.
  *               
  *               
  * Created:      10/29/2012
@@ -35,7 +35,13 @@
  *
  *****************************************************************************
  */
+/*** Note *** This file is currently compiled and creates the mxlobsrvr executable. But the functions in this file are not active or used at this point. Code 
+    maybe added in the near future to offload any tasks like garbage collection, to this process .Hence we are retainign this file as part of the mxlobsrvr 
+infrastructure .If any functionas are added and need to be executed in the 
+mxlobsrvr process, the sqstart/sqstop need to modified to call lobstop and 
+lostart**/
 
+/****************************************************************************/
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -351,85 +357,7 @@ void process_mon_msg(MS_Mon_Msg *msg) {
     }
 }
 
-Ex_Lob_Error ExLob::append(ExLobRequest *request)
-{
-    Ex_Lob_Error err; 
-    Int64 offset;
-    Int64 dummyParam;
-    Lng32 handleOutLen;
-    Lng32 clierr;
-
-    Int64 size = request->getDesc().getSize();
-    offset = request->getDataOffset();
-
-    /* This is done in the master 
-    // allocate a new lob desc
-    err = allocateDesc(size, dummyParam, offset);
-
-    if (err != LOB_OPER_OK)
-      return err;
-
-    request->getDesc().setOffset(offset);
-    */
-
-    clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				      0, 0,
-                                      request->getHandleOut(), &handleOutLen,
-                                      LOB_CLI_INSERT_APPEND, LOB_CLI_ExecImmed,
-                                      &offset, &size,
-                                      &dummyParam, &dummyParam, 
-				      0,
-				      request->getTransId());
-
-    request->setCliError(clierr);
-    
-    return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::update(ExLobRequest *request)
-{
-    Ex_Lob_Error err; 
-    Int64 offset;
-    Int64 dummyParam;
-    Lng32 handleOutLen;
-    Lng32 clierr;
-
-    Int64 size = request->getDesc().getSize();
-    offset = request->getDataOffset();
-    /* sss this is done in the master
-    // allocate a new lob desc
-    err = allocateDesc(size, dummyParam, offset);
-
-    if (err != LOB_OPER_OK)
-      return err;
-
-    request->getDesc().setOffset(offset);
-    */
-    clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				      0, 0,
-                                      request->getHandleOut(), &handleOutLen,
-                                      LOB_CLI_UPDATE_UNIQUE, LOB_CLI_ExecImmed,
-                                      &offset, &size,
-                                      &dummyParam, &dummyParam, 
-				      0,
-				      request->getTransId());
-
-    request->setCliError(clierr);
-    
-    return LOB_OPER_OK;
-}
 
-Ex_Lob_Error ExLob::putDesc(ExLobDesc &desc, Int64 descNum) 
-{
-  /*  Ex_Lob_Error err = LOB_OPER_OK;
-
-    Lng32 offset = sizeof(ExLobDescHeader) + sizeof(ExLobDesc) * descNum;
-    if (pwrite(fdDesc_, &desc, sizeof(ExLobDesc), offset) == -1) {
-       return LOB_DESC_WRITE_ERROR;
-    }
-  */
-    return LOB_OPER_OK;
-}
 
 Ex_Lob_Error ExLob::getDesc(ExLobRequest *request) 
 {
@@ -452,242 +380,14 @@ Ex_Lob_Error ExLob::getDesc(ExLobRequest *request)
 
    request->setHandleOutLen(handleOutLen);
    request->setBlackBoxLen(blackBoxLen);
-   request->getDesc().setOffset(offset);
-   request->getDesc().setSize(size);
-   request->setCliError(clierr);
-
-   return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::delDesc(ExLobRequest *request)
-{ 
-    Ex_Lob_Error err; 
-    Int64 offset;
-    Int64 dummyParam;
-    Lng32 handleOutLen;
-    Lng32 clierr;
-
-    clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				      0, 0,
-                                      (char *)&dummyParam, (Lng32 *)&dummyParam,
-                                      LOB_CLI_DELETE, LOB_CLI_ExecImmed,
-                                      &dummyParam, &dummyParam,
-                                      &dummyParam, &dummyParam, 
-				      0,
-				      request->getTransId());
-
-    request->setCliError(clierr);
-    
-    return LOB_OPER_OK;
-}
-
-/*Ex_Lob_Error ExLob::purgeLob()
-{
-    Ex_Lob_Error err = LOB_OPER_OK;
-
-    close(fdDesc_);
-    fdDesc_ = -1;
-
-    if (remove(lobDescFile_) != 0) {
-      return LOB_DESC_FILE_DELETE_ERROR;
-    }
-
-    return LOB_OPER_OK;
-    } */
-
-Ex_Lob_Error ExLob::purgeLob()
-{
-    Ex_Lob_Error err = LOB_OPER_OK;
-
-    hdfsCloseFile(fs_,fdDesc_);
-    fdDesc_ = NULL;
-
-    if (hdfsDelete(fs_,lobDescFile_,0) != 0) {
-      return LOB_DESC_FILE_DELETE_ERROR;
-    }
-
-    return LOB_OPER_OK;
-}
-
-/*Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset)
-{
-    Ex_Lob_Error err = LOB_OPER_OK;
-
-
-    err = lockDesc();
-    if (err != LOB_OPER_OK)
-      return err;
-    ExLobDescHeader header;
-
-	 if (pread(fdDesc_, &header, sizeof(ExLobDescHeader), 0) == -1) {
-	   flock(fdDesc_, LOCK_UN);
-	   return LOB_DESC_HEADER_READ_ERROR;
-	 }
-
-    if (header.getAvailSize() >= size) {
-      descNum = header.getFreeDesc(); 
-      dataOffset = header.getDataOffset();
-      header.incFreeDesc();
-      header.decAvailSize(size);
-      header.incDataOffset(size);
-
-      if (pwrite(fdDesc_, &header, sizeof(ExLobDescHeader), 0) == -1) {
-        err = LOB_DESC_HEADER_WRITE_ERROR;
-      }
-
-    }
-    else {
-      err = LOB_DATA_FILE_FULL_ERROR;
-    }
-   
-
-    ExLobDesc desc(dataOffset, size, descNum);
-    if (pwrite(fdDesc_, &desc, sizeof(ExLobDesc), 
-        sizeof(ExLobDescHeader) + sizeof(ExLobDesc) * descNum) == -1) {
-      return LOB_DESC_WRITE_ERROR;
-    }
-
-    err = unlockDesc();
-    if (err != LOB_OPER_OK)
-      return err;
-
-    return err;
-} */
-
-   
-
-Ex_Lob_Error ExLob::insertDesc(ExLobRequest *request) 
-{
-   Ex_Lob_Error err;
-   Lng32 clierr;
-   Int64 dummyParam;
-   Lng32 handleOutLen = 0;
-   Lng32 blackBoxLen = 0;
-   Int64 offset = request->getDataOffset();
-   Int64 size = request->getDesc().getSize();
-
-   blackBoxLen = request->getBlackBoxLen();
-   clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				     request->getBlackBox(), &blackBoxLen,
-                                     request->getHandleOut(), &handleOutLen,
-                                     LOB_CLI_INSERT, LOB_CLI_ExecImmed,
-                                     &offset, &size,
-                                     &dummyParam, &dummyParam, 
-				     0,
-				     request->getTransId());
-
-   request->setHandleOutLen(handleOutLen);
-   request->setBlackBoxLen(blackBoxLen);
    request->setCliError(clierr);
 
    return LOB_OPER_OK;
 }
 
-Ex_Lob_Error ExLob::selectCursorDesc(ExLobRequest *request) 
-{
-   Ex_Lob_Error err;
-   Int64 dummyParam;
-   void *cliInterface = NULL;
-   cursor_t cursor;
-   int clierr;
-
-   clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(),
-				     0, 0,
-                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
-                                     LOB_CLI_SELECT_CURSOR, LOB_CLI_ExecImmed,
-                                     &dummyParam, &dummyParam,
-                                     &dummyParam, &dummyParam, 
-				     &cliInterface,
-				     request->getTransId());
-
-   cursor.cliInterface_ = cliInterface;
-   // these are only used in library, but initialize them here anyway.
-   cursor.bytesRead_ = -1;
-   cursor.descOffset_ = -1;
-   cursor.descSize_ = -1;
-   cursor.eod_ = false; 
-
-   lobCursors_it it = lobCursors_.find(string(request->getHandleIn(), request->getHandleInLen()));
 
-   if (it == lobCursors_.end())
-   {
-      lobCursors_.insert(pair<string, cursor_t>
-                        (string(request->getHandleIn(), request->getHandleInLen()), cursor));                         
-   }
-   else
-   {
-      it->second = cursor;
-   }
 
-   request->setCliError(clierr);
 
-   return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::fetchCursorDesc(ExLobRequest *request) 
-{
-   Ex_Lob_Error err;
-   Int64 dummyParam;
-   Int64 offset = -1;
-   Int64 size = -1;
-   int clierr;
-
-   lobCursors_it it = lobCursors_.find(string(request->getHandleIn(), request->getHandleInLen()));
-
-   if (it == lobCursors_.end())
-   {
-      return LOB_CURSOR_NOT_OPEN;                         
-   }
-
-   void *cliInterface = it->second.cliInterface_;
-
-   clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				     0, 0,
-                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
-                                     LOB_CLI_SELECT_FETCH, LOB_CLI_ExecImmed,
-                                     &offset, &size,
-                                     &dummyParam, &dummyParam, 
-				     &cliInterface,
-				     request->getTransId());
-
-   request->getDesc().setOffset(offset);
-   request->getDesc().setSize(size);
-   request->setCliError(clierr);
-
-   return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::closeCursorDesc(ExLobRequest *request)
-{
-   Ex_Lob_Error err;
-   Int64 dummyParam;
-   int clierr;
-
-   lobCursors_it it = lobCursors_.find(string(request->getHandleIn(), request->getHandleInLen()));
-
-   if (it == lobCursors_.end())
-   {
-      return LOB_CURSOR_NOT_OPEN;                         
-   }
-
-   void *cliInterface = it->second.cliInterface_;
-
-   clierr = SQL_EXEC_LOBcliInterface(request->getHandleIn(), request->getHandleInLen(), 
-				     NULL, NULL,
-                                     (char *)&dummyParam, (Lng32 *)&dummyParam,
-                                     LOB_CLI_SELECT_CLOSE, LOB_CLI_ExecImmed,
-                                     &dummyParam, &dummyParam,
-                                     &dummyParam, &dummyParam, 
-				     &cliInterface,
-				     request->getTransId());
-
-   // do not update cliErr in request because the fetch would have updated it. 
-
-   // remove cursor from the map.
-   err = closeCursor(request->getHandleIn(), request->getHandleInLen());
-
-   return LOB_OPER_OK;
-}
 
 void processRequest(ExLobRequest *request)
 {
@@ -699,7 +399,7 @@ void processRequest(ExLobRequest *request)
      ExLob *lobPtr;
      ExLobDesc desc;
      ExLobDesc *descPtr;
-     Lng32 clierr;\
+     Lng32 clierr;
      Lng32 handleOutLen;
      Int64 size;
     
@@ -728,58 +428,10 @@ void processRequest(ExLobRequest *request)
        }
      switch(request->getType())
      {
-       case Lob_Req_Allocate_Desc:
-	 /* sss no need for this since it's done in master
-	   err = lobPtr->allocateDesc(request->getDesc().getSize(), descNum, dataOffset);
-
-	 request->setDescNumOut(descNum);
-         request->setDataOffset(dataOffset);
-	 */
-         err = lobPtr->insertDesc(request);
-         break;
-
-       case Lob_Req_Append:
-         err = lobPtr->append(request);
-         break;
-
-       case Lob_Req_Select_Cursor:
-         err = lobPtr->selectCursorDesc(request);
-         break;
-
-       case Lob_Req_Fetch_Cursor:
-         err = lobPtr->fetchCursorDesc(request);
-         if (request->getCliError() == 100) {
-            lobPtr->closeCursorDesc(request);
-         }
-         break;
-
-       case Lob_Req_Update:
-         err = lobPtr->update(request);
-         break;
-
        case Lob_Req_Get_Desc:
          err = lobPtr->getDesc(request);
          break;   
 
-       case Lob_Req_Put_Desc:
-         err = lobPtr->putDesc(request->getDesc(), request->getDescNumIn());
-         break;   
-
-       case Lob_Req_Del_Desc:
-         err = lobPtr->delDesc(request);
-         break;
-
-       case Lob_Req_Purge_Desc:
-         /* no op ..it is dropped in mastererr = lobPtr->purgeLob();
-         if (err == LOB_OPER_OK) {
-            err = lobGlobals->delLobPtr(request->getDescFileName());
-	    } */
-         break;
-
-       case Lob_Req_Print:
-         lobPtr->print();
-         break; 
-
        default:
          err = LOB_REQUEST_UNDEFINED_ERROR;
          printf("bad request = %d\n", request->getType());
@@ -788,23 +440,12 @@ void processRequest(ExLobRequest *request)
 
      request->setError(err);
 
-     request->log();
+    
 
      return;
 }
 
-void ExLobRequest::log()
-{
-    printf("req num = %ld\n", getReqNum());
-    printf("req type = %d\n", getType());
-    printf("trans id = %ld\n", getTransId());
-    printf("file = %s\n", getDescFileName());
-    printf("size = %d\n", getDesc().getSize());
-    printf("offset = %d\n", getDesc().getOffset());
-    printf("lob err = %d\n", getError());
-    printf("cli err = %d\n", getCliError());
-    printf("\n");
-}
+
 
 void receive_message(ExLobRequest *request)
 {
@@ -846,27 +487,9 @@ Ex_Lob_Error ExLobGlobals::initialize()
     return LOB_OPER_OK;
 }
 
-/*Ex_Lob_Error ExLob::initialize(char *lobFile)
-{
-    mode_t filePerms = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-    Lng32 openFlags = O_RDWR;
 
-    strcpy(lobDescFile_, lobFile);
 
-    fdDesc_ = open(lobDescFile_, openFlags);
-    if (fdDesc_ == -1) {
-      return LOB_DESC_FILE_OPEN_ERROR;
-    }
-
-    return LOB_OPER_OK;
-    }*/
-
-Ex_Lob_Error ExLob::initialize(char *lobDescFile)
-{
-  // Made this obsolete
 
-    return LOB_OPER_OK;
-}
 
 Ex_Lob_Error ExLobGlobals::getLobPtr(char *lobName, ExLob *& lobPtr)
 {
@@ -909,106 +532,11 @@ Ex_Lob_Error ExLobGlobals::delLobPtr(char *lobName)
 
     return LOB_OPER_OK;
 }
-/*
-Ex_Lob_Error ExLob::lockDesc()
-{
-
-    // get exclusive lock because read and write has to be atomic
-    if (flock(fdDesc_, LOCK_EX) == -1) {
-      return LOB_DESC_FILE_LOCK_ERROR;
-    }
-  
-      return LOB_OPER_OK;
-}
-
-Ex_Lob_Error ExLob::unlockDesc()
-{
-    // release the lock
-
-    if (flock(fdDesc_, LOCK_UN) == -1) {
-      return LOB_DESC_FILE_LOCK_ERROR;
-    }
-
-      return LOB_OPER_OK;
-}
-*/
-
-
-Ex_Lob_Error ExLobDescHeader::print(char *descFileName)
-{
-  printf("Header: \n");
-  printf("freeDesc = %d\n", freeDesc_);
-  printf("dataOffset = %d\n", dataOffset_);
-  printf("avail Size = %d\n", availSize_);
-  return LOB_OPER_OK;
-}
-
-/*Ex_Lob_Error ExLob::print() 
-{
-  // get exclusive lock because read and write has to be atomic
-  if (flock(fdDesc_, LOCK_EX) == -1) {
-    return LOB_DESC_FILE_LOCK_ERROR;
-  }
-
-  ExLobDescHeader header;
-  if (pread(fdDesc_, &header, sizeof(ExLobDescHeader), 0) == -1) {
-    return LOB_DESC_HEADER_READ_ERROR;
-  }
-
-  header.print(NULL);
-
-  printf("Descriptors:\n");
-
-  printf("dNum size state tail prev next nextfree  offset\n");
-  ExLobDesc desc;
-  for (Lng32 numDescs = 0; numDescs < header.getFreeDesc(); numDescs++) {
-    if (pread(fdDesc_, &desc, sizeof(ExLobDesc), 
-               sizeof(ExLobDescHeader) + sizeof(ExLobDesc) * numDescs) == -1) {
-      flock(fdDesc_, LOCK_UN);
-      return LOB_DESC_READ_ERROR;
-    }
-    printf("%4d ", numDescs);
-    desc.print();
-  }
-
-  flock(fdDesc_, LOCK_UN);
-  return LOB_OPER_OK;
-}
-*/
 
-Ex_Lob_Error ExLob::print() 
-{
-  // get exclusive lock because read and write has to be atomic
-  Int32 retval = 0;
-  //get a mutex to prevent multiple updates
-  retval = pthread_mutex_lock(&g_mutex);    
-  if (retval != 0 )
-    return LOB_ALLOC_ERROR;
-  long openFlags = O_RDONLY ;
-  ExLobDescHeader header;
-  if (hdfsPread(fs_,fdDesc_,0, &header, sizeof(ExLobDescHeader)) <= 0) {
-    return LOB_DESC_HEADER_READ_ERROR;
-  }
 
-  header.print(NULL);
 
-  printf("Descriptors:\n");
 
-  printf("dNum size state tail prev next nextfree  offset\n");
-  ExLobDesc desc;
-  for (Lng32 numDescs = 0; numDescs < header.getFreeDesc(); numDescs++) {
-    if (hdfsPread(fs_,fdDesc_, sizeof(ExLobDescHeader) + sizeof(ExLobDesc) * numDescs, &desc, sizeof(ExLobDesc) ) <= 0 ) {
-       pthread_mutex_unlock(&g_mutex);
-      return LOB_DESC_READ_ERROR;
-    }
-    printf("%4d ", numDescs);
-    desc.print();
-  }
 
-  
-  pthread_mutex_unlock(&g_mutex);
-  return LOB_OPER_OK;
-}
 
 
 Lng32 main(Lng32 argc, char *argv[])

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/ExpLOBprocess.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBprocess.h b/core/sql/exp/ExpLOBprocess.h
index b7112d5..2e7ffb8 100644
--- a/core/sql/exp/ExpLOBprocess.h
+++ b/core/sql/exp/ExpLOBprocess.h
@@ -23,7 +23,7 @@
 /* -*-C++-*-
  *****************************************************************************
  *
- * File:         ex_lob.h
+ * File:         ExLOBprocess.h
  * Description:  header file for LOB storage and retrieval
  *               
  *               

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/exp/exp_conv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_conv.cpp b/core/sql/exp/exp_conv.cpp
index ad671c6..2ed1033 100644
--- a/core/sql/exp/exp_conv.cpp
+++ b/core/sql/exp/exp_conv.cpp
@@ -1467,6 +1467,7 @@ ex_expr::exp_return_type convDatetimeDatetime(char * target,
                                              dstEndField,
                                              (short)targetScale,
                                              target,
+                                             targetLen,
                                              validateFlag,
                                              &roundedDown) != 0) {
 


[18/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrMD.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrMD.cpp b/core/sql/sqlcomp/PrivMgrMD.cpp
index 811a71b..df0ca1c 100644
--- a/core/sql/sqlcomp/PrivMgrMD.cpp
+++ b/core/sql/sqlcomp/PrivMgrMD.cpp
@@ -159,24 +159,20 @@ PrivStatus PrivMgrMDAdmin::initializeComponentPrivileges()
    log(__FILE__, "initializing component privileges", -1);
    PrivStatus privStatus = STATUS_GOOD;
 
-   // First, let's start with a clean slate.  Drop all components as well as 
-   // their respective operations and and any privileges granted.  This should be  
-   // a NOP unless PrivMgr metadata was damaged and reintialization is occurring.
-
-   PrivMgrComponents components(metadataLocation_,pDiags_);
-   components.dropAll();
-   
-   // Next, register the component.
-
-   privStatus = components.registerComponentInternal(SQL_OPERATION_NAME,
-                                                     SQL_OPERATIONS_COMPONENT_UID,
-                                                     true,"Component for SQL operations");
-                                             
-   if (privStatus != STATUS_GOOD)
-   {
+  // First register the component.
+  PrivMgrComponents components(metadataLocation_,pDiags_);
+  bool componentExists = (components.exists(SQL_OPERATION_NAME));
+  if (!componentExists)
+  {
+    privStatus = components.registerComponentInternal(SQL_OPERATION_NAME,
+                                                      SQL_OPERATIONS_COMPONENT_UID,
+                                                      true,"Component for SQL operations");
+    if (privStatus != STATUS_GOOD)
+    {
       log(__FILE__, "ERROR: unable to register SQL_OPERATIONS component", -1);
-      return STATUS_ERROR;  
-   }
+      return STATUS_ERROR;
+    }
+  }
       
 // Component is registered, now create all the operations associated with
 // the component.  A grant from the system to the grantee (DB__ROOT) will
@@ -197,7 +193,8 @@ std::string DB__ROOTName(ComUser::getRootUserName());
                                                                PrivMgr::getSQLOperationName(operation),
                                                                codePtr,true,
                                                                PrivMgr::getSQLOperationDescription(operation),
-                                                               DB__ROOTID,DB__ROOTName,-1);
+                                                               DB__ROOTID,DB__ROOTName,-1,
+                                                               componentExists);
                                                        
       if (privStatus == STATUS_GOOD)
          operationCodes.push_back(codePtr); 
@@ -221,7 +218,8 @@ PrivMgrComponentPrivileges componentPrivileges(metadataLocation_,pDiags_);
                                                            ComUser::getRootUserID(),
                                                            ComUser::getRootUserName(),
                                                            ROOT_ROLE_ID,
-                                                           DB__ROOTROLE,-1);
+                                                           DB__ROOTROLE,-1,
+                                                           componentExists);
                                                            
    if (privStatus != STATUS_GOOD)
    {
@@ -241,7 +239,8 @@ std::vector<std::string> CSOperationCodes;
                                                            ComUser::getRootUserID(),
                                                            ComUser::getRootUserName(),
                                                            PUBLIC_USER,
-                                                           PUBLIC_AUTH_NAME,0);
+                                                           PUBLIC_AUTH_NAME,0,
+                                                           componentExists);
                                       
    if (privStatus != STATUS_GOOD)
    {
@@ -342,7 +341,6 @@ PrivStatus PrivMgrMDAdmin::initializeMetadata (
   //     If doesn't need upgrading - done
   //     else - upgrade table 
   bool populateObjectPrivs = false;
-  bool populateRoleGrants = false;
 
   try
   {
@@ -385,8 +383,6 @@ PrivStatus PrivMgrMDAdmin::initializeMetadata (
 
         if (tableDefinition.tableName == PRIVMGR_OBJECT_PRIVILEGES)
           populateObjectPrivs = true;
-        if (tableDefinition.tableName == PRIVMGR_ROLE_USAGE)
-          populateRoleGrants = true;
       }
 
       // upgrade tables
@@ -406,7 +402,7 @@ PrivStatus PrivMgrMDAdmin::initializeMetadata (
     // populate metadata tables
     PrivStatus privStatus = updatePrivMgrMetadata
       (objectsLocation,authsLocation,
-       populateObjectPrivs,populateRoleGrants);
+       populateObjectPrivs);
 
     // if error occurs, drop tables already created
     if (privStatus == STATUS_ERROR)
@@ -560,13 +556,28 @@ PrivStatus PrivMgrMDAdmin::dropMetadata (
     cliInterface.retrieveSQLDiagnostics(pDiags_);
     retcode = STATUS_ERROR;
   }
+
   CmpSeabaseDDLrole role;
-    
-  role.dropStandardRole(DB__ROOTROLE);
-  role.dropStandardRole(DB__HIVEROLE);
-  role.dropStandardRole(DB__HBASEROLE);
-  log(__FILE__, "dropped roles DB__ROOTROLE, DB_HIVEROLE, DB_HBASEROLE", -1);
-   
+  std::vector<std::string> rolesCreated;
+  int32_t numberRoles = sizeof(systemRoles)/sizeof(SystemRolesStruct);
+  for (int32_t i = 0; i < numberRoles; i++)
+  {
+    const SystemRolesStruct &roleDefinition = systemRoles[i];
+
+    // special Auth includes roles that are not registered in the metadata
+    if (roleDefinition.isSpecialAuth)
+      continue;
+
+    role.dropStandardRole(roleDefinition.roleName);
+  }
+
+  int32_t actualSize = 0;
+  char buf[500];
+  ComUser::getRoleList(buf, actualSize, 500);
+  buf[actualSize] = 0;
+  traceMsg = "dropped roles: ";
+  traceMsg + buf;
+  log(__FILE__, traceMsg,  -1);
 
 //TODO: should notify QI
   log (__FILE__, "*** drop authorization completed ***", -1);
@@ -1220,7 +1231,6 @@ int32_t diagsMark = pDiags_->mark();
   return true;
 }
 
-
 // ----------------------------------------------------------------------------
 // method: compareTableDefs
 //
@@ -1471,8 +1481,7 @@ static int32_t renameTable (
 PrivStatus PrivMgrMDAdmin::updatePrivMgrMetadata(
    const std::string &objectsLocation,
    const std::string &authsLocation,
-   const bool shouldPopulateObjectPrivs,
-   const bool shouldPopulateRoleGrants)
+   const bool shouldPopulateObjectPrivs)
    
 {
    std::string traceMsg;
@@ -1486,27 +1495,57 @@ PrivStatus PrivMgrMDAdmin::updatePrivMgrMetadata(
          return STATUS_ERROR;
    }
    
-    
+   // Create any roles.  If this is an upgrade operation, some roles may
+   // already exist, just create any new roles. If this is an initialize
+   // operation, than all system roles are created.
    CmpSeabaseDDLrole role;
-    
-   role.createStandardRole(DB__ROOTROLE,ROOT_ROLE_ID);
-   role.createStandardRole(DB__HIVEROLE,HIVE_ROLE_ID);
-   role.createStandardRole(DB__HBASEROLE,HBASE_ROLE_ID);
-   log(__FILE__, "created roles DB__ROOTROLE, DB__HIVEROLE, and DB__HBASEROLE", -1);
+   std::vector<std::string> rolesCreated;
+   int32_t numberRoles = sizeof(systemRoles)/sizeof(SystemRolesStruct);
+   for (int32_t i = 0; i < numberRoles; i++)
+   {
+     const SystemRolesStruct &roleDefinition = systemRoles[i];
+
+     // special Auth includes roles that are not registered in the metadata
+     if (roleDefinition.isSpecialAuth)
+       continue;
+
+     // returns true is role was created, false if it already existed
+     if (role.createStandardRole(roleDefinition.roleName, roleDefinition.roleID))
+       rolesCreated.push_back(roleDefinition.roleName);
+   }
+
+   // Report the number roles created
+   traceMsg = "created roles ";
+   char buf[MAX_AUTHNAME_LEN + 5];
+   char sep = ' ';
+   for (size_t i = 0; i < rolesCreated.size(); i++)
+   {
+      sprintf(buf, "%c'%s' ", sep, rolesCreated[i].c_str());
+      traceMsg.append(buf);
+      sep = ',';
+   }
+   log(__FILE__, traceMsg, -1);
    
-   if (shouldPopulateRoleGrants)
+   if (rolesCreated.size() > 0)
    {
       PrivMgrRoles role(" ",metadataLocation_,pDiags_);
                         
-      privStatus = role.populateCreatorGrants(authsLocation);
+      privStatus = role.populateCreatorGrants(authsLocation, rolesCreated);
       if (privStatus != STATUS_GOOD)
          return STATUS_ERROR;
    }
+ 
+   // If someone initializes authorization, creates some roles, then drops 
+   // authorization, these roles exist in th system metadata (e.g. AUTHS table)
+   // but all usages are lost, including the initial creator grants.
+   // See if there are any roles that exist in AUTHS but do not have creator 
+   // grants - probably should add creator grants.
+   // TBD
     
-      privStatus = initializeComponentPrivileges();
-   
-      if (privStatus != STATUS_GOOD)
-         return STATUS_ERROR;
+   privStatus = initializeComponentPrivileges();
+  
+   if (privStatus != STATUS_GOOD)
+      return STATUS_ERROR;
       
    // When new components and component operations are added
    // add an upgrade procedure

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrMD.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrMD.h b/core/sql/sqlcomp/PrivMgrMD.h
index a4c3f5e..c52a635 100644
--- a/core/sql/sqlcomp/PrivMgrMD.h
+++ b/core/sql/sqlcomp/PrivMgrMD.h
@@ -301,8 +301,7 @@ class PrivMgrMDAdmin : public PrivMgr
     PrivStatus updatePrivMgrMetadata(
        const std::string &objectsLocation,
        const std::string &authsLocation,
-       const bool shouldPopulateObjectPrivs,
-       const bool shouldPopulateRoleGrants);
+       const bool shouldPopulateObjectPrivs);
 
     PrivStatus upgradeMetadata (
       const PrivMgrTableStruct &tableDefinition,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrRoles.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrRoles.cpp b/core/sql/sqlcomp/PrivMgrRoles.cpp
index 9618f95..08489a1 100644
--- a/core/sql/sqlcomp/PrivMgrRoles.cpp
+++ b/core/sql/sqlcomp/PrivMgrRoles.cpp
@@ -40,6 +40,7 @@
 // CmpCommon.h contains STMTHEAP declaration
 #include "CmpCommon.h"
 #include "CmpDDLCatErrorCodes.h"
+#include "NAUserId.h"
 #include "ComUser.h"
 #include "ComSecurityKey.h"
 
@@ -119,7 +120,9 @@ public:
    
    virtual PrivStatus insert(const PrivMgrMDRow &row);
    
-   PrivStatus insertSelect(const std::string & authsLocation); 
+   PrivStatus insertSelect(
+      const std::string & authsLocation,
+      const std::string & inClause); 
    
    PrivStatus selectAllWhere(
       const std::string & whereClause,
@@ -1296,7 +1299,9 @@ PrivStatus privStatus = myTable.selectCountWhere(whereClause,rowCount);
 // *              the diags area.                                              *
 // *                                                                           *
 // *****************************************************************************
-PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation)
+PrivStatus PrivMgrRoles::populateCreatorGrants(
+  const std::string & authsLocation,
+  const std::vector<std::string> &rolesToAdd)
 
 {
 
@@ -1305,22 +1310,28 @@ PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation
 
    MyTable &myTable = static_cast<MyTable &>(myTable_);
 
-   // See if the table is empty before inserting any rows
+   int32_t numberRoles = sizeof(systemRoles)/sizeof(SystemRolesStruct) - 
+                         NUMBER_SPECIAL_SYSTEM_ROLES;
+
+   // Calculate the number of roles that have already been created
+   int64_t expectedRows = numberRoles - rolesToAdd.size();
 
    std::string whereClause;
 
-   int64_t expectedRows = 0;
+   int64_t foundRows = 0;
 
-   PrivStatus privStatus = myTable.selectCountWhere(whereClause,expectedRows);
+   PrivStatus privStatus = myTable.selectCountWhere(whereClause,foundRows);
 
    if (privStatus == STATUS_ERROR)
       return privStatus;
 
-   if (expectedRows != 0)
+   if (foundRows != expectedRows)
    {
       std::string message ("Found ");
+      message += to_string((long long int)foundRows);
+      message += " rows in ROLE_USAGE table, expecting ";
       message += to_string((long long int)expectedRows);
-      message += " rows in ROLE_USAGE table, expecting 0 rows";
+      message += " rows";
       traceMsg = "ERROR: ";
       traceMsg += message;
       PrivMgr::log(__FILE__, message, -1);
@@ -1329,7 +1340,19 @@ PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation
    }
 
    // insert the rows
-   privStatus = myTable.insertSelect(authsLocation);
+   std::string inClause (" auth_db_name in (");
+   std::string sep = "";
+   for (size_t i = 0; i < rolesToAdd.size(); i++)
+   {
+     inClause.append(sep);
+     inClause.append ("'");
+     inClause.append(rolesToAdd[i]);
+     inClause.append ("'");
+     sep = ",";
+   }
+   inClause += ")";
+
+   privStatus = myTable.insertSelect(authsLocation, inClause);
 
    if (privStatus == STATUS_ERROR)
    {
@@ -1340,7 +1363,7 @@ PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation
       return privStatus;
    }
   
-   // make sure that the number rows inserted match the expected.
+   // make sure that the number rows inserted match the total.
    // get the number of rows inserted
    int64_t insertedRows;
 
@@ -1352,7 +1375,17 @@ PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation
    // get number rows expected
    std::string selectStmt ("SELECT COUNT(*) FROM  ");
 
-   whereClause = " where AUTH_TYPE = 'R'";
+   int32_t actualSize = 0;
+   char buf[500];
+   if (ComUser::getRoleList(buf, actualSize, 500))
+   {
+      PRIVMGR_INTERNAL_ERROR("internal error getting role list");
+      return STATUS_ERROR;
+   }
+   whereClause = " where AUTH_TYPE = 'R' AND AUTH_DB_NAME IN (";
+   whereClause += buf;
+   whereClause += ")";
+
    selectStmt += authsLocation;
    selectStmt += " ";
    selectStmt += whereClause;
@@ -1371,9 +1404,9 @@ PrivStatus PrivMgrRoles::populateCreatorGrants(const std::string & authsLocation
    }
 
    // Check to see if rows inserted match expected rows
-   if (expectedRows != insertedRows)
+   if (numberRoles != insertedRows)
    {
-      std::string message ("Expected to insert ");
+      std::string message ("Expected to find ");
       message += to_string((long long int)expectedRows);
       message += " rows into ROLE_USAGE table, instead ";
       message += to_string((long long int)insertedRows);
@@ -1885,7 +1918,9 @@ char grantorAuthClass[3] = {0};
 // *           *: Insert failed. A CLI error is put into the diags area.       *
 // *                                                                           *
 // *****************************************************************************
-PrivStatus MyTable::insertSelect(const std::string & authsLocation)
+PrivStatus MyTable::insertSelect(
+  const std::string & authsLocation,
+  const std::string & inClause)
 
 {
 
@@ -1894,9 +1929,9 @@ char insertStatement[2000];
    sprintf(insertStatement, "INSERT INTO %s SELECT A1.AUTH_ID, A1.AUTH_DB_NAME, A1.AUTH_CREATOR,"
            "(SELECT AUTH_DB_NAME FROM %s A2 WHERE A2.auth_ID = A1.AUTH_CREATOR)," 
            "(SELECT AUTH_TYPE FROM %s A3 WHERE A3.auth_ID = A1.AUTH_CREATOR),"
-           "-2,'_SYSTEM','%c',-1 FROM %s A1 WHERE A1.AUTH_TYPE = 'R'",
+           "-2,'_SYSTEM','%c',-1 FROM %s A1 WHERE A1.AUTH_TYPE = 'R' AND %s",
            tableName_.c_str(),authsLocation.c_str(),authsLocation.c_str(), 
-           'U',authsLocation.c_str()); 
+           'U',authsLocation.c_str(), inClause.c_str()); 
                
    return CLIImmediate(insertStatement);
                   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/PrivMgrRoles.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgrRoles.h b/core/sql/sqlcomp/PrivMgrRoles.h
index eb8000b..052ce6e 100644
--- a/core/sql/sqlcomp/PrivMgrRoles.h
+++ b/core/sql/sqlcomp/PrivMgrRoles.h
@@ -93,7 +93,9 @@ public:
       
    bool isUserGrantedAnyRole(const int32_t authID);
    
-   PrivStatus populateCreatorGrants(const std::string &authsLocation);      
+   PrivStatus populateCreatorGrants(
+      const std::string &authsLocation,
+      const std::vector<std::string> &rolesToAdd);      
      
    PrivStatus revokeRole(
       const std::vector<int32_t> & roleIDs,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/sqlcomp/nadefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index 37d740f..5d3d08b 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -2073,12 +2073,16 @@ SDDkwd__(ISO_MAPPING,           (char *)SQLCHARSETSTRING_ISO88591),
   // precision but degraded performance.
   SDDkwd__(LIMIT_MAX_NUMERIC_PRECISION,		"SYSTEM"),
 
+ // Size in bytes  used to perform garbage collection  to lob data file 
+  // default size is 5GB   . Change to adjust disk usage. 
+  DDint__(LOB_GC_LIMIT_SIZE,            "5000"),
+  
   DDint__(LOB_HDFS_PORT,                       "0"),
   DD_____(LOB_HDFS_SERVER,                 "default"), 
-   
+ 
    // Size of memoryin bytes  used to perform I/O to lob data file 
   // default size is 512MB   . Change to adjust memory usage. 
-  DDint__(LOB_MAX_CHUNK_MEM_SIZE,            "536870912"), 
+  DDint__(LOB_MAX_CHUNK_MEM_SIZE,            "512"), 
   // default size is 10 G  (10000 M)
   DDint__(LOB_MAX_SIZE,                         "10000"),
   // default size is 32000. Change this to extract more data into memory.
@@ -3295,28 +3299,30 @@ XDDkwd__(SUBQUERY_UNNESTING,			"ON"),
   DDint__(TEST_PASS_ONE_ASSERT_TASK_NUMBER,	"-1"),
   DDint__(TEST_PASS_TWO_ASSERT_TASK_NUMBER,	"-1"),
 
- XDDintN2(TIMEOUT,				"6000"),
+  XDDintN2(TIMEOUT,				"6000"),
  
- DDflt0_(TMUDF_CARDINALITY_FACTOR, "1"),
- DDflt0_(TMUDF_LEAF_CARDINALITY, "1"),
+  DDflt0_(TMUDF_CARDINALITY_FACTOR, "1"),
+  DDflt0_(TMUDF_LEAF_CARDINALITY, "1"),
 
   DDkwd__(TOTAL_RESOURCE_COSTING,               "ON"),
-
+ 
   DDint__(TRAF_ALIGNED_FORMAT_ADD_COL_METHOD,	"2"),
-
- DDkwd__(TRAF_ALIGNED_ROW_FORMAT,                 "OFF"),   
-
+ 
+  DDkwd__(TRAF_ALIGNED_ROW_FORMAT,                 "OFF"),   
+ 
   DDkwd__(TRAF_ALLOW_ESP_COLOCATION,             "OFF"),   
+ 
+  DDkwd__(TRAF_ALLOW_RESERVED_COLNAMES,          "OFF"),   
+ 
+  DDkwd__(TRAF_ALLOW_SELF_REF_CONSTR,                 "ON"),   
 
- DDkwd__(TRAF_ALLOW_SELF_REF_CONSTR,                 "ON"),   
-
- DDkwd__(TRAF_ALTER_COL_ATTRS,                 "ON"),   
+  DDkwd__(TRAF_ALTER_COL_ATTRS,                 "ON"),   
 
- DDkwd__(TRAF_BLOB_AS_VARCHAR,                 "ON"), //set to OFF to enable Lobs support  
+  DDkwd__(TRAF_BLOB_AS_VARCHAR,                 "ON"), //set to OFF to enable Lobs support  
 
- DDkwd__(TRAF_BOOTSTRAP_MD_MODE,                            "OFF"),   
+  DDkwd__(TRAF_BOOTSTRAP_MD_MODE,                            "OFF"),   
 
- DDkwd__(TRAF_CLOB_AS_VARCHAR,                 "ON"), //set to OFF to enable Lobs support  
+  DDkwd__(TRAF_CLOB_AS_VARCHAR,                 "ON"), //set to OFF to enable Lobs support  
 
   DDkwd__(TRAF_COL_LENGTH_IS_CHAR,                 "ON"),   
 
@@ -6983,6 +6989,10 @@ DefaultToken NADefaults::token(Int32 attrEnum,
 	isValid = TRUE;
       break;
 
+    case LOB_GC_LIMIT_SIZE:
+      if (tok >= 0 )
+        isValid=TRUE;
+
     case TRAF_TRANS_TYPE:
       if (tok  == DF_MVCC || tok == DF_SSCC)
         isValid = TRUE;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/ustat/hs_cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_cli.cpp b/core/sql/ustat/hs_cli.cpp
index 7af4584..de94da3 100644
--- a/core/sql/ustat/hs_cli.cpp
+++ b/core/sql/ustat/hs_cli.cpp
@@ -4762,7 +4762,7 @@ Lng32 HSinsertEmptyHist::insert()
 #else // NA_USTAT_USE_STATIC not defined, use dynamic query
     char sbuf[25];
     NAString qry = "SELECT HISTOGRAM_ID, COL_POSITION, COLUMN_NUMBER, COLCOUNT, "
-                          "cast(READ_TIME as char(19)), REASON "
+                          "cast(READ_TIME as char(19) character set iso88591), REASON "
                    "FROM ";
     qry.append(histTable_);
     qry.append(    " WHERE TABLE_UID = ");
@@ -5479,7 +5479,7 @@ static char ppStmtText[] =
 "          when LEFT_CHILD_SEQ_NUM is null then"
 "            '.  '"
 "          else"
-"            cast(cast(LEFT_CHILD_SEQ_NUM as numeric(3)) as char(3))"
+"            cast(cast(LEFT_CHILD_SEQ_NUM as numeric(3)) as char(3) character set iso88591)"
 "        end"
 ""
 // RIGHT CHILD
@@ -5487,11 +5487,11 @@ static char ppStmtText[] =
 "          when RIGHT_CHILD_SEQ_NUM is null then"
 "            '.  '"
 "          else"
-"            cast(cast(RIGHT_CHILD_SEQ_NUM as numeric(3)) as char(3))"
+"            cast(cast(RIGHT_CHILD_SEQ_NUM as numeric(3)) as char(3) character set iso88591)"
 "        end"
 ""
 // SEQUENCE NUMBER
-"      , cast(cast(SEQ_NUM as numeric(3)) as char(3))"
+"      , cast(cast(SEQ_NUM as numeric(3)) as char(3) character set iso88591)"
 ""
 // OPERATOR
 "      , cast(substring(lower(OPERATOR) from 1 for 20) as char(20))"
@@ -5722,13 +5722,13 @@ static char ppStmtText[] =
 "            from 1 for 20) as char(20))"
 ""
 // CARDINALITY
-"      , CAST(CARDINALITY AS CHAR(11))"
+"      , CAST(CARDINALITY AS CHAR(11) character set iso88591)"
 ""
 // OPERATOR COST
-"      , CAST(OPERATOR_COST AS CHAR(11))"
+"      , CAST(OPERATOR_COST AS CHAR(11) character set iso88591)"
 ""
 // TOTAL COST
-"      , CAST(TOTAL_COST AS CHAR(11))"
+"      , CAST(TOTAL_COST AS CHAR(11) character set iso88591)"
 ""
 "        FROM TABLE(EXPLAIN(NULL, '";
 
@@ -5751,6 +5751,8 @@ Lng32 printPlan(SQLSTMT_ID *stmt)
 
     HSLogMan *LM = HSLogMan::Instance();
 
+    HSFuncExecQuery("CQD DEFAULT_CHARSET 'ISO88591'"); // to avoid buffer overruns in row
+
     NAString ppStmtStr = ppStmtText;
     ppStmtStr.append((char *)stmt->identifier).append("')) ORDER BY SEQ_NUM DESC;");
 
@@ -5794,11 +5796,15 @@ Lng32 printPlan(SQLSTMT_ID *stmt)
             LM->Log(LM->msg);
           }
         else if (retcode != 100)
-          HSLogError(retcode);
+          {
+            HSFuncExecQuery("CQD DEFAULT_CHARSET RESET");
+            HSLogError(retcode);
+          }
       }
 
     // ppStmtId will be closed by ~HSCursor if closeStmtNeeded_ is set.
 
+    HSFuncExecQuery("CQD DEFAULT_CHARSET RESET");
     return retcode;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index ff984e1..c323865 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -7743,7 +7743,7 @@ Lng32 HSGlobalsClass::groupListFromTable(HSColGroupStruct*& groupList,
 #else // NA_USTAT_USE_STATIC not defined, use dynamic query
     char sbuf[25];
     NAString qry = "SELECT HISTOGRAM_ID, COL_POSITION, COLUMN_NUMBER, COLCOUNT, "
-                          "cast(READ_TIME as char(19)), REASON "
+                          "cast(READ_TIME as char(19) character set iso88591), REASON "
                    "FROM ";
     qry.append(hstogram_table->data());
     qry.append(    " WHERE TABLE_UID = ");

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/Makefile
----------------------------------------------------------------------
diff --git a/dcs/Makefile b/dcs/Makefile
index 715e6ed..9245415 100644
--- a/dcs/Makefile
+++ b/dcs/Makefile
@@ -52,6 +52,8 @@ LICENSE: ../licenses/LICENSE-dcs
 
 NOTICE: ../NOTICE
 	cp -f $? $@
+	# Add notice file from jython 2.5.3
+	cat ../licenses/not-dcs-bin >> $@
 
 clean:
 	-$(MAVEN) clean | grep ERROR

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/bin/dcs
----------------------------------------------------------------------
diff --git a/dcs/bin/dcs b/dcs/bin/dcs
index 5c506fe..84246d0 100755
--- a/dcs/bin/dcs
+++ b/dcs/bin/dcs
@@ -21,26 +21,6 @@
 #
 #* @@@ END COPYRIGHT @@@
 # */
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-# 
 # The dcs command script.  
 #
 # Environment Variables:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/bin/dcs-config.sh
----------------------------------------------------------------------
diff --git a/dcs/bin/dcs-config.sh b/dcs/bin/dcs-config.sh
index 023521a..aec9e57 100755
--- a/dcs/bin/dcs-config.sh
+++ b/dcs/bin/dcs-config.sh
@@ -21,27 +21,6 @@
 # # @@@ END COPYRIGHT @@@
 # */
 #
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-
-#
 # should not be executable directly
 # also should not be passed any arguments, since we need original $*
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/bin/dcs-daemon.sh
----------------------------------------------------------------------
diff --git a/dcs/bin/dcs-daemon.sh b/dcs/bin/dcs-daemon.sh
index 0061aec..530d356 100755
--- a/dcs/bin/dcs-daemon.sh
+++ b/dcs/bin/dcs-daemon.sh
@@ -21,27 +21,6 @@
 #
 # @@@ END COPYRIGHT @@@
 # */
-#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-# 
 # Runs a DCS command as a daemon.
 #
 # Environment Variables

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/bin/dcs-daemons.sh
----------------------------------------------------------------------
diff --git a/dcs/bin/dcs-daemons.sh b/dcs/bin/dcs-daemons.sh
index 09fc671..1af1cad 100755
--- a/dcs/bin/dcs-daemons.sh
+++ b/dcs/bin/dcs-daemons.sh
@@ -22,26 +22,6 @@
 # @@@ END COPYRIGHT @@@
 # */
 #
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-# 
 
 usage="Usage: dcs-daemons.sh [--config <dcs-confdir>] \
  [--hosts serversfile] [start|stop] command args..."

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/pom.xml
----------------------------------------------------------------------
diff --git a/dcs/pom.xml b/dcs/pom.xml
index 1fb2938..e9b6d11 100644
--- a/dcs/pom.xml
+++ b/dcs/pom.xml
@@ -86,9 +86,9 @@
       </releases>
     </repository>
     <repository>
-      <id>codehaus</id>
-      <name>Codehaus Public</name>
-      <url>http://repository.codehaus.org/</url>
+      <id>codehaus-mule</id>
+      <name>Codehaus Mule Public</name>
+      <url>https://repository-master.mulesoft.org/nexus/content/groups/public/</url>
       <snapshots>
         <enabled>false</enabled>
       </snapshots>
@@ -182,13 +182,6 @@
                              outputdir="${generated.sources}/java"
                              package="org.trafodion.dcs.generated.server"
                              webxml="${build.webapps}/server/WEB-INF/web.xml"/>
-<!-- 
-                <mkdir dir="${build.webapps}/rest/WEB-INF"/>
-                <jspcompiler uriroot="${src.webapps}/rest"
-                             outputdir="${generated.sources}/java"
-                             package="org.trafodion.dcs.generated.rest"
-                             webxml="${build.webapps}/rest/WEB-INF/web.xml"/>
--->
               <exec executable="sh">
                   <arg line="${basedir}/src/saveVersion.sh ${project.version} ${generated.sources}/java"/>
                 </exec>
@@ -498,7 +491,7 @@
   	<compileSource>1.6</compileSource>
     
   	<!-- Dependencies -->
-    <hadoop.version>2.6.0</hadoop.version>
+        <hadoop.version>${env.HADOOP_DEP_VER}</hadoop.version>
   	<commons-cli.version>1.2</commons-cli.version>
   	<commons-codec.version>1.4</commons-codec.version>
   	<commons-io.version>2.1</commons-io.version>
@@ -508,7 +501,7 @@
   	<commons-configuration.version>1.6</commons-configuration.version>
   	<metrics-core.version>2.1.2</metrics-core.version>
   	<guava.version>11.0.2</guava.version>
-  	<jackson.version>1.8.8</jackson.version>
+  	<jackson.version>1.9.13</jackson.version>
   	<jasper.version>5.5.23</jasper.version>
   	<jamon.runtime.version>2.4.0</jamon.runtime.version>
   	<jaxb-api.version>2.1</jaxb-api.version>
@@ -516,7 +509,7 @@
   	<jetty.jspapi.version>6.1.14</jetty.jspapi.version>
   	<jersey.version>1.8</jersey.version>
   	<junit.version>4.10</junit.version>
-  	<slf4j.version>1.4.3</slf4j.version>
+  	<slf4j.version>1.4.3</slf4j.version> 
   	<log4j.version>1.2.16</log4j.version>
   	<zookeeper.version>3.4.5</zookeeper.version>
   	<jython-standalone.version>2.5.3</jython-standalone.version>
@@ -566,16 +559,6 @@
     </dependency>
     
     <!-- General dependencies -->
-  	<dependency>
-      <groupId>com.yammer.metrics</groupId>
-      <artifactId>metrics-core</artifactId>
-      <version>${metrics-core.version}</version>
-  	</dependency>
-  	<dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <version>${guava.version}</version>
-  	</dependency>
     <dependency>
 	  <groupId>org.python</groupId>
 	  <artifactId>jython-standalone</artifactId>
@@ -587,26 +570,11 @@
       <version>${commons-cli.version}</version>
   	</dependency>
     <dependency>
-      <groupId>commons-configuration</groupId>
-      <artifactId>commons-configuration</artifactId>
-      <version>${commons-configuration.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-      <version>${commons-codec.version}</version>
-    </dependency>
-    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <version>${commons-io.version}</version>
     </dependency>
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>${commons-lang.version}</version>
-    </dependency>
-    <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <version>${commons-logging.version}</version>
@@ -671,34 +639,14 @@
       <version>${jetty.jspapi.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>servlet-api-2.5</artifactId>
-      <version>${jetty.jspapi.version}</version>
+      <groupId>displaytag</groupId>
+      <artifactId>displaytag</artifactId>
+      <version>${displaytag.version}</version>
     </dependency>
     <!-- While jackson is also a dependency of both jersey and avro, these
          can bring in jars from different, incompatible versions. We force
          the same version with these dependencies -->
     <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-core-asl</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-mapper-asl</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-jaxrs</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-xc</artifactId>
-      <version>${jackson.version}</version>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
       <version>${slf4j.version}</version>
@@ -708,98 +656,13 @@
       <artifactId>slf4j-log4j12</artifactId>
       <version>${slf4j.version}</version>
     </dependency>
-    <dependency>
-      <!--If this is not in the runtime lib, we get odd
-      "2009-02-27 11:38:39.504::WARN:  failed jsp
-       java.lang.NoSuchFieldError: IS_SECURITY_ENABLED"
-       exceptions out of jetty deploying webapps.
-       St.Ack Thu May 20 01:04:41 PDT 2010
-      -->
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-compiler</artifactId>
-      <version>${jasper.version}</version>
-      <scope>runtime</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>jsp-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>ant</groupId>
-          <artifactId>ant</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-runtime</artifactId>
-      <version>${jasper.version}</version>
-      <scope>runtime</scope>
-      <exclusions>
-       <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>jsp-api</artifactId>
-        </exclusion>          
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
+
     <dependency>
       <groupId>org.jamon</groupId>
       <artifactId>jamon-runtime</artifactId>
       <version>${jamon.runtime.version}</version>
     </dependency>
-
-    <!-- REST dependencies -->
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-      <version>${jersey.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-json</artifactId>
-      <version>${jersey.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-      <version>${jersey.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
-      <version>${jaxb-api.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.xml.stream</groupId>
-          <artifactId>stax-api</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.jettison</groupId>
-      <artifactId>jettison</artifactId>
-      <version>${jettison.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>displaytag</groupId>
-      <artifactId>displaytag</artifactId>
-      <version>${displaytag.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>displaytag</groupId>
-      <artifactId>displaytag-export-poi</artifactId>
-      <version>${displaytag.version}</version>
-    </dependency> 
   </dependencies>
-  
   <profiles>
     <!-- JDBC drivers needed for compile, but not site docs 
 	 This allows turning off dependency on command line (-P '!jdbc') -->

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/assembly/all.xml
----------------------------------------------------------------------
diff --git a/dcs/src/assembly/all.xml b/dcs/src/assembly/all.xml
index 34f2636..391cf11 100644
--- a/dcs/src/assembly/all.xml
+++ b/dcs/src/assembly/all.xml
@@ -78,10 +78,13 @@
       <outputDirectory>/lib</outputDirectory>
       <unpack>false</unpack>
       <scope>runtime</scope>
-      <excludes>
-        <exclude>tomcat:jasper-runtime</exclude>
-        <exclude>org.trafodion:dcs</exclude>
-      </excludes>
+      <includes>
+         <include>displaytag:displaytag</include>
+         <include>org.python:jython-standalone</include>
+         <include>org.slf4j:slf4j-log4j12</include>
+         <include>org.slf4j:slf4j-api</include>
+         <include>org.mortbay.jetty</include>
+      </includes>
       <fileMode>0644</fileMode>
       <directoryMode>0644</directoryMode>
     </dependencySet>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java b/dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java
index 1c35065..719c3d3 100644
--- a/dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java
+++ b/dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java
@@ -61,7 +61,6 @@ import org.trafodion.dcs.util.VersionInfo;
 import org.trafodion.dcs.zookeeper.ZkClient;
 import org.trafodion.dcs.zookeeper.ZKConfig;
 import org.trafodion.dcs.master.listener.ListenerService;
-import org.trafodion.dcs.rest.DcsRest;
 
 public class DcsMaster implements Runnable {
     private static final Log LOG = LogFactory.getLog(DcsMaster.class);
@@ -74,7 +73,6 @@ public class DcsMaster implements Runnable {
     private int port;
     private int portRange;
     private InfoServer infoServer;
-    private DcsRest restServer;
     private String serverName;
     private int infoPort;
     private long startTime;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/master/MasterStatusServlet.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/master/MasterStatusServlet.java b/dcs/src/main/java/org/trafodion/dcs/master/MasterStatusServlet.java
index 6b02123..4a031b8 100644
--- a/dcs/src/main/java/org/trafodion/dcs/master/MasterStatusServlet.java
+++ b/dcs/src/main/java/org/trafodion/dcs/master/MasterStatusServlet.java
@@ -19,27 +19,7 @@ specific language governing permissions and limitations
 under the License.
 
 * @@@ END COPYRIGHT @@@
- */
-/**
- * Copyright 2007 The Apache Software Foundation
- *
- * 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.
- */
-
+*/
 package org.trafodion.dcs.master;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/DcsRest.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/DcsRest.java b/dcs/src/main/java/org/trafodion/dcs/rest/DcsRest.java
deleted file mode 100644
index 046b308..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/DcsRest.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-/**
- * Copyright 2011 The Apache Software Foundation
- *
- * 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.
- */
-
-package org.trafodion.dcs.rest;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.io.IOException;
-import java.lang.InterruptedException;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.net.DNS;
-
-import org.trafodion.dcs.util.DcsConfiguration;
-import org.trafodion.dcs.util.Strings;
-import org.trafodion.dcs.util.VersionInfo;
-
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.thread.QueuedThreadPool;
-
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-
-public class DcsRest implements Runnable, RestConstants {  
-	private static final Log LOG = LogFactory.getLog(DcsRest.class.getName());
-	private Configuration conf;
-	private Thread thrd;
-	private String[] args;
-	private RESTServlet servlet;
-	
-	private static void printUsageAndExit(Options options, int exitCode) {
-		HelpFormatter formatter = new HelpFormatter();
-		formatter.printHelp("bin/dcs rest start", "", options,
-				"\nTo run the REST server as a daemon, execute " +
-				"bin/dcs-daemon.sh start|stop rest [--infoport <port>] [-p <port>] [-ro]\n", true);
-		System.exit(exitCode);
-	}
-
-	public DcsRest(String[] args) {
-		this.args = args;
-		conf = DcsConfiguration.create();
-		
-		Options options = new Options();
-		options.addOption("p", "port", true, "Port to bind to [default: 8080]");
-		options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +
-		"method requests [default: false]");
-		options.addOption(null, "infoport", true, "Port for web UI");
-		
-		try {
-			servlet = RESTServlet.getInstance(conf);
-		} catch (IOException e) {
-			LOG.error("Exception " + e);
-			e.printStackTrace();
-		}
-		
-		CommandLine commandLine = null;
-		try {
-			commandLine = new PosixParser().parse(options, args);
-		} catch (ParseException e) {
-			LOG.error("Could not parse: ", e);
-			printUsageAndExit(options, -1);
-		}
-
-		// check for user-defined port setting, if so override the conf
-		if (commandLine != null && commandLine.hasOption("port")) {
-			String val = commandLine.getOptionValue("port");
-			servlet.getConfiguration().setInt("dcs.rest.port", Integer.valueOf(val));
-			LOG.debug("port set to " + val);
-		}
-
-		// check if server should only process GET requests, if so override the conf
-		if (commandLine != null && commandLine.hasOption("readonly")) {
-			servlet.getConfiguration().setBoolean("dcs.rest.readonly", true);
-			LOG.debug("readonly set to true");
-		}
-
-		// check for user-defined info server port setting, if so override the conf
-		if (commandLine != null && commandLine.hasOption("infoport")) {
-			String val = commandLine.getOptionValue("infoport");
-			servlet.getConfiguration().setInt("dcs.rest.info.port", Integer.valueOf(val));
-			LOG.debug("Web UI port set to " + val);
-		}
-
-		@SuppressWarnings("unchecked")
-		List<String> remainingArgs = commandLine != null ?	commandLine.getArgList() : new ArrayList<String>();
-		if (remainingArgs.size() != 1) {
-			printUsageAndExit(options, 1);
-		}
-
-		String command = remainingArgs.get(0);
-		if ("start".equals(command)) {
-			// continue and start container
-		} else if ("stop".equals(command)) {
-			System.exit(1);
-		} else {
-			printUsageAndExit(options, 1);
-		}
-		
-		thrd = new Thread(this);
-		thrd.start();	
-	}
-	
-	public DcsRest(Configuration conf) {
-		try {
-			servlet = RESTServlet.getInstance(conf);
-		} catch (IOException e) {
-			LOG.error("Exception " + e);
-			e.printStackTrace();
-			return;
-		}
-		
-		thrd = new Thread(this);
-		thrd.start();	
-	}
-
-	public void run() {
-		VersionInfo.logVersion();
-		
-		// set up the Jersey servlet container for Jetty
-		ServletHolder sh = new ServletHolder(ServletContainer.class);
-		sh.setInitParameter(
-				"com.sun.jersey.config.property.resourceConfigClass",
-				ResourceConfig.class.getCanonicalName());
-		sh.setInitParameter("com.sun.jersey.config.property.packages","org.trafodion.dcs.rest");
-
-		// set up Jetty and run the embedded server
-		Server server = new Server();
-
-		Connector connector = new SelectChannelConnector();
-		connector.setPort(servlet.getConfiguration().getInt("dcs.rest.port", 8080));
-		connector.setHost(servlet.getConfiguration().get("dcs.rest.host", "0.0.0.0"));
-
-		server.addConnector(connector);
-
-		// Set the default max thread number to 100 to limit
-		// the number of concurrent requests so that REST server doesn't OOM easily.
-		// Jetty set the default max thread number to 250, if we don't set it.
-		//
-		// Our default min thread number 2 is the same as that used by Jetty.
-		int maxThreads = servlet.getConfiguration().getInt("dcs.rest.threads.max", 100);
-		int minThreads = servlet.getConfiguration().getInt("dcs.rest.threads.min", 2);
-		QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads);
-		threadPool.setMinThreads(minThreads);
-		server.setThreadPool(threadPool);
-		server.setSendServerVersion(false);
-		server.setSendDateHeader(false);
-		server.setStopAtShutdown(true);
-
-		Context context = new Context(server, "/", Context.SESSIONS);
-		context.addServlet(sh, "/*");
-		
-		try {
-			server.start();
-			server.join();
-		} catch (InterruptedException e) {
-			LOG.error("InterruptedException " + e);
-		} catch (Exception e) {
-			LOG.error("Exception " + e);
-		}
-	}
-
-	public static void main(String[] args) throws Exception {
-		DcsRest server = new DcsRest(args);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/GetStatusResponse.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/GetStatusResponse.java b/dcs/src/main/java/org/trafodion/dcs/rest/GetStatusResponse.java
deleted file mode 100644
index c8ee6c4..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/GetStatusResponse.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest;
-
-import java.io.IOException;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlElement;
-
-@XmlRootElement
-public class GetStatusResponse {
-	private String workloadId;
-	
-	public GetStatusResponse(){
-	};
-	
-	public GetStatusResponse(String value){
-		workloadId = value;
-	};
-	
-	@XmlElement
-	public String getWorkloadId() {
-		return workloadId;
-	}
-	
-	public void setWorkloadId(String value) {
-		this.workloadId = value;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/RESTServlet.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/RESTServlet.java b/dcs/src/main/java/org/trafodion/dcs/rest/RESTServlet.java
deleted file mode 100644
index 13016b4..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/RESTServlet.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-/**
- * Copyright 2007 The Apache Software Foundation
- *
- * 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.
- */
-package org.trafodion.dcs.rest;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.StringTokenizer;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.HashMap; 
-import java.util.Map;
-
-import org.trafodion.dcs.Constants;
-import org.trafodion.dcs.rest.ServerConnector;
-import org.trafodion.dcs.rest.RestConstants;
-import org.trafodion.dcs.zookeeper.ZkClient;
-
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.data.Stat;
-import org.apache.zookeeper.ZooDefs;
-
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-/**
- * Singleton class encapsulating global REST servlet state and functions.
- */
-public class RESTServlet implements RestConstants {
-	private static final Log LOG = LogFactory.getLog(RESTServlet.class);
-	private static RESTServlet INSTANCE;
-	private final Configuration conf;
-	private static ZkClient zkc;
-	private String parentZnode;
-	private Map<String, ServerConnector> m = new HashMap<String, ServerConnector>();
-
-	/**
-	 * @return the RESTServlet singleton instance
-	 * @throws IOException
-	 */
-	public synchronized static RESTServlet getInstance() 
-	throws IOException {
-		assert(INSTANCE != null);
-		return INSTANCE;
-	}
-
-	/**
-	 * @param conf Existing configuration to use in rest servlet
-	 * @return the RESTServlet singleton instance
-	 * @throws IOException
-	 */
-	public synchronized static RESTServlet getInstance(Configuration conf)
-	throws IOException {
-		if (INSTANCE == null) {
-			INSTANCE = new RESTServlet(conf);
-		}
-		return INSTANCE;
-	}
-	
-	public ZkClient getZk(){
-		return this.zkc;
-	}
-	
-	public String getParentZnode(){
-		return this.parentZnode;
-	}
-
-	public synchronized static void stop() {
-		if (INSTANCE != null)  INSTANCE = null;
-	}
-
-	/**
-	 * Constructor with existing configuration
-	 * @param conf existing configuration
-	 * @throws IOException.
-	 */
-	RESTServlet(Configuration conf) throws IOException {
-		this.conf = conf;
-		this.parentZnode = conf.get(Constants.ZOOKEEPER_ZNODE_PARENT,Constants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);	   	
-
-	}
-
-	private void openZk() throws IOException {
-		try {
-			if(zkc == null)  
-				zkc = new ZkClient();//CTRL-C...set sessionTimeout,maxRetries,retryIntervalMillis
-			zkc.connect();
-		} catch (InterruptedException e) {
-			LOG.error(e);
-		} 
-	}
-
-	public synchronized List<String> getChildren(String znode) throws IOException {
-		List<String> s = null;
-		
-		try {
-			openZk();
-			s = zkc.getChildren(znode,null);
-		} catch (InterruptedException e) {
-			LOG.error(e);
-		} catch (KeeperException e) {
-			LOG.error(e);
-		} catch (NullPointerException e) {
-			LOG.error(e);
-		}
-		
-		return s;
-	}
-	
-	public synchronized List<String> getMaster() throws IOException {
-		return getChildren(parentZnode + Constants.DEFAULT_ZOOKEEPER_ZNODE_MASTER);
-	} 
-	public synchronized List<String> getRunning() throws IOException {
-		return getChildren(parentZnode + Constants.DEFAULT_ZOOKEEPER_ZNODE_SERVERS_RUNNING);
-	}	
-	public synchronized List<String> getRegistered() throws IOException {
-		return getChildren(parentZnode + Constants.DEFAULT_ZOOKEEPER_ZNODE_SERVERS_REGISTERED);
-	} 
-
-	Configuration getConfiguration() {
-		return conf;
-	}
-
-	/**
-	 * Helper method to determine if server should
-	 * only respond to GET HTTP method requests.
-	 * @return boolean for server read-only state
-	 */
-	boolean isReadOnly() {
-		return getConfiguration().getBoolean("dcs.rest.readonly", false);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/ResourceBase.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/ResourceBase.java b/dcs/src/main/java/org/trafodion/dcs/rest/ResourceBase.java
deleted file mode 100644
index 00d64eb..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/ResourceBase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest;
-
-import java.io.IOException;
-
-public class ResourceBase implements RestConstants {
-
-  RESTServlet servlet;
-
-  public ResourceBase() throws IOException {
-    servlet = RESTServlet.getInstance();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/ResourceConfig.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/ResourceConfig.java b/dcs/src/main/java/org/trafodion/dcs/rest/ResourceConfig.java
deleted file mode 100644
index 32a211e..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/ResourceConfig.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest;
-
-import com.sun.jersey.api.core.PackagesResourceConfig;
-
-public class ResourceConfig extends PackagesResourceConfig {
-  public ResourceConfig() {
-	  super("org.trafodion.dcs.rest");
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/RestConstants.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/RestConstants.java b/dcs/src/main/java/org/trafodion/dcs/rest/RestConstants.java
deleted file mode 100644
index 1eee4df..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/RestConstants.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-/**
- * Copyright 2007 The Apache Software Foundation
- *
- * 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.
- */
-package org.trafodion.dcs.rest;
-
-/**
- * Common constants for org.trafodion.dcs.rest
- */
-public interface RestConstants {
-  public static final String VERSION_STRING = "0.0.2";
-
-  public static final int DEFAULT_MAX_AGE = 60 * 60 * 4;  // 4 hours
-
-  public static final int DEFAULT_LISTEN_PORT = 8080;
-
-  public static final String MIMETYPE_TEXT = "text/plain";
-  public static final String MIMETYPE_HTML = "text/html";
-  public static final String MIMETYPE_XML = "text/xml";
-  public static final String MIMETYPE_BINARY = "application/octet-stream";
-  public static final String MIMETYPE_PROTOBUF = "application/x-protobuf";
-  public static final String MIMETYPE_PROTOBUF_IETF = "application/protobuf";
-  public static final String MIMETYPE_JSON = "application/json";
-
-  public static final String CRLF = "\r\n";
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/RootResource.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/RootResource.java b/dcs/src/main/java/org/trafodion/dcs/rest/RootResource.java
deleted file mode 100644
index eb9d0dc..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/RootResource.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest;
-
-import java.io.*;
-import java.util.*;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.trafodion.dcs.Constants;
-import org.trafodion.dcs.util.Bytes;
-import org.trafodion.dcs.rest.RestConstants;
-
-@Path("/")
-public class RootResource extends ResourceBase {
-	private static final Log LOG = LogFactory.getLog(RootResource.class);
-
-	static CacheControl cacheControl;
-	static {
-		cacheControl = new CacheControl();
-		cacheControl.setNoCache(true);
-		cacheControl.setNoTransform(false);
-	}
-
-	public RootResource() throws IOException {
-		super();
-	}
-	
-	@GET
-	@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON})
-	public Response get(final @Context UriInfo uriInfo) {
-		if (LOG.isDebugEnabled()) {
-			LOG.debug("GET " + uriInfo.getAbsolutePath());
-		}
-		
-		try {
-			return new WorkloadResource().get(uriInfo);
-		} catch (IOException e) {
-			return Response.status(Response.Status.SERVICE_UNAVAILABLE)
-			.type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
-			.build();
-		}
-
-	}
-
-	@Path("/v1/servers")
-	public ServerResource getServerResource() throws IOException {
-		//To test:
-		//curl -v -X GET -H "Accept: application/json" http://<DcsMaster IP address>:8080/v1/servers
-		//
-		return new ServerResource();
-	}
-	
-	@Path("/v1/workloads")
-	public WorkloadResource getWorkloadResource() throws IOException { 
-		//To test:
-		//curl -v -X GET -H "Accept: application/json" http://<DcsMaster IP address>:8080/v1/workloads
-		//
-		return new WorkloadResource();
-	}
-
-	@Path("/v1/version")
-	public VersionResource getVersionResource() throws IOException {
-		//To test:
-		//curl -v -X GET -H "Accept: application/json" http://<DcsMaster IP address>:8080/v1/version
-		//
-		return new VersionResource();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/ServerConnector.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/ServerConnector.java b/dcs/src/main/java/org/trafodion/dcs/rest/ServerConnector.java
deleted file mode 100644
index 35cafd9..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/ServerConnector.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
-* @@@ 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 @@@
- */
-package org.trafodion.dcs.rest;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.StringTokenizer;
-import java.util.List;
-import java.util.Iterator;
-import java.util.HashMap; 
-import java.util.Map;
-
-//import org.apache.avro.ipc.NettyTransceiver;
-//import org.apache.avro.ipc.Transceiver;
-//import org.apache.avro.ipc.specific.SpecificRequestor;
-//import org.apache.avro.AvroRemoteException;
-
-import org.trafodion.dcs.Constants;
-import org.trafodion.dcs.rest.RestConstants;
-import org.trafodion.dcs.zookeeper.ZkClient;
-
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.data.Stat;
-import org.apache.zookeeper.ZooDefs;
-
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-
-public class ServerConnector {
-	private static final Log LOG = LogFactory.getLog(ServerConnector.class);
-//	private Transceiver transceiver;
-//	private Workload client;
-//	private WorkloadListRequest request;
-/*
-	public ServerConnector(String ipAddr,int port) throws IOException {
-		try {
-			transceiver = new NettyTransceiver(new InetSocketAddress(ipAddr,port));
-			client = SpecificRequestor.getClient(Workload.class, transceiver);
-//			request = WorkloadListRequest.newBuilder().build();
-
-		} catch (AvroRemoteException e) {
-			LOG.error(e);
-		} 
-	}
-	
-	public WorkloadListResponse getWorkloadListResponse() {
-		WorkloadListResponse response = null;
-		try {
-			response = client.list(request);
-		} catch (AvroRemoteException e) {
-			LOG.error(e);
-		} 
-		return response;
-	}
-*/	
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/ServerResource.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/ServerResource.java b/dcs/src/main/java/org/trafodion/dcs/rest/ServerResource.java
deleted file mode 100644
index 5a39050..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/ServerResource.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-
-package org.trafodion.dcs.rest;
-
-import java.io.*;
-import java.util.*;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.zookeeper.ZooDefs;
-import org.apache.zookeeper.data.Stat;
-
-import org.trafodion.dcs.Constants;
-import org.trafodion.dcs.util.Bytes;
-import org.trafodion.dcs.zookeeper.ZkClient;
-import org.trafodion.dcs.rest.RestConstants;
-import org.trafodion.dcs.rest.model.ServerModel;
-
-public class ServerResource extends ResourceBase {
-	private static final Log LOG =
-		LogFactory.getLog(ServerResource.class);
-
-	static CacheControl cacheControl;
-	static {
-		cacheControl = new CacheControl();
-		cacheControl.setNoCache(true);
-		cacheControl.setNoTransform(false);
-	}
-
-	/**
-* @@@ 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 @@@
-	 */
-	public ServerResource() throws IOException {
-		super();
-	}
-
-	@GET
-	@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON})
-	public Response get(final @Context UriInfo uriInfo) {
-		if (LOG.isDebugEnabled()) {
-			LOG.debug("GET " + uriInfo.getAbsolutePath());
-		}
-
-		try {
-			List<String> master = servlet.getMaster();
-			List<String> running = servlet.getRunning();
-			List<String> registered = servlet.getRegistered();
-		    
-			ZkClient zkc = servlet.getZk();
-			Stat stat = null;
-			
-		    ServerModel model = new ServerModel();
-		    
-			String data = null;
-
-			if(master != null){
-				for(String znode: master) {
-					data = null;
-					try {
-						data = Bytes.toString(zkc.getData(servlet.getParentZnode() + Constants.DEFAULT_ZOOKEEPER_ZNODE_MASTER + "/" + znode, false, stat));
-					} catch (Exception e) {
-						LOG.error(e);
-					}
-
-					ServerModel.DcsMaster dcsMaster = model.addDcsMaster(znode,data);
-
-					if(running != null){
-						Collections.sort(running);
-						data = null;
-						for(String znodeRun: running) {
-							try {
-								data = Bytes.toString(zkc.getData(servlet.getParentZnode() + Constants.DEFAULT_ZOOKEEPER_ZNODE_SERVERS_RUNNING + "/" + znodeRun, false, stat));
-							} catch (Exception e) {
-								LOG.error(e);
-							}
-							
-							ServerModel.DcsServer dcsServer = dcsMaster.addDcsServer(znodeRun,data);
-
-							if(registered != null){
-								Collections.sort(registered);
-								data = null;
-								for(String znodeReg: registered) {
-									try {
-										data = Bytes.toString(zkc.getData(servlet.getParentZnode() + Constants.DEFAULT_ZOOKEEPER_ZNODE_SERVERS_REGISTERED + "/" + znodeReg, false, stat));
-									} catch (Exception e) {
-										LOG.error(e);
-									}
-									
-									dcsServer.addTrafodionServer(znodeReg,data);
-								}
-							}
-						}
-					}
-				}
-			}
-			
-			ResponseBuilder response = Response.ok(model);
-			response.cacheControl(cacheControl);
-			return response.build();
-		} catch (IOException e) {
-			return Response.status(Response.Status.SERVICE_UNAVAILABLE)
-			.type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
-			.build();
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/VersionResource.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/VersionResource.java b/dcs/src/main/java/org/trafodion/dcs/rest/VersionResource.java
deleted file mode 100644
index caa7985..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/VersionResource.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-
-package org.trafodion.dcs.rest;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.trafodion.dcs.rest.model.VersionModel;
-
-/**
-* @@@ 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 @@@
- */
-public class VersionResource extends ResourceBase {
-
-  private static final Log LOG = LogFactory.getLog(VersionResource.class);
-
-  static CacheControl cacheControl;
-  static {
-    cacheControl = new CacheControl();
-    cacheControl.setNoCache(true);
-    cacheControl.setNoTransform(false);
-  }
-
-  /**
-   * Constructor
-   * @throws IOException
-   */
-  public VersionResource() throws IOException {
-    super();
-  }
-
-  /**
-   * Build a response for a version request.
-   * @param context servlet context
-   * @param uriInfo (JAX-RS context variable) request URL
-   * @return a response for a version request 
-   */
- 
-  @GET
-  @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON})
-  public Response get(final @Context ServletContext context, 
-      final @Context UriInfo uriInfo) {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("GET " + uriInfo.getAbsolutePath());
-    }
-    //servlet.getMetrics().incrementRequests(1);
-    ResponseBuilder response = Response.ok(new VersionModel(context));
-    response.cacheControl(cacheControl);
-    //servlet.getMetrics().incrementSucessfulGetRequests(1);
-    return response.build();
-  }
- 
-  /**
-   * Dispatch to StorageClusterVersionResource
-   */
-/*  
-  @Path("cluster")
-  public StorageClusterVersionResource getClusterVersionResource() 
-      throws IOException {
-    return new StorageClusterVersionResource();
-  }
-*/
-  /**
-   * Dispatch <tt>/version/rest</tt> to self.
-   */
-  @Path("rest")
-  public VersionResource getVersionResource() {
-    return this;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/dcs/src/main/java/org/trafodion/dcs/rest/WorkloadResource.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/rest/WorkloadResource.java b/dcs/src/main/java/org/trafodion/dcs/rest/WorkloadResource.java
deleted file mode 100644
index 6a17110..0000000
--- a/dcs/src/main/java/org/trafodion/dcs/rest/WorkloadResource.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**********************************************************************
-* @@@ 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 @@@
-**********************************************************************/
-package org.trafodion.dcs.rest;
-
-import java.io.*;
-import java.util.*;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.trafodion.dcs.Constants;
-import org.trafodion.dcs.util.Bytes;
-import org.trafodion.dcs.script.ScriptManager;
-import org.trafodion.dcs.script.ScriptContext;
-import org.trafodion.dcs.rest.model.WorkloadListModel;
-import org.trafodion.dcs.rest.model.WorkloadModel;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-public class WorkloadResource extends ResourceBase {
-	private static final Log LOG =
-		LogFactory.getLog(WorkloadResource.class);
-
-	static CacheControl cacheControl;
-	static {
-		cacheControl = new CacheControl();
-		cacheControl.setNoCache(true);
-		cacheControl.setNoTransform(false);
-	}
-
-	/**
-* @@@ 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 @@@
-	 */
-	public WorkloadResource() throws IOException {
-		super();
-
-	}
-
-	@GET
-	@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON})
-	public Response get(final @Context UriInfo uriInfo) {
-		if (LOG.isDebugEnabled()) {
-			LOG.debug("GET " + uriInfo.getAbsolutePath());
-		}
-
-		try {
-//			ScriptContext scriptContext = new ScriptContext();
-//			scriptContext.setScriptName(Constants.JDBCT2UTIL_SCRIPT_NAME);
-//			scriptContext.setCommand(Constants.TRAFODION_REPOS_METRIC_SESSION_TABLE);
-
-			try {
-//				ScriptManager.getInstance().runScript(scriptContext);//This will block while script is running
-			} catch (Exception e) {
-				e.printStackTrace();
-				throw new IOException(e);
-			}
-
-//			StringBuilder sb = new StringBuilder();
-//			sb.append("exit code [" + scriptContext.getExitCode() + "]");
-//			if(! scriptContext.getStdOut().toString().isEmpty()) 
-//				sb.append(", stdout [" + scriptContext.getStdOut().toString() + "]");
-//			if(! scriptContext.getStdErr().toString().isEmpty())
-//				sb.append(", stderr [" + scriptContext.getStdErr().toString() + "]");
-//			LOG.info(sb.toString());
-			
-			JSONArray workloadList = null;
-
-//			try {
-//				if(scriptContext.getExitCode() == 0 && (! scriptContext.getStdOut().toString().isEmpty())) {
-//					workloadList = new JSONArray(scriptContext.getStdOut().toString());
-//				}
-//			} catch (Exception e) {
-//				e.printStackTrace();
-//				LOG.error(e.getMessage());
-//				throw new IOException(e);
-//			}			
-
-			ResponseBuilder response = Response.ok(workloadList);
-			response.cacheControl(cacheControl);
-			return response.build();
-		} catch (IOException e) {
-			return Response.status(Response.Status.SERVICE_UNAVAILABLE)
-			.type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
-			.build();
-		}
-	}
-
-}
\ No newline at end of file


[38/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
update


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

Branch: refs/heads/master
Commit: fcc02bc909db81460615241ba5ebc058808c4242
Parents: 1af3985
Author: mashengchen <ma...@gmail.com>
Authored: Wed Mar 23 08:50:00 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Wed Mar 23 08:50:00 2016 +0000

----------------------------------------------------------------------
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fcc02bc9/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index b01b580..158ab70 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -61,7 +61,7 @@ static bool dropOneTable(
    const char * schemaName, 
    const char * objectName,
    bool isVolatile,
-   bool ifExists,
+//   bool ifExists,
    bool ddlXns);
    
 static bool transferObjectPrivs(
@@ -553,7 +553,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
        dirtiedMetadata = TRUE;
        if (dropOneTable(cliInterface,(char*)catName.data(),
                         (char*)schName.data(),(char*)objName.data(),
-                        isVolatile, FALSE,dropSchemaNode->ddlXns()))
+                        isVolatile ,dropSchemaNode->ddlXns()))
           someObjectsCouldNotBeDropped = true;
      }
    }
@@ -679,7 +679,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
 	       dirtiedMetadata = TRUE;
 	       if (dropOneTable(cliInterface,(char*)catName.data(), 
 				(char*)schName.data(),(char*)objName.data(),
-				isVolatile, FALSE,dropSchemaNode->ddlXns()))
+				isVolatile, dropSchemaNode->ddlXns()))
 		 someObjectsCouldNotBeDropped = true;
 	     }
 	 } 
@@ -709,7 +709,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
 	       // happen to have the same name patterns.
 	       if (dropOneTable(cliInterface,(char*)catName.data(), 
 				(char*)schName.data(),(char*)objName.data(),
-				isVolatile,TRUE, dropSchemaNode->ddlXns()))
+				isVolatile, dropSchemaNode->ddlXns()))
 		 someObjectsCouldNotBeDropped = true;
 	     }
 	 } 
@@ -1221,7 +1221,7 @@ static bool dropOneTable(
    const char * schemaName, 
    const char * objectName,
    bool isVolatile,
-   bool ifExists,
+//   bool ifExists,
    bool ddlXns)
    
 {
@@ -1239,8 +1239,8 @@ Lng32 cliRC = 0;
    if (isVolatile)
       strcpy(volatileString,"VOLATILE");
 
-   if (ifExists)
-     strcpy(ifExistsString,"IF EXISTS");
+//   if (ifExists)
+//     strcpy(ifExistsString,"IF EXISTS");
 
    if (ComIsTrafodionExternalSchemaName(schemaName))
      str_sprintf(buf,"DROP EXTERNAL TABLE \"%s\" FOR \"%s\".\"%s\".\"%s\" CASCADE",
@@ -1266,8 +1266,8 @@ ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF);
    }
    
 // Restore parser flags settings to what they originally were
-   Set_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL);
-   
+   Assign_SqlParser_Flags(savedParserFlags); 
+
    if (cliRC < 0 && cliRC != -CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION)
       someObjectsCouldNotBeDropped = true;
    


[14/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/installer/trafodion_install
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_install b/install/installer/trafodion_install
index 1d9a43e..7fc13dd 100755
--- a/install/installer/trafodion_install
+++ b/install/installer/trafodion_install
@@ -68,7 +68,7 @@ function removePassword {
 
  $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG
  $TRAF_PDSH sudo sed -i '/TRAF_USER_PASSWORD\=/d' $TRAF_CONFIG
- $TRAF_PDSH sudo sed -i '/PASSWORD\=/d' $TRAF_CONFIG
+ $TRAF_PDSH sudo sed -i '/\<PASSWORD\>/d' $TRAF_CONFIG
  $TRAF_PDSH sudo chmod 777 $TRAF_CONFIG
 
 }
@@ -93,7 +93,6 @@ do
    if [[ $hbaseInstalled -eq "1" ]]; then
 
       version=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk {'print$2'})
-
       if [[ $HADOOP_TYPE == "hortonworks" ]]; then
          if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
             if [[ "$HDP_2_3_SUPPORT" == "N" ]]; then
@@ -103,12 +102,11 @@ do
                   exit -1
                fi
             else
-               supportedHBase=${version:0:3} 
-               if [[ $supportedHBase -ne "1.1" ]]; then
-                  echo "***ERROR: HBase installed must be 1.1.x on node $node"
+               supportedHBase=$(echo $version | grep "1.1.2" | wc -l)
+               if [[ $supportedHBase -eq "0" ]]; then
+                  echo "***ERROR: HBase installed must be 1.1.2 on node $node"
                   exit -1
                fi
-               
             fi
          else
             supportedHBase=$(echo $version | grep "0.98.4" | wc -l)
@@ -120,12 +118,18 @@ do
       fi
       if [[ $HADOOP_TYPE == "cloudera" ]]; then
          if [[ $CDH_5_3_HDP_2_2_SUPPORT == "N" ]]; then
-            if [[ $CDH_5_4_SUPPORT == "Y" ]]; then
+            if [[ $CDH_5_4_SUPPORT == "Y" ]] || [[ $CDH_5_5_SUPPORT == "Y" ]]; then
                supportedHBase=$(echo $version | grep "1.0.0" | wc -l)
                if [[ $supportedHBase -eq "0" ]]; then
                   echo "***ERROR: HBase installed must be 1.0.0 on node $node"
                   exit -1
                fi
+               cdhVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | grep "cdh5.4.*" | wc -l)
+               if [[ "$cdhVersion" -ge "1" ]]; then
+                  CDH_VERSION="5.4"
+               else
+                  CDH_VERSION="5.5"
+               fi
             else
                supportedHBase=$(echo $version | grep "0.98.1" | wc -l)
                if [[ $supportedHBase -eq "0" ]]; then
@@ -140,6 +144,7 @@ do
                exit -1
             fi
          fi
+
       fi
       hbaseVersion=$(ssh -q -n $node grep "Version" $HOME/hbaseVersion.txt | sed 's/-.*//' | awk {'print$2'})
       break
@@ -155,6 +160,8 @@ sed -i '/hbaseVersion\=/d' $TRAF_CONFIG
 echo "export hbaseVersion=\"$hbaseVersion\"" >> $TRAF_CONFIG
 sed -i '/HBASE\=/d' $TRAF_CONFIG
 echo "export HBASE=\"$HBASE\"" >> $TRAF_CONFIG
+sed -i '/CDH_VERSION\=/d' $TRAF_CONFIG
+echo "export CDH_VERSION=\"$CDH_VERSION\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
 sudo rm -rf hbaseVersion.txt
 
@@ -248,6 +255,14 @@ export TRAF_CONFIG_FILE=$(basename $TRAF_CONFIG)
 export TRAF_USER="trafodion"
 #==============================================
 #Prechecks 
+#Check if HBase is up
+
+#$LOCAL_WORKDIR/checkHBase
+
+#if [[ "$?" -ne "0" ]]; then
+#   exit -1
+#fi
+
 
 #Check not installing as userid Trafodion
 if [[ "$(whoami)" == "$TRAF_USER" ]]; then
@@ -525,7 +540,6 @@ source $TRAF_CONFIG
 #Check to make sure HBase Version is the correct version
 
 checkHBaseVersion
-
 #==============================================
 # Determine Trafodion version by parsing it
 # from the trafodion_server tar file.
@@ -551,60 +565,9 @@ TRAF_VERSION=$(echo $traf_version | sed -e 's@\([0-9*].*\)-debug@\1@')
 
 # Detect java version
 
-for node in $HADOOP_NODES
-do
-   java_exec=$(ssh -q -n $node ps -C java --noheader -o pid,user,cmd \
-      | grep --max-count=1 " hbase" \
-      | awk '{print $3}' )
-   echo "***DEBUG: HBase's java_exec=$java_exec"
-   if [ ! -z $java_exec ]; then
-      JAVA_VERSION=$(ssh -q -n $node $java_exec -version 2>&1)
-      break;
-      echo "***ERROR: Unable to determine HBase's Java version"
-      echo "***ERROR: Check that HBase is up on node $HOSTNAME"
-      exit -1
-   fi
-done 
-
-if [[ -z $JAVA_VERSION ]]; then
-   echo "***ERROR: Unable to determine HBase's Java version"
-   echo "***ERROR: Check that HBase is up on $CLUSTER_NAME"
-   exit -1
-else
-   JAVA_VERSION=$(echo $JAVA_VERSION \
-      | grep version \
-      | awk '{print $3}' \
-      | sed -e 's@"@@g')
-fi
-
-# test for java 1.7
-java_17=$(echo $JAVA_VERSION | grep "1.7." | wc -l)
-java_18=$(echo $JAVA_VERSION | grep "1.8." | wc -l)
-
-# if not java 1.7 then test for java 1.6
-if [ "$java_17" == "0" ] && [ "$java_18" == "0" ]; then
-   java_16=$(echo $JAVA_VERSION | grep "1.6." | wc -l)
-
-   # if not 1.7 nor 1.6 then we have a problem
-   if [ "$java_16" == "0" ]; then
-      echo "***ERROR: Unsupported HBase java version.  HBase java version must be 1.6 or 1.7"
-      exit -1
-   else
-      JAVA_VERSION="1.6"
-   fi
-else
-   if [[ $java_17 == "0" ]]; then
-      JAVA_VERSION="1.8"
-   else
-      JAVA_VERSION="1.7"
-   fi
-fi
-
 sudo chmod 777 $TRAF_CONFIG
 sed -i '/TRAF_VERSION\=/d' $TRAF_CONFIG
 echo "export TRAF_VERSION=\"$TRAF_VERSION\"" >> $TRAF_CONFIG
-sed -i '/JAVA_VERSION\=/d' $TRAF_CONFIG
-echo "export JAVA_VERSION=\"$JAVA_VERSION\"" >> $TRAF_CONFIG
 sudo chmod 777 $TRAF_CONFIG
 #==============================================
 # Run trafodion_setup
@@ -665,7 +628,6 @@ $TRAF_PDSH sudo chmod 777 $LOCAL_WORKDIR
 copyConfig
 fixPermissions
 
-
 $LOCAL_WORKDIR/traf_sqconfig
 if [ $? != 0 ]; then
    echo "***ERROR: traf_sqconfig script failed."
@@ -767,6 +729,7 @@ if [[ "$LDAP_SECURITY" == "Y" ]]; then
       fi
    fi
 fi
+
 #=============================================
 #Run trafodion_mods
 
@@ -804,6 +767,8 @@ fi
 
 echo "***INFO: Trafodion Mods ran successfully."
 
+#Get HBaseSite.xml information 
+$LOCAL_WORKDIR/parseHBaseSite.py
 #==============================================
 #Install Trafodion
 echo
@@ -841,7 +806,6 @@ if [[ $START_ALL == "Y" ]]; then
      exit -1
   fi
 fi
-
 #==============================================
 MODS_COMPLETE="N"
 sudo chmod 777 $TRAF_CONFIG

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/install/traf_tools_setup.sh
----------------------------------------------------------------------
diff --git a/install/traf_tools_setup.sh b/install/traf_tools_setup.sh
index 84a4825..956cd59 100755
--- a/install/traf_tools_setup.sh
+++ b/install/traf_tools_setup.sh
@@ -45,6 +45,7 @@
 # Thrift: Communications and data serialization tool
 # Maven: Build tool that is only installed if compatible version does not exist
 # log4cxx: standard logging framework for C++
+# hadoop: shared libraries for libhadoop, libhdfs, and hdfs header file
 #
 # Script can be modified to meet the needs of your environment
 # May need root or SUDO access to install tools in desired location
@@ -65,29 +66,26 @@ function Usage {
 
 # -----------------------------------------------------------------------------
 # function: downloadSource - downloads and un-tars the requested file
-#    $1 - tar file to download 
-#    $2 - directory where source is untarred
+#    $1 - tar file URL to download
+#    $2 - directory where source is untarred (leave empty to skip untar)
 #
-# Suggestion:  instead use a single argument $1 and figure out the name of the
-#              file to extract with basename $1
 # -----------------------------------------------------------------------------
 function downloadSource
 {
-  # currently only tar files ending in "tar.gz" and "tgz" are recognized
-  TARSUFFIX="tar.gz"
-  if [[ ! $1 == *$"$TARSUFFIX" ]]; then
-    TARSUFFIX="tgz"
-  fi
+  URL="$1"
+  SRCDIR="$2"
+  TARFILE="${URL##*/}"
 
-  if [ ! -e $BASEDIR/$2.$TARSUFFIX ]; then
-    wget $1  >>$LOGFILE 2>&1
+  if [ ! -e $BASEDIR/$TARFILE ]; then
+    wget $URL  >>$LOGFILE 2>&1
+    echo "INFO:   downloaded tar file: $TARFILE " | tee -a $LOGFILE
   else
-    echo "INFO:   tar file already downloaded, step skipped" | tee -a $LOGFIL
+    echo "INFO:   tar file already downloaded, step skipped" | tee -a $LOGFILE
   fi
 
-  if [ ! -e $BASEDIR/$2 ]; then
-    tar -xzf $BASEDIR/$2.$TARSUFFIX
-    echo "INFO:   downloaded tar file: $2.$TARSUFFIX " | tee -a $LOGFILE
+  if [ ! -e $BASEDIR/$SRCDIR ]; then
+    cd $BASEDIR
+    tar -xzf $BASEDIR/$TARFILE
   else
     echo "INFO:   source tree already exists" | tee -a $LOGFILE
   fi
@@ -156,6 +154,11 @@ if [ "$BASEDIR" == "" ]; then
   Usage;
   exit 1;
 fi
+# handle relative path
+if [[ ! $BASEDIR =~ ^/ ]]
+then
+  BASEDIR=$(pwd)/$BASEDIR
+fi
 
 if [ ! -d "$BASEDIR" ]; then
   echo
@@ -170,6 +173,11 @@ if [ "$TOOLSDIR" == "" ]; then
   Usage;
   exit 1;
 fi
+# handle relative path
+if [[ ! $TOOLSDIR =~ ^/ ]]
+then
+  TOOLSDIR=$(pwd)/$TOOLSDIR
+fi
 
 if [ ! -d "$TOOLSDIR" ]; then                                                    
   read -p "Tools install directory $TOOLSDIR does not exist, do you want to to create it? y/n : " CREATEDIR
@@ -401,6 +409,24 @@ else
 fi
 
 # -----------------------------------------------------------------------------
+# download hadoop/hdfs libs
+echo
+echo "INFO: Hadoop/HDFS libs on $(date)" | tee -a $LOGFILE
+HVER="2.6.0"
+if [ -d $TOOLSDIR/hadoop-${HVER} ]; then
+  echo "INFO: Hadoop/HDFS is already installed, skipping to next tool" | tee -a $LOGFILE
+else
+  downloadSource http://archive.apache.org/dist/hadoop/common/hadoop-${HVER}/hadoop-${HVER}.tar.gz # no un-tar
+  cd $TOOLSDIR
+  tar -xzf $BASEDIR/hadoop-${HVER}.tar.gz \
+    hadoop-${HVER}/lib/native/libhadoop\*so\* \
+    hadoop-${HVER}/lib/native/libhdfs\*so\* \
+    hadoop-${HVER}/include/hdfs.h
+  echo "INFO:   extraction complete" | tee -a $LOGFILE
+fi
+echo " *********************************************************** " | tee -a $LOGFILE
+
+# -----------------------------------------------------------------------------
 
 echo
 echo "INFO: Waiting for all background builds. This might take a while." | tee -a $LOGFILE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/licenses/lic-clients-bin
----------------------------------------------------------------------
diff --git a/licenses/lic-clients-bin b/licenses/lic-clients-bin
index 8e3b96a..ff9b503 100644
--- a/licenses/lic-clients-bin
+++ b/licenses/lic-clients-bin
@@ -1,7 +1,6 @@
 ===============================================================================
 The binary distribution of Apache Trafodion bundles OpenSSL software. Specifically,
-the Linux ODBC driver is statically linked with OpenSSL libraries. The Windows
-ODBC driver (TFODBC64) also links in OpenSSL libraries.
+the Linux ODBC driver is statically linked with OpenSSL libraries. 
 
 OpenSSL is available under a BSD like license. (http://www.openssl.org/)
 
@@ -167,33 +166,3 @@ MIT like license. (http://site.icu-project.org/)
   this Software without prior written authorization of the copyright holder.
 
 +++++++++++++++++++++++++++++
-
-The binary distribution of Apache Trafodion bundles zlib software. Specifically,
-the Windows ODBC driver (TFODBC64) links in zlib libraries. Zlib is 
-available under the zlib/libpng license.
-
-  zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.8, April 28th, 2013
-
-  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-+++++++++++++++++++++++++++++

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/licenses/lic-dcs-bin
----------------------------------------------------------------------
diff --git a/licenses/lic-dcs-bin b/licenses/lic-dcs-bin
index fdd52ed..96a489d 100644
--- a/licenses/lic-dcs-bin
+++ b/licenses/lic-dcs-bin
@@ -1,9 +1,652 @@
 ===============================================================================
-To Do:
+The binary distribution of Apache Trafodion DCS bundles Jetty software which is
+available under the Apache License Version 2.0 (ALv2), though developed outside
+of the ASF.  The bundled software includes Jetty Server, Jetty Utilities, and
+Glassfish Jasper API (JSP2.1 API).  http://www.eclipse.org/jetty/
+
++++++++++++++++++++++++++++++
+
+The binary distribution of Apache Trafodion DCS bundles SLF4J (Simple Logging
+Facade for Java) software which is available under the MIT/X11 License.
+http://www.slf4j.org
+
+ Copyright (c) 2004-2013 QOS.ch
+ All rights reserved.
+
+ Permission is hereby granted, free  of charge, to any person obtaining
+ a  copy  of this  software  and  associated  documentation files  (the
+ "Software"), to  deal in  the Software without  restriction, including
+ without limitation  the rights to  use, copy, modify,  merge, publish,
+ distribute,  sublicense, and/or sell  copies of  the Software,  and to
+ permit persons to whom the Software  is furnished to do so, subject to
+ the following conditions:
+
+ The  above  copyright  notice  and  this permission  notice  shall  be
+ included in all copies or substantial portions of the Software.
+
+ THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+ EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+ MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
++++++++++++++++++++++++++++++
+
+The binary distribution of Apache Trafodion DCS bundles Display Tag Library
+software which is available under the Artistic License.
+http://displaytag.sf.net
+
+ The Artistic License
+
+ Preamble
+
+  The intent of this document is to state the conditions under which a
+  Package may be copied, such that the Copyright Holder maintains some
+  semblance of artistic control over the development of the package,
+  while giving the users of the package the right to use and distribute
+  the Package in a more-or-less customary fashion, plus the right to make
+  reasonable modifications.
+
+    "Package" refers to the collection of files distributed by the
+    Copyright Holder, and derivatives of that collection of files
+    created through textual modification.
+
+    "Standard Version" refers to such a Package if it has not been
+    modified, or has been modified in accordance with the wishes
+    of the Copyright Holder.
+
+    "Copyright Holder" is whoever is named in the copyright or
+    copyrights for the package.
+
+    "You" is you, if you're thinking about copying or distributing
+    this Package.
+
+    "Reasonable copying fee" is whatever you can justify on the
+    basis of media cost, duplication charges, time of people involved,
+    and so on.  (You will not be required to justify it to the
+    Copyright Holder, but only to the computing community at large
+    as a market that must bear the fee.)
+
+    "Freely Available" means that no fee is charged for the item
+    itself, though there may be fees involved in handling the item.
+    It also means that recipients of the item may redistribute it
+    under the same conditions they received it.
+
+
+  1. You may make and give away verbatim copies of the source form of the
+  Standard Version of this Package without restriction, provided that you
+  duplicate all of the original copyright notices and associated disclaimers.
+
+
+  2. You may apply bug fixes, portability fixes and other modifications
+  derived from the Public Domain or from the Copyright Holder.  A Package
+  modified in such a way shall still be considered the Standard Version.
+
+
+  3. You may otherwise modify your copy of this Package in any way, provided
+  that you insert a prominent notice in each changed file stating how and
+  when you changed that file, and provided that you do at least ONE of the
+  following:
+
+    a) place your modifications in the Public Domain or otherwise make them
+      Freely Available, such as by posting said modifications to Usenet or
+      an equivalent medium, or placing the modifications on a major archive
+      site such as ftp.uu.net, or by allowing the Copyright Holder to include
+      your modifications in the Standard Version of the Package.
+
+    b) use the modified Package only within your corporation or organization.
+
+    c) rename any non-standard executables so the names do not conflict
+      with standard executables, which must also be provided, and provide
+      a separate manual page for each non-standard executable that clearly
+      documents how it differs from the Standard Version.
+
+    d) make other distribution arrangements with the Copyright Holder.
+
+
+  4. You may distribute the programs of this Package in object code or
+  executable form, provided that you do at least ONE of the following:
+
+    a) distribute a Standard Version of the executables and library files,
+      together with instructions (in the manual page or equivalent) on where
+      to get the Standard Version.
+
+    b) accompany the distribution with the machine-readable source of
+      the Package with your modifications.
+
+    c) accompany any non-standard executables with their corresponding
+      Standard Version executables, giving the non-standard executables
+      non-standard names, and clearly documenting the differences in manual
+      pages (or equivalent), together with instructions on where to get
+      the Standard Version.
+
+    d) make other distribution arrangements with the Copyright Holder.
+
+
+  5. You may charge a reasonable copying fee for any distribution of this
+  Package.  You may charge any fee you choose for support of this Package.
+  You may not charge a fee for this Package itself.  However,
+  you may distribute this Package in aggregate with other (possibly
+  commercial) programs as part of a larger (possibly commercial) software
+  distribution provided that you do not advertise this Package as a
+  product of your own.
+
+
+  6. The scripts and library files supplied as input to or produced as
+  output from the programs of this Package do not automatically fall
+  under the copyright of this Package, but belong to whomever generated
+  them, and may be sold commercially, and may be aggregated with this
+  Package.
+
+
+  7. C or perl subroutines supplied by you and linked into this Package
+  shall not be considered part of this Package.
+
+
+  8. The name of the Copyright Holder may not be used to endorse or promote
+  products derived from this software without specific prior written permission.
+
+
+  9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+
+  The End
+
++++++++++++++++++++++++++++++
+
+The binary distribution of Apache Trafodion DCS bundles Jython Standalone
+software which is available under the Python Software License.
+http://www.jython.org
+
+  ====================================
+  The Jython License
+  ====================================
+
+
+  A. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING JYTHON
+  ==============================================================================================================
+
+  PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+  ----------------------------------------------------------------------------------------
+
+  1. This LICENSE AGREEMENT is between the Python Software Foundation
+  ("PSF"), and the Individual or Organization ("Licensee") accessing and
+  otherwise using this software ("Jython") in source or binary form and
+  its associated documentation.
+
+  2. Subject to the terms and conditions of this License Agreement, PSF
+  hereby grants Licensee a nonexclusive, royalty-free, world-wide
+  license to reproduce, analyze, test, perform and/or display publicly,
+  prepare derivative works, distribute, and otherwise use Jython alone
+  or in any derivative version, provided, however, that PSF's License
+  Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2007
+  Python Software Foundation; All Rights Reserved" are retained in
+  Jython alone or in any derivative version prepared by Licensee.
+
+  3. In the event Licensee prepares a derivative work that is based on
+  or incorporates Jython or any part thereof, and wants to make
+  the derivative work available to others as provided herein, then
+  Licensee hereby agrees to include in any such work a brief summary of
+  the changes made to Jython.
+
+  4. PSF is making Jython available to Licensee on an "AS IS"
+  basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+  IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+  DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+  FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF JYTHON WILL NOT
+  INFRINGE ANY THIRD PARTY RIGHTS.
+
+  5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF JYTHON
+  FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+  A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING JYTHON,
+  OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+  6. This License Agreement will automatically terminate upon a material
+  breach of its terms and conditions.
+
+  7. Nothing in this License Agreement shall be deemed to create any
+  relationship of agency, partnership, or joint venture between PSF and
+  Licensee.  This License Agreement does not grant permission to use PSF
+  trademarks or trade name in a trademark sense to endorse or promote
+  products or services of Licensee, or any third party.
+
+  8. By copying, installing or otherwise using Jython, Licensee
+  agrees to be bound by the terms and conditions of this License
+  Agreement.
+
+  Jython 2.0, 2.1 License
+  --------------------------------------------
+
+  Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Jython Developers
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+   - Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the distribution.
+
+   - Neither the name of the Jython Developers nor the names of
+     its contributors may be used to endorse or promote products
+     derived from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+  OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 
-Need to investigate and document licenses for software bundled in:
 
-dcs-2.0.0.jar
-lib/*.jar
+
+  JPython 1.1.x Software License.
+  ______________________________________________________________________
+
+    1. This LICENSE AGREEMENT is between the Corporation for National Research
+       Initiatives, having an office at 1895 Preston White Drive, Reston, VA
+       20191 ("CNRI"), and the Individual or Organization ("Licensee")
+       accessing and using JPython version 1.1.x in source or binary form and
+       its associated documentation as provided herein ("Software").
+
+    2. Subject to the terms and conditions of this License Agreement, CNRI
+       hereby grants Licensee a non-exclusive, non-transferable, royalty-free,
+       world-wide license to reproduce, analyze, test, perform and/or display
+       publicly, prepare derivative works, distribute, and otherwise use the
+       Software alone or in any derivative version, provided, however, that
+       CNRI's License Agreement and CNRI's notice of copyright, i.e.,
+       "Copyright �1996-1999 Corporation for National Research Initiatives;
+       All Rights Reserved" are both retained in the Software, alone or in any
+       derivative version prepared by Licensee.
+
+       Alternatively, in lieu of CNRI's License Agreement, Licensee may
+       substitute the following text (omitting the quotes), provided, however,
+       that such text is displayed prominently in the Software alone or in any
+       derivative version prepared by Licensee: "JPython (Version 1.1.x) is
+       made available subject to the terms and conditions in CNRI's License
+       Agreement. This Agreement may be located on the Internet using the
+       following unique, persistent identifier (known as a handle):
+       1895.22/1006. The License may also be obtained from a proxy server on
+       the Web using the following URL: http://hdl.handle.net/1895.22/1006."
+
+    3. In the event Licensee prepares a derivative work that is based on or
+       incorporates the Software or any part thereof, and wants to make the
+       derivative work available to the public as provided herein, then
+       Licensee hereby agrees to indicate in any such work, in a prominently
+       visible way, the nature of the modifications made to CNRI's Software.
+
+    4. Licensee may not use CNRI trademarks or trade name, including JPython
+       or CNRI, in a trademark sense to endorse or promote products or
+       services of Licensee, or any third party. Licensee may use the mark
+       JPython in connection with Licensee's derivative versions that are
+       based on or incorporate the Software, but only in the form
+       "JPython-based ___________________," or equivalent.
+
+    5. CNRI is making the Software available to Licensee on an "AS IS" basis.
+       CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY
+       OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY
+       REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
+       PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE
+       ANY THIRD PARTY RIGHTS.
+
+    6. CNRI SHALL NOT BE LIABLE TO LICENSEE OR OTHER USERS OF THE SOFTWARE FOR
+       ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
+       USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE
+       THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. SOME STATES DO NOT
+       ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY SO THE ABOVE DISCLAIMER
+       MAY NOT APPLY TO LICENSEE.
+
+    7. This License Agreement may be terminated by CNRI (i) immediately upon
+       written notice from CNRI of any material breach by the Licensee, if the
+       nature of the breach is such that it cannot be promptly remedied; or
+       (ii) sixty (60) days following notice from CNRI to Licensee of a
+       material remediable breach, if Licensee has not remedied such breach
+       within that sixty-day period.
+
+    8. This License Agreement shall be governed by and interpreted in all
+       respects by the law of the State of Virginia, excluding conflict of law
+       provisions. Nothing in this Agreement shall be deemed to create any
+       relationship of agency, partnership, or joint venture between CNRI and
+       Licensee.
+
+    9. By clicking on the "ACCEPT" button where indicated, or by installing,
+       copying or otherwise using the Software, Licensee agrees to be bound by
+       the terms and conditions of this License Agreement.
+
+                                 [ACCEPT BUTTON]
+
+  B. HISTORY OF THE SOFTWARE
+  =======================================================
+
+  JPython was created in late 1997 by Jim Hugunin. Jim was also the
+  primary developer while he was at CNRI. In February 1999 Barry Warsaw
+  took over as primary developer and released JPython version 1.1.
+
+  In October 2000 Barry helped move the software to SourceForge
+  where it was renamed to Jython. Jython 2.0 and 2.1 were developed
+  under the Jython specific license below.
+
+  From the 2.2 release on, Jython contributors have signed
+  Python Software Foundation contributor agreements and releases are
+  covered under the Python Software Foundation license version 2.
+
+  The standard library is covered by the Python Software Foundation
+  license as well. See the Lib/LICENSE file for details.
+
+  The zxJDBC package was written by Brian Zimmer and originally licensed
+  under the GNU Public License.  The package is now covered by the Jython
+  Software License.
+
+  The command line interpreter is covered by the Apache Software
+  License.  See the org/apache/LICENSE file for details.
+
++++++++++++++++++++++++++++++
+
+The binary distribution of Apache Trafodion DCS bundles Glassfish Jasper 2.1
+and Servlet Specification 2.5 API software which is available under the
+CDDL License.
+https://glassfish.dev.java.net
+https://glassfish.dev.java.net/public/CDDLv1.0.html
+
+  COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 1.
+
+  Definitions.
+
+  1.1. Contributor means each individual or entity that creates or contributes
+  to the creation of Modifications.
+
+  1.2. Contributor Version means the combination of the Original Software,
+  prior Modifications used by a Contributor (if any), and the Modifications made
+  by that particular Contributor.
+
+  1.3. Covered Software means (a) the Original Software, or (b) Modifications,
+  or (c) the combination of files containing Original Software with files
+  containing Modifications, in each case including portions thereof.
+
+  1.4. Executable means the Covered Software in any form other than Source Code.
+
+  1.5. Initial Developer means the individual or entity that first makes
+  Original Software available under this License.
+
+  1.6. Larger Work means a work which combines Covered Software or portions
+  thereof with code not governed by the terms of this License.
+
+  1.7. License means this document.
+
+  1.8. Licensable means having the right to grant, to the maximum extent
+  possible, whether at the time of the initial grant or subsequently acquired,
+  any and all of the rights conveyed herein.
+
+  1.9. Modifications means the Source Code and Executable form of any of the
+  following: A. Any file that results from an addition to, deletion from or
+  modification of the contents of a file containing Original Software or previous
+  Modifications; B. Any new file that contains any part of the Original Software
+  or previous Modification; or C. Any new file that is contributed or otherwise
+  made available under the terms of this License.
+
+  1.10. Original Software means the Source Code and Executable form of computer
+  software code that is originally released under this License.
+
+  1.11. Patent Claims means any patent claim(s), now owned or hereafter
+  acquired, including without limitation, method, process, and apparatus claims,
+  in any patent Licensable by grantor.
+
+  1.12. Source Code means (a) the common form of computer software code in
+  which modifications are made and (b) associated documentation included in or
+  with such code.
+
+  1.13. You (or Your) means an individual or a legal entity exercising rights
+  under, and complying with all of the terms of, this License. For legal
+  entities, You includes any entity which controls, is controlled by, or is under
+  common control with You. For purposes of this definition, control means (a) the
+  power, direct or indirect, to cause the direction or management of such entity,
+  whether by contract or otherwise, or (b) ownership of more than fifty percent
+  (50%) of the outstanding shares or beneficial ownership of such entity.
+
+  2. License Grants.
+
+   2.1. The Initial Developer Grant. Conditioned upon Your compliance with
+   Section 3.1 below and subject to third party intellectual property claims, the
+   Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive
+   license:
+
+  (a) under intellectual property rights (other than patent or trademark)
+  Licensable by Initial Developer, to use, reproduce, modify, display, perform,
+  sublicense and distribute the Original Software (or portions thereof), with or
+  without Modifications, and/or as part of a Larger Work; and
+
+  (b) under Patent Claims infringed by the making, using or selling of Original
+  Software, to make, have made, use, practice, sell, and offer for sale, and/or
+  otherwise dispose of the Original Software (or portions thereof);
+
+  (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
+  date Initial Developer first distributes or otherwise makes the Original
+  Software available to a third party under the terms of this License;
+
+  (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1)
+  for code that You delete from the Original Software, or (2) for infringements
+  caused by: (i) the modification of the Original Software, or (ii) the
+  combination of the Original Software with other software or devices.
+
+  2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1
+  below and subject to third party intellectual property claims, each Contributor
+  hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+  (a) under intellectual property rights (other than patent or trademark)
+  Licensable by Contributor to use, reproduce, modify, display, perform,
+  sublicense and distribute the Modifications created by such Contributor (or
+  portions thereof), either on an unmodified basis, with other Modifications, as
+  Covered Software and/or as part of a Larger Work; and
+
+  (b) under Patent Claims infringed by the making, using, or selling of
+  Modifications made by that Contributor either alone and/or in combination with
+  its Contributor Version (or portions of such combination), to make, use, sell,
+  offer for sale, have made, and/or otherwise dispose of: (1) Modifications made
+  by that Contributor (or portions thereof); and (2) the combination of
+  Modifications made by that Contributor with its Contributor Version (or
+  portions of such combination).
+
+  (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the
+  date Contributor first distributes or otherwise makes the Modifications
+  available to a third party.
+
+  (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1)
+  for any code that Contributor has deleted from the Contributor Version; (2) for
+  infringements caused by: (i) third party modifications of Contributor Version,
+  or (ii) the combination of Modifications made by that Contributor with other
+  software (except as part of the Contributor Version) or other devices; or (3)
+  under Patent Claims infringed by Covered Software in the absence of
+  Modifications made by that Contributor.
+
+  3. Distribution Obligations.
+
+  3.1. Availability of Source Code. Any Covered Software that You distribute or
+  otherwise make available in Executable form must also be made available in
+  Source Code form and that Source Code form must be distributed only under the
+  terms of this License. You must include a copy of this License with every copy
+  of the Source Code form of the Covered Software You distribute or otherwise
+  make available. You must inform recipients of any such Covered Software in
+  Executable form as to how they can obtain such Covered Software in Source Code
+  form in a reasonable manner on or through a medium customarily used for
+  software exchange.
+
+  3.2. Modifications. The Modifications that You create or to which You
+  contribute are governed by the terms of this License. You represent that You
+  believe Your Modifications are Your original creation(s) and/or You have
+  sufficient rights to grant the rights conveyed by this License.
+
+  3.3. Required Notices. You must include a notice in each of Your
+  Modifications that identifies You as the Contributor of the Modification. You
+  may not remove or alter any copyright, patent or trademark notices contained
+  within the Covered Software, or any notices of licensing or any descriptive
+  text giving attribution to any Contributor or the Initial Developer.
+
+  3.4. Application of Additional Terms. You may not offer or impose any terms
+  on any Covered Software in Source Code form that alters or restricts the
+  applicable version of this License or the recipients rights hereunder. You may
+  choose to offer, and to charge a fee for, warranty, support, indemnity or
+  liability obligations to one or more recipients of Covered Software. However,
+  you may do so only on Your own behalf, and not on behalf of the Initial
+  Developer or any Contributor. You must make it absolutely clear that any such
+  warranty, support, indemnity or liability obligation is offered by You alone,
+  and You hereby agree to indemnify the Initial Developer and every Contributor
+  for any liability incurred by the Initial Developer or such Contributor as a
+  result of warranty, support, indemnity or liability terms You offer.
+
+  3.5. Distribution of Executable Versions. You may distribute the Executable
+  form of the Covered Software under the terms of this License or under the terms
+  of a license of Your choice, which may contain terms different from this
+  License, provided that You are in compliance with the terms of this License and
+  that the license for the Executable form does not attempt to limit or alter the
+  recipients rights in the Source Code form from the rights set forth in this
+  License. If You distribute the Covered Software in Executable form under a
+  different license, You must make it absolutely clear that any terms which
+  differ from this License are offered by You alone, not by the Initial Developer
+  or Contributor. You hereby agree to indemnify the Initial Developer and every
+  Contributor for any liability incurred by the Initial Developer or such
+  Contributor as a result of any such terms You offer.
+
+  3.6. Larger Works. You may create a Larger Work by combining Covered Software
+  with other code not governed by the terms of this License and distribute the
+  Larger Work as a single product. In such a case, You must make sure the
+  requirements of this License are fulfilled for the Covered Software.
+
+  4. Versions of the License.
+
+  4.1. New Versions. Sun Microsystems, Inc. is the initial license steward and
+  may publish revised and/or new versions of this License from time to time. Each
+  version will be given a distinguishing version number. Except as provided in
+  Section 4.3, no one other than the license steward has the right to modify this
+  License.
+
+  4.2. Effect of New Versions. You may always continue to use, distribute or
+  otherwise make the Covered Software available under the terms of the version of
+  the License under which You originally received the Covered Software. If the
+  Initial Developer includes a notice in the Original Software prohibiting it
+  from being distributed or otherwise made available under any subsequent version
+  of the License, You must distribute and make the Covered Software available
+  under the terms of the version of the License under which You originally
+  received the Covered Software. Otherwise, You may also choose to use,
+  distribute or otherwise make the Covered Software available under the terms of
+  any subsequent version of the License published by the license steward.
+
+  4.3. Modified Versions. When You are an Initial Developer and You want to
+  create a new license for Your Original Software, You may create and use a
+  modified version of this License if You: (a) rename the license and remove any
+  references to the name of the license steward (except to note that the license
+  differs from this License); and (b) otherwise make it clear that the license
+  contains terms which differ from this License.
+
+  5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON
+  AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+  INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+  DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+  ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH
+  YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
+  INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+  SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
+  ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED
+  HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+  6. TERMINATION.
+
+  6.1. This License and the rights granted hereunder will terminate
+  automatically if You fail to comply with terms herein and fail to cure such
+  breach within 30 days of becoming aware of the breach. Provisions which, by
+  their nature, must remain in effect beyond the termination of this License
+  shall survive.
+
+  6.2. If You assert a patent infringement claim (excluding declaratory
+  judgment actions) against Initial Developer or a Contributor (the Initial
+  Developer or Contributor against whom You assert such claim is referred to as
+  Participant) alleging that the Participant Software (meaning the Contributor
+  Version where the Participant is a Contributor or the Original Software where
+  the Participant is the Initial Developer) directly or indirectly infringes any
+  patent, then any and all rights granted directly or indirectly to You by such
+  Participant, the Initial Developer (if the Initial Developer is not the
+  Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License
+  shall, upon 60 days notice from Participant terminate prospectively and
+  automatically at the expiration of such 60 day notice period, unless if within
+  such 60 day period You withdraw Your claim with respect to the Participant
+  Software against such Participant either unilaterally or pursuant to a written
+  agreement with Participant.
+
+  6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+  user licenses that have been validly granted by You or any distributor
+  hereunder prior to termination (excluding licenses granted to You by any
+  distributor) shall survive termination.
+
+  7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
+  WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
+  INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED
+  SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+  ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
+  INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK
+  STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL
+  DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE
+  POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO
+  LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO
+  THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT
+  ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+  THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+  8. U.S. GOVERNMENT END USERS. The Covered Software is a commercial item, as
+  that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of commercial
+  computer software (as that term is defined at 48 C.F.R.  252.227-7014(a)(1))
+  and commercial computer software documentation as such terms are used in 48
+  C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
+  227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
+  acquire Covered Software with only those rights set forth herein. This U.S.
+  Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or
+  other clause or provision that addresses Government rights in computer software
+  under this License.
+
+  9. MISCELLANEOUS. This License represents the complete agreement concerning
+  subject matter hereof. If any provision of this License is held to be
+  unenforceable, such provision shall be reformed only to the extent necessary to
+  make it enforceable. This License shall be governed by the law of the
+  jurisdiction specified in a notice contained within the Original Software
+  (except to the extent applicable law, if any, provides otherwise), excluding
+  such jurisdictions conflict-of-law provisions. Any litigation relating to this
+  License shall be subject to the jurisdiction of the courts located in the
+  jurisdiction and venue specified in a notice contained within the Original
+  Software, with the losing party responsible for costs, including, without
+  limitation, court costs and reasonable attorneys fees and expenses. The
+  application of the United Nations Convention on Contracts for the International
+  Sale of Goods is expressly excluded. Any law or regulation which provides that
+  the language of a contract shall be construed against the drafter shall not
+  apply to this License. You agree that You alone are responsible for compliance
+  with the United States export administration regulations (and the export
+  control laws and regulation of any other countries) when You use, distribute or
+  otherwise make available any Covered Software.
+
+  10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the
+  Contributors, each party is responsible for claims and damages arising,
+  directly or indirectly, out of its utilization of rights under this License and
+  You agree to work with Initial Developer and Contributors to distribute such
+  responsibility on an equitable basis. Nothing herein is intended or shall be
+  deemed to constitute any admission of liability.
+
+  NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
+  LICENSE (CDDL) The code released under the CDDL shall be governed by the laws
+  of the State of California (excluding conflict-of-law provisions). Any
+  litigation relating to this License shall be subject to the jurisdiction of the
+  Federal Courts of the Northern District of California and the state courts of
+  the State of California, with venue lying in Santa Clara County, California.
 
 +++++++++++++++++++++++++++++
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/licenses/lic-winodbc-bin
----------------------------------------------------------------------
diff --git a/licenses/lic-winodbc-bin b/licenses/lic-winodbc-bin
new file mode 100644
index 0000000..27ec643
--- /dev/null
+++ b/licenses/lic-winodbc-bin
@@ -0,0 +1,50 @@
+
+The Windows ODBC driver (TFODBC4) is removed from the binary distribution
+of Trafodion clients package.  This is due to inclusion of vcredist_x64.exe.
+See JIRA TRAFODION-1836.
+
+If the license issues with that software are resolved, and the driver is
+added back to the clients binary distribution package, then the license info
+below must be integrated back into lic-clients-bin file.
+
+This only affects binary distribution. This issue does not apply to the source
+distribution of win-odbc or derivative products.
+
+===============================================================================
+The binary distribution of Apache Trafodion bundles OpenSSL software. Specifically,
+the Linux ODBC driver is statically linked with OpenSSL libraries. The Windows
+ODBC driver (TFODBC64) also links in OpenSSL libraries.
+
+(Documented in licenses/lic-clients-bin.)
+
++++++++++++++++++++++++++++++
+
+The binary distribution of Apache Trafodion bundles zlib software. Specifically,
+the Windows ODBC driver (TFODBC64) links in zlib libraries. Zlib is 
+available under the zlib/libpng license.
+
+  zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.8, April 28th, 2013
+
+  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
++++++++++++++++++++++++++++++

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/licenses/not-dcs-bin
----------------------------------------------------------------------
diff --git a/licenses/not-dcs-bin b/licenses/not-dcs-bin
new file mode 100644
index 0000000..f5293e3
--- /dev/null
+++ b/licenses/not-dcs-bin
@@ -0,0 +1,20 @@
+
+Notices for Jython bundled software:
+
+   =========================================================================
+   ==  NOTICE file corresponding to section 4(d) of the Apache License,   ==
+   ==  Version 2.0, in this case for the Apache Xerces Java distribution. ==
+   =========================================================================
+
+   Apache Xerces Java
+   Copyright 1999-2007 The Apache Software Foundation
+
+   This product includes software developed at
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Portions of this software were originally based on the following:
+     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+     - voluntary contributions made by Paul Eng on behalf of the
+       Apache Software Foundation that were originally developed at iClick, Inc.,
+       software copyright (c) 1999.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f723602..7e2bf84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,6 +136,8 @@
     <module>dcs</module>
     <module>core/rest</module>
     <module>docs/command_interface</module>
+    <module>docs/cqd_reference</module>
+    <module>docs/load_transform</module>
     <module>docs/provisioning_guide</module>
     <module>docs/messages_guide</module>
     <module>docs/odb_user</module>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/tools/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
new file mode 100644
index 0000000..be75b9b
--- /dev/null
+++ b/tools/docker/Dockerfile
@@ -0,0 +1,45 @@
+# 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.
+
+FROM centos:centos6.6
+MAINTAINER Trafodion Community <de...@trafodion.incubator.apache.org>
+
+LABEL Vendor="Apache Trafodion (incubating)"
+LABEL version=unstable
+
+# download and install environment dependencies
+RUN	yum install -y epel-release alsa-lib-devel ant ant-nodeps boost-devel cmake \
+	     device-mapper-multipath dhcp flex gcc-c++ gd git glibc-devel \
+       glibc-devel.i686 graphviz-perl gzip java-1.7.0-openjdk-devel \
+  		 apr-devel apr-util-devel \
+       libX11-devel libXau-devel libaio-devel \
+       libcurl-devel libibcm.i686 libibumad-devel libibumad-devel.i686 \
+       libiodbc libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+       libxml2-devel lua-devel lzo-minilzo \
+       net-snmp-devel net-snmp-perl openldap-clients openldap-devel \
+       openldap-devel.i686 openmotif openssl-devel openssl-devel.i686 \
+       openssl-static perl-Config-IniFiles perl-Config-Tiny \
+       perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+       perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+       perl-Time-HiRes protobuf-compiler protobuf-devel \
+       readline-devel saslwrapper sqlite-devel \
+       unixODBC unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+  && yum -y erase pdsh \
+	&& yum clean all
+
+# set environment
+ENV	JAVA_HOME /usr/lib/jvm/java-1.7.0-openjdk.x86_64
+ENV PATH $PATH:$JAVA_HOME/bin

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/tools/docker/build-base-docker.sh
----------------------------------------------------------------------
diff --git a/tools/docker/build-base-docker.sh b/tools/docker/build-base-docker.sh
new file mode 100755
index 0000000..a280321
--- /dev/null
+++ b/tools/docker/build-base-docker.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+BASE_SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+export DOCKER_ENV_VERSION="0.1"
+export BASE_IMAGE_NAME="trafodion/base:${DOCKER_ENV_VERSION}"
+
+pushd ${BASE_SCRIPT_DIR}
+
+docker build --rm=true -t ${BASE_IMAGE_NAME} .
+
+popd

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/tools/docker/start-compile-docker.sh
----------------------------------------------------------------------
diff --git a/tools/docker/start-compile-docker.sh b/tools/docker/start-compile-docker.sh
new file mode 100755
index 0000000..f9697ec
--- /dev/null
+++ b/tools/docker/start-compile-docker.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+source ${SCRIPT_DIR}/build-base-docker.sh
+
+IMAGE_NAME="trafodion/base:${DOCKER_ENV_VERSION}"
+
+if [ "$(uname -s)" == "Linux" ]; then
+  USER_NAME=${SUDO_USER:=$USER}
+  USER_ID=$(id -u "${USER_NAME}")
+  GROUP_ID=$(id -g "${USER_NAME}")
+else # boot2docker uid and gid
+  USER_NAME=$USER
+  USER_ID=1000
+  GROUP_ID=50
+fi
+
+# create user home directory; download and install build tools
+docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
+FROM ${IMAGE_NAME} 
+RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}
+RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
+ENV HOME /home/${USER_NAME}
+RUN cd /home/${USER_NAME} \
+ && mkdir download \
+ && mkdir trafodion-build-tools \
+ && wget https://raw.githubusercontent.com/apache/incubator-trafodion/master/install/traf_tools_setup.sh \
+ && chmod +x traf_tools_setup.sh \
+ && ./traf_tools_setup.sh -d ~/download -i ~/trafodion-build-tools \
+ && rm -fr ./download \
+ && yum install -y qt-devel qt-config
+ENV TOOLSDIR /home/${USER_NAME}/trafodion-build-tools
+ENV PATH $PATH:/home/${USER_NAME}/trafodion-build-tools/apache-maven-3.3.3/bin:/usr/lib64/qt4/bin/
+UserSpecificDocker
+
+# Go to root project folder
+pushd ${SCRIPT_DIR}/../..
+
+docker run -i -t \
+  --rm=true \
+  -w "/home/${USER_NAME}/incubator-trafodion" \
+  -u "${USER_NAME}" \
+  -v "$PWD:/home/${USER_NAME}/incubator-trafodion" \
+  -v "$HOME/.m2:/home/${USER_NAME}/.m2" \
+  --name TrafodionEnv \
+  ${IMAGE_NAME}-${USER_NAME} \
+  bash
+
+popd

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/wms/pom.xml
----------------------------------------------------------------------
diff --git a/wms/pom.xml b/wms/pom.xml
index 0080020..c79985c 100644
--- a/wms/pom.xml
+++ b/wms/pom.xml
@@ -381,7 +381,7 @@
   	
   	
   	<!-- Dependencies -->
-  	<hadoop.version>2.6.0</hadoop.version>   
+  	<hadoop.version>${env.HADOOP_DEP_VER}</hadoop.version>   
   	<commons-cli.version>1.2</commons-cli.version>
   	<commons-codec.version>1.4</commons-codec.version>
   	<commons-io.version>2.1</commons-io.version>


[24/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED014.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED014.SB b/core/sql/regress/executor/EXPECTED014.SB
index ad663f0..2615fc5 100755
--- a/core/sql/regress/executor/EXPECTED014.SB
+++ b/core/sql/regress/executor/EXPECTED014.SB
@@ -12,11 +12,12 @@
 >>log;
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:07 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:23 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -39,11 +40,12 @@ A            B
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:11 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:30 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -66,11 +68,12 @@ A            B
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:15 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:35 2016
 
   (
-    A                                LARGEINT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                LARGEINT DEFAULT NULL
   , B                                DOUBLE PRECISION NO DEFAULT NOT NULL NOT
       DROPPABLE
   )
@@ -94,11 +97,12 @@ A                     B
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:18 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:42 2016
 
   (
-    C                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                INT DEFAULT NULL
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -121,11 +125,12 @@ C            D
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:22 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:46 2016
 
   (
-    C                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                INT DEFAULT NULL
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -148,11 +153,12 @@ C            D
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:26 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:51 2016
 
   (
-    C                                NUMERIC(11, 0) DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                NUMERIC(11, 0) DEFAULT NULL
   , D                                NUMERIC(11, 0) NO DEFAULT NOT NULL NOT
       DROPPABLE
   )
@@ -176,11 +182,12 @@ C                     D
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:29 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:03:55 2016
 
   (
-    C                                NUMERIC(11, 0) DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , C                                NUMERIC(11, 0) DEFAULT NULL
   , D                                NUMERIC(11, 0) NO DEFAULT NOT NULL NOT
       DROPPABLE
   )
@@ -204,11 +211,12 @@ C                     D
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:33 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:04:00 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -234,11 +242,12 @@ A            B
 --- 2 row(s) inserted.
 >>invoke t014t1t;
 
--- Definition of Seabase table CAT.SCH.T014T1T
--- Definition current  Thu Mar 22 15:48:36 2012
+-- Definition of Trafodion table TRAFODION.SCH.T014T1T
+-- Definition current  Thu Feb 25 08:04:04 2016
 
   (
-    A                                INT DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -272,7 +281,7 @@ A            B
 --- 2 row(s) inserted.
 >>showddl t014t1t;
 
-CREATE TABLE CAT.SCH.T014T1T
+CREATE TABLE TRAFODION.SCH.T014T1T
   (
     A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -299,7 +308,7 @@ A            B
 --- 2 row(s) inserted.
 >>showddl t014t1t;
 
-CREATE TABLE CAT.SCH.T014T1T
+CREATE TABLE TRAFODION.SCH.T014T1T
   (
     C                                INT DEFAULT NULL
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -326,7 +335,7 @@ C            D
 --- 2 row(s) inserted.
 >>showddl t014t1t;
 
-CREATE TABLE CAT.SCH.T014T1T
+CREATE TABLE TRAFODION.SCH.T014T1T
   (
     C                                INT DEFAULT NULL
   , D                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -353,7 +362,7 @@ C            D
 --- 2 row(s) inserted.
 >>showddl t014t1t;
 
-CREATE TABLE CAT.SCH.T014T1T
+CREATE TABLE TRAFODION.SCH.T014T1T
   (
     A                                INT DEFAULT NULL
   , B                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -408,7 +417,7 @@ A            B
 
 *** ERROR[15001] A syntax error occurred at or before: 
 create schema tempsch create table t014t1 as select * from t014t1s;
-                                                                  ^ (67 characters from start of SQL statement)
+                           ^ (28 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED016.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED016.SB b/core/sql/regress/executor/EXPECTED016.SB
index 1d60ec5..c6306f5 100644
--- a/core/sql/regress/executor/EXPECTED016.SB
+++ b/core/sql/regress/executor/EXPECTED016.SB
@@ -71,7 +71,8 @@
 -- Definition current  Wed May 14 05:01:26 2014
 
   (
-    A                                NUMERIC(10, 0) UNSIGNED DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                NUMERIC(10, 0) UNSIGNED DEFAULT NULL
   , B                                NUMERIC(18, 0) UNSIGNED NO DEFAULT NOT
       NULL NOT DROPPABLE
   , C                                NUMERIC(20, 0) DEFAULT
@@ -135,6 +136,7 @@ CREATE TABLE TRAFODION.SCH.T016T1
       NULL NOT DROPPABLE
   , C                                NUMERIC(21, 21) DEFAULT NULL
   )
+  PRIMARY KEY (A ASC, B ASC)
 
 --- SQL operation complete.
 >>showddl t016t2;
@@ -382,7 +384,8 @@ A                                          B                      C
 -- Definition current  Wed May 14 05:01:40 2014
 
   (
-    A                                NUMERIC(10, 0) UNSIGNED DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                NUMERIC(10, 0) UNSIGNED DEFAULT NULL
   , B                                NUMERIC(18, 0) UNSIGNED NO DEFAULT NOT
       NULL NOT DROPPABLE
   , C                                NUMERIC(20, 0) DEFAULT NULL
@@ -416,7 +419,8 @@ A                                          B                      C
 -- Definition current  Wed May 14 05:01:42 2014
 
   (
-    JJ                               NUMERIC(128, 0) UNSIGNED DEFAULT NULL
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , JJ                               NUMERIC(128, 0) UNSIGNED DEFAULT NULL
   , KF                               NUMERIC(128, 0) DEFAULT NULL
   )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED122
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED122 b/core/sql/regress/executor/EXPECTED122
index f011381..c372676 100644
--- a/core/sql/regress/executor/EXPECTED122
+++ b/core/sql/regress/executor/EXPECTED122
@@ -65,10 +65,11 @@ A
 >>invoke t122t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Wed Apr 22 14:46:39 2015
+-- Definition current  Thu Feb 25 08:40:12 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
 --- SQL operation complete.
@@ -117,10 +118,11 @@ A
 >>execute s3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Wed Apr 22 14:46:39 2015
+-- Definition current  Thu Feb 25 08:40:13 2016
 
   (
-    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
 --- SQL operation complete.
@@ -176,10 +178,11 @@ iv
 >>invoke t122t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Wed Apr 22 14:46:59 2015
+-- Definition current  Thu Feb 25 08:40:32 2016
 
   (
-    A                                CHAR(4) CHARACTER SET ISO88591 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                CHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 
@@ -226,10 +229,11 @@ iv
 
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Wed Apr 22 14:47:01 2015
+-- Definition current  Thu Feb 25 08:40:34 2016
 
   (
-    A                                CHAR(4) CHARACTER SET ISO88591 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                CHAR(4) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/EXPECTED130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED130 b/core/sql/regress/executor/EXPECTED130
index 342c076..741fcaa 100644
--- a/core/sql/regress/executor/EXPECTED130
+++ b/core/sql/regress/executor/EXPECTED130
@@ -53,9 +53,9 @@ C1
 C1           C2
 -----------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ----------------------------------------
 
-          1  LOBH00000200010520117997292580853919884121437179977294818212317485757218627020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
-          2  LOBH00000200010520117997292580853919884121437180341874318212317485760955694020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
-          3  LOBH00000200010520117997292580853919884121437180704085518212317485764542640020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          1  LOBH00000200010592176192134729966219592176192139496647918212323493795172702020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          2  LOBH00000200010592176192134729966219592176192140030953518212323493800597686020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          3  LOBH00000200010592176192134729966219592176192140527060218212323493805564311020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
 
 --- 3 row(s) selected.
 >>
@@ -333,7 +333,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_txt1.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292583625519884121437206093184618212317486018305654020"TRAFODION"."LOB130"  ' , 'tlob130_txt1.txt');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134733245719592176192171050485618212323494110664949020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_txt1.txt');
 Success. Targetfile :tlob130_txt1.txt  Length : 19
 
 --- SQL operation complete.
@@ -349,7 +349,7 @@ Success. Targetfile :tlob130_txt1.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134733309019592176192176652813118212323494166743790020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep.jpg');
 Success. Targetfile :tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -365,7 +365,7 @@ Success. Targetfile :tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134733309019592176192176652813118212323494166743790020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_anoush.jpg');
 Success. Targetfile :tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -484,7 +484,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_txt2.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292584465719884121437216347907218212317486120465668020"TRAFODION"."LOB130"  ' , 'hdfs:///lobs/tlob130_txt2.txt');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134734270219592176192182731401318212323494227492370020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_txt2.txt');
 Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 
 --- SQL operation complete.
@@ -500,7 +500,7 @@ Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292584531219884121437220235037418212317486159808683020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134734319619592176192188535869918212323494285449446020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -516,7 +516,7 @@ Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010592176192134733309019592176192176652813118212323494166743790020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -535,7 +535,7 @@ Column Name : c2
 Input a filename to extract to : 
 Output File Name : lobc2out.jpg
 Extracting  lob handle for column c2...
-LOB handle for c2: LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"
+LOB handle for c2: LOBH00000200010592176192134733309019592176192176652813118212323494166743790020"TRAFODION"."LOB130"
 Extracting LOB data length for the above handle...
 LOB data length :230150
 Extracting lob data into file in chunks of 1000 ...
@@ -813,7 +813,7 @@ And the dish ran away with the spoon.
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200020520117997292585982119884121437229332169918212317486250825302020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep2.jpg');
+>>extract lobtofile(LOB 'LOBH00000200020592176192134736068419592176192198951613118212323494389654681020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep2.jpg');
 Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -822,7 +822,7 @@ Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200030520117997292585982119884121437229667368718212317486254205249020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
+>>extract lobtofile(LOB 'LOBH00000200030592176192134736068419592176192199447013618212323494394650219020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush2.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -849,10 +849,90 @@ Hey diddle diddle,
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush3.jpg',create,truncate);/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200030520117997292586250119884121437232179272218212317486279303189020"TRAFODION"."LOB130"  ' , 'tlob130_anoush3.jpg',create,truncate);
+>>extract lobtofile(LOB 'LOBH00000200030592176192134736435719592176192203041777118212323494430688273020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_anoush3.jpg',create,truncate);
 Success. Targetfile :tlob130_anoush3.jpg  Length : 230150
 
 --- SQL operation complete.
 >>
+>>obey TEST130(lob_gc_cleanup);
+>>log;
+>>create table tlob130gc (c1 int not null, c2 blob, c3 blob, primary key (c1));
+
+--- SQL operation complete.
+>>--insert a few rows
+>>insert into tlob130gc values (1, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (2, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (3, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (4, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (5, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (6, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (7, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>insert into tlob130gc values (8, stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>--create holes in the lob data file
+>>delete from tlob130gc where c1=2;
+
+--- 1 row(s) deleted.
+>>delete from tlob130gc where c1=6;
+
+--- 1 row(s) deleted.
+>>update tlob130gc set c2=stringtolob('xxxx')where c1=7;
+
+--- 1 row(s) updated.
+>>--check contents of table
+>>select c1,lobtostring(c2,10),lobtostring(c3,10) from tlob130gc;
+
+C1           (EXPR)      (EXPR)    
+-----------  ----------  ----------
+
+          1  aaaa        bbbbb     
+          3  aaaa        bbbbb     
+          4  aaaa        bbbbb     
+          5  aaaa        bbbbb     
+          7  xxxx        bbbbb     
+          8  aaaa        bbbbb     
+
+--- 6 row(s) selected.
+>>cqd LOB_GC_LIMIT_SIZE '0';
+
+--- SQL operation complete.
+>>--this next insert should trigger a GC
+>>insert into tlob130gc values(9,stringtolob('aaaa'), stringtolob('bbbbb'));
+
+--- 1 row(s) inserted.
+>>--check contents of table. Should have one extra row compared to above select
+>>select c1,lobtostring(c2,10),lobtostring(c3,10) from tlob130gc;
+
+C1           (EXPR)      (EXPR)    
+-----------  ----------  ----------
+
+          1  aaaa        bbbbb     
+          3  aaaa        bbbbb     
+          4  aaaa        bbbbb     
+          5  aaaa        bbbbb     
+          7  xxxx        bbbbb     
+          8  aaaa        bbbbb     
+          9  aaaa        bbbbb     
+
+--- 7 row(s) selected.
+>>cqd LOB_GC_LIMIT_SIZE reset;
+
+--- SQL operation complete.
+>>
 >>obey TEST130(lob_general_cleanup);
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/executor/TEST130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST130 b/core/sql/regress/executor/TEST130
index 87ca365..108da27 100755
--- a/core/sql/regress/executor/TEST130
+++ b/core/sql/regress/executor/TEST130
@@ -404,6 +404,37 @@ sh rm t130_extract_command;
 sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush3.jpg',create,truncate);/g" >> t130_extract_command;
 obey t130_extract_command;
 
+obey TEST130(lob_gc_cleanup);
+?section lob_gc_cleanup
+log;
+drop table tlob130gc;
+obey TEST130(lob_gc_test);
+
+?section lob_gc_test
+log LOG130;
+create table tlob130gc (c1 int not null, c2 blob, c3 blob, primary key (c1));
+--insert a few rows
+insert into tlob130gc values (1, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (2, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (3, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (4, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (5, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (6, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (7, stringtolob('aaaa'), stringtolob('bbbbb'));
+insert into tlob130gc values (8, stringtolob('aaaa'), stringtolob('bbbbb'));
+--create holes in the lob data file
+delete from tlob130gc where c1=2;
+delete from tlob130gc where c1=6;
+update tlob130gc set c2=stringtolob('xxxx')where c1=7;
+--check contents of table
+select c1,lobtostring(c2,10),lobtostring(c3,10) from tlob130gc;
+cqd LOB_GC_LIMIT_SIZE '0';
+--this next insert should trigger a GC
+insert into tlob130gc values(9,stringtolob('aaaa'), stringtolob('bbbbb'));
+--check contents of table. Should have one extra row compared to above select
+select c1,lobtostring(c2,10),lobtostring(c3,10) from tlob130gc;
+cqd LOB_GC_LIMIT_SIZE reset;
+
 obey TEST130(lob_general_cleanup);
 -- cleanup
 ?section lob_general_cleanup
@@ -429,6 +460,7 @@ sh rm TMP130;
 sh rm tlob130txt2;
 sh rm lobc2out.jpg;
 sh rm TEST130_argfile;
+drop table tlob130gc;
 drop schema trafodion.lob130 cascade;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/hive/EXPECTED009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED009 b/core/sql/regress/hive/EXPECTED009
index 0f4be9e..df03c8e 100644
--- a/core/sql/regress/hive/EXPECTED009
+++ b/core/sql/regress/hive/EXPECTED009
@@ -82,6 +82,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".CUSTOMER
   , C_LAST_REVIEW_DATE               VARCHAR(32000 BYTES) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -124,6 +125,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".ITEM
   , I_PRODUCT_NAME                   VARCHAR(32000 BYTES) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -164,6 +166,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_HIVE_".PROMOTION
   , P_DISCOUNT_ACTIVE                VARCHAR(32000 BYTES) CHARACTER SET UTF8
       COLLATE DEFAULT DEFAULT NULL
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -193,6 +196,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_SCH_T009_".T009T1
   , B                                INT DEFAULT NULL
   , C                                INT DEFAULT NULL
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -204,6 +208,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HV_SCH_T009_".T009T2
   , B                                INT DEFAULT NULL
   , C                                INT DEFAULT NULL
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -520,6 +525,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HB__ROW__"."baseball"
   , COLUMN_DETAILS                   VARCHAR(10000) CHARACTER SET ISO88591
       COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.
@@ -538,6 +544,7 @@ CREATE EXTERNAL TABLE TRAFODION."_HB__CELL__"."baseball"
   , COL_VALUE                        VARCHAR(1000) CHARACTER SET ISO88591
       COLLATE DEFAULT DEFAULT NULL NOT NULL NOT DROPPABLE
   )
+ ATTRIBUTES NO AUDIT
 ;
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/hive/EXPECTED017
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED017 b/core/sql/regress/hive/EXPECTED017
index 34ce3fd..2e746b7 100644
--- a/core/sql/regress/hive/EXPECTED017
+++ b/core/sql/regress/hive/EXPECTED017
@@ -322,6 +322,7 @@ CREATE TABLE TRAFODION.HBASE.T017TTCIDXB
   , A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
   , PRIMARY KEY ("B@" ASC, "_SALT_" ASC, A ASC)
   )
+ ATTRIBUTES ALIGNED FORMAT
 ;
 
 --- SQL operation complete.
@@ -474,6 +475,7 @@ CREATE TABLE TRAFODION.HBASE.T017TTDIDXB
   , SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
   , PRIMARY KEY ("B@" ASC, A ASC, SYSKEY ASC)
   )
+ ATTRIBUTES ALIGNED FORMAT
 ;
 
 --- SQL operation complete.
@@ -616,6 +618,7 @@ CREATE TABLE TRAFODION.HBASE.T017TTEIDXB
   , SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
   , PRIMARY KEY ("B@" ASC, SYSKEY ASC)
   )
+ ATTRIBUTES ALIGNED FORMAT
 ;
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/privs1/EXPECTED132
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/EXPECTED132 b/core/sql/regress/privs1/EXPECTED132
index ea090c5..0e9828c 100644
--- a/core/sql/regress/privs1/EXPECTED132
+++ b/core/sql/regress/privs1/EXPECTED132
@@ -863,7 +863,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:27:45 2016
+-- Definition current  Thu Feb 25 11:15:40 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -874,12 +874,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:27:47 2016
+-- Definition current  Thu Feb 25 11:15:42 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -890,12 +891,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_GIANTS_GAMES
--- Definition current  Sat Feb 13 01:27:49 2016
+-- Definition current  Thu Feb 25 11:15:43 2016
 
   (
     GAME_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -909,7 +911,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_home_teams_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_HOME_TEAMS_GAMES
--- Definition current  Sat Feb 13 01:27:50 2016
+-- Definition current  Thu Feb 25 11:15:45 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -979,7 +981,7 @@ ALTER TABLE TRAFODION.T132SCH.T132_GAMES ADD CONSTRAINT
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:28:08 2016
+-- Definition current  Thu Feb 25 11:16:00 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -990,6 +992,7 @@ ALTER TABLE TRAFODION.T132SCH.T132_GAMES ADD CONSTRAINT
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
@@ -1173,7 +1176,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:28:45 2016
+-- Definition current  Thu Feb 25 11:16:33 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1184,12 +1187,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:28:45 2016
+-- Definition current  Thu Feb 25 11:16:33 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1200,12 +1204,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_GIANTS_GAMES
--- Definition current  Sat Feb 13 01:28:45 2016
+-- Definition current  Thu Feb 25 11:16:33 2016
 
   (
     GAME_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1219,7 +1224,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_home_teams_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_HOME_TEAMS_GAMES
--- Definition current  Sat Feb 13 01:28:45 2016
+-- Definition current  Thu Feb 25 11:16:33 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1299,7 +1304,7 @@ ALTER TABLE TRAFODION.T132SCH.T132_TEAMS ADD CONSTRAINT
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:29:10 2016
+-- Definition current  Thu Feb 25 11:16:51 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1310,6 +1315,7 @@ ALTER TABLE TRAFODION.T132SCH.T132_TEAMS ADD CONSTRAINT
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
@@ -1447,7 +1453,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:29:32 2016
+-- Definition current  Thu Feb 25 11:17:10 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1458,12 +1464,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:29:32 2016
+-- Definition current  Thu Feb 25 11:17:10 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1474,12 +1481,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_GIANTS_GAMES
--- Definition current  Sat Feb 13 01:29:32 2016
+-- Definition current  Thu Feb 25 11:17:10 2016
 
   (
     GAME_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1493,7 +1501,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_home_teams_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_HOME_TEAMS_GAMES
--- Definition current  Sat Feb 13 01:29:32 2016
+-- Definition current  Thu Feb 25 11:17:10 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1606,7 +1614,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:29:53 2016
+-- Definition current  Thu Feb 25 11:17:27 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1617,12 +1625,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:29:53 2016
+-- Definition current  Thu Feb 25 11:17:27 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1633,12 +1642,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_GIANTS_GAMES
--- Definition current  Sat Feb 13 01:29:53 2016
+-- Definition current  Thu Feb 25 11:17:27 2016
 
   (
     GAME_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1652,7 +1662,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_home_teams_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_HOME_TEAMS_GAMES
--- Definition current  Sat Feb 13 01:29:53 2016
+-- Definition current  Thu Feb 25 11:17:27 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1765,7 +1775,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_games;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_GAMES
--- Definition current  Sat Feb 13 01:30:13 2016
+-- Definition current  Thu Feb 25 11:17:44 2016
 
   (
     HOME_TEAM_NUMBER                 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1776,12 +1786,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , GAME_LOCATION                    VARCHAR(50) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (GAME_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_teams;
 
 -- Definition of Trafodion table TRAFODION.T132SCH.T132_TEAMS
--- Definition current  Sat Feb 13 01:30:13 2016
+-- Definition current  Thu Feb 25 11:17:44 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1792,12 +1803,13 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
   , TEAM_CONTACT_NUMBER              CHAR(10) CHARACTER SET ISO88591 COLLATE
       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
   )
+  PRIMARY KEY (TEAM_NUMBER ASC)
 
 --- SQL operation complete.
 >>invoke t132_giants_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_GIANTS_GAMES
--- Definition current  Sat Feb 13 01:30:13 2016
+-- Definition current  Thu Feb 25 11:17:44 2016
 
   (
     GAME_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1811,7 +1823,7 @@ CREATE SEQUENCE TRAFODION.T132SCH.T132_TEAM_NUMBER_SEQUENCE
 >>invoke t132_home_teams_games;
 
 -- Definition of Trafodion view TRAFODION.T132SCH.T132_HOME_TEAMS_GAMES
--- Definition current  Sat Feb 13 01:30:13 2016
+-- Definition current  Thu Feb 25 11:17:44 2016
 
   (
     TEAM_NUMBER                      INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1979,26 +1991,26 @@ End of MXCI Session
 >>showstats for table t132t1 on every column;
 
 Histogram data for Table TRAFODION.T132SCH.T132T1
-Table ID: 8532722397900169867
+Table ID: 9082725574613497403
 
    Hist ID # Ints    Rowcount         UEC Colname(s)
 ========== ====== =========== =========== ===========================
- 835649386      8           8           8 SYSKEY
- 835649383      8           8           8 C1
- 835649376      8           8           8 C2
+1275314956      8           8           8 SYSKEY
+1275314953      8           8           8 C1
+1275314946      8           8           8 C2
 
 
 --- SQL operation complete.
 >>showstats for table t132t2 on every column;
 
 Histogram data for Table TRAFODION.T132SCH.T132T2
-Table ID: 8532722397900169937
+Table ID: 9082725574613497462
 
    Hist ID # Ints    Rowcount         UEC Colname(s)
 ========== ====== =========== =========== ===========================
- 839319130      8           8           8 SYSKEY
- 839319125      8           8           8 C1
- 839319120      8           8           8 C2
+1278381713      8           8           8 SYSKEY
+1278381708      8           8           8 C1
+1278381703      8           8           8 C2
 
 
 --- SQL operation complete.
@@ -2104,26 +2116,26 @@ MANAGE_STATISTICS
 >>showstats for table t132t1 on every column;
 
 Histogram data for Table TRAFODION.T132SCH.T132T1
-Table ID: 8532722397900169867
+Table ID: 9082725574613497403
 
    Hist ID # Ints    Rowcount         UEC Colname(s)
 ========== ====== =========== =========== ===========================
- 835649387      8           8           8 SYSKEY
- 835649382      8           8           8 C1
- 835649377      8           8           8 C2
+1275314957      8           8           8 SYSKEY
+1275314952      8           8           8 C1
+1275314947      8           8           8 C2
 
 
 --- SQL operation complete.
 >>showstats for table t132t2 on every column;
 
 Histogram data for Table TRAFODION.T132SCH.T132T2
-Table ID: 8532722397900169937
+Table ID: 9082725574613497462
 
    Hist ID # Ints    Rowcount         UEC Colname(s)
 ========== ====== =========== =========== ===========================
- 839319131      8           8           8 SYSKEY
- 839319124      8           8           8 C1
- 839319121      8           8           8 C2
+1278381712      8           8           8 SYSKEY
+1278381709      8           8           8 C1
+1278381702      8           8           8 C2
 
 
 --- SQL operation complete.
@@ -2184,13 +2196,13 @@ CREATE TABLE TRAFODION.T132SCH.T132T1
 >>showstats for table t132t1 on every column;
 
 Histogram data for Table TRAFODION.T132SCH.T132T1
-Table ID: 8532722397900169867
+Table ID: 9082725574613497403
 
    Hist ID # Ints    Rowcount         UEC Colname(s)
 ========== ====== =========== =========== ===========================
- 835649387      8           8           8 SYSKEY
- 835649382      8           8           8 C1
- 835649377      8           8           8 C2
+1275314957      8           8           8 SYSKEY
+1275314952      8           8           8 C1
+1275314947      8           8           8 C2
 
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/privs2/EXPECTED135
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/EXPECTED135 b/core/sql/regress/privs2/EXPECTED135
index 9fbc688..8ce623f 100644
--- a/core/sql/regress/privs2/EXPECTED135
+++ b/core/sql/regress/privs2/EXPECTED135
@@ -670,6 +670,7 @@ Roles
 
 DB__HBASEROLE
 DB__HIVEROLE
+DB__LIBMGRROLE
 DB__ROOTROLE
 PUBLIC
 T135_ROLE1
@@ -1087,6 +1088,7 @@ Roles
 
 DB__HBASEROLE
 DB__HIVEROLE
+DB__LIBMGRROLE
 DB__ROOTROLE
 PUBLIC
 


[50/50] [abbrv] incubator-trafodion git commit: Merge [TRAFODION-1706] PR 367 Support for HBase 1.0

Posted by db...@apache.org.
Merge [TRAFODION-1706] PR 367 Support for HBase 1.0


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

Branch: refs/heads/master
Commit: 19f236f25fa84bdcebd314ebc9b8f3693f8bbd97
Parents: e1c12dd c67fbfd
Author: Dave Birdsall <db...@apache.org>
Authored: Thu Mar 31 22:14:35 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Thu Mar 31 22:14:35 2016 +0000

----------------------------------------------------------------------
 core/sqf/conf/install_features                  |    7 +-
 core/sqf/hbase_utilities/pom.xml                |   12 +-
 .../backuprestore/TrafExportSnapshot.java       |   85 +-
 core/sqf/sqenvcom.sh                            |  140 +-
 core/sqf/sql/scripts/install_local_hadoop       |   75 +-
 core/sqf/sql/scripts/sqgen                      |    1 +
 core/sqf/src/seatrans/.gitignore                |   10 +
 core/sqf/src/seatrans/hbase-trx/Makefile        |   22 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.apache  |   45 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.cdh     |    8 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.hdp     |   15 +-
 core/sqf/src/seatrans/hbase-trx/pp.awk          |  138 +
 core/sqf/src/seatrans/hbase-trx/reinstate_orig  |   30 +
 .../hbase/client/PatchClientScanner.java.tmpl   |  237 +
 .../CommitUnsuccessfulException.java            |    0
 .../HBaseBackedTransactionLogger.java           |    0
 .../client/transactional/JtaXAResource.java     |    0
 .../transactional/LocalTransactionLogger.java   |    0
 .../hbase/client/transactional/RMInterface.java |    8 +-
 .../client/transactional/RegionHelper.java      |    0
 .../transactional/SsccTransactionalScanner.java |  289 -
 .../SsccTransactionalScanner.java.tmpl          |  297 +
 .../transactional/SsccTransactionalTable.java   |    8 +-
 .../hbase/client/transactional/TmDDL.java       |    0
 .../client/transactional/TransactionLogger.java |    0
 .../transactional/TransactionManager.java       |   48 +-
 .../TransactionRegionLocation.java              |   12 +
 .../transactional/TransactionalReturn.java      |    0
 .../transactional/TransactionalScanner.java     |  319 -
 .../TransactionalScanner.java.tmpl              |  325 +
 .../transactional/TransactionalTable.java       |    7 +-
 .../transactional/TransactionalTableClient.java |    8 +-
 .../UnknownTransactionException.java            |    0
 .../transactional/SplitBalanceHelper.java       |  666 +-
 .../transactional/SsccRegionEndpoint.java       | 4167 ------------
 .../transactional/SsccRegionEndpoint.java.tmpl  | 4127 ++++++++++++
 .../transactional/TrxRegionEndpoint.java        | 5885 ----------------
 .../transactional/TrxRegionEndpoint.java.tmpl   | 6271 ++++++++++++++++++
 .../transactional/TrxRegionObserver.java        |  920 ---
 .../transactional/TrxRegionObserver.java.tmpl   |  975 +++
 .../transactional/TrxTableClient2.java          |    0
 .../generated/TrxRegionProtos.java              | 5635 ++++++++++++++--
 .../CleanOldTransactionsChore.java              |   71 -
 .../CleanOldTransactionsChore.java.tmpl         |   81 +
 .../transactional/KeyValueListScanner.java      |  173 -
 .../transactional/KeyValueListScanner.java.tmpl |  167 +
 .../transactional/MemoryUsageChore.java         |   64 -
 .../transactional/MemoryUsageChore.java.tmpl    |   75 +
 .../SingleVersionDeleteNotSupported.java        |    0
 .../transactional/SsccTransactionState.java     |    4 +-
 .../transactional/TransactionState.java         |   35 +-
 .../transactional/TransactionalRegion.java      |    7 +-
 .../TransactionalRegionScannerHolder.java       |    0
 .../transactional/TrxTransactionState.java      | 1039 ---
 .../transactional/TrxTransactionState.java.tmpl | 1004 +++
 .../hbase-trx/src/main/protobuf/TrxRegion.proto |   45 +-
 .../sqf/src/seatrans/hbase-trx/uncomment_string |   36 +
 core/sqf/src/seatrans/tm/hbasetmlib2/Makefile   |    3 +
 core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml    |    9 +-
 .../src/seatrans/tm/hbasetmlib2/pom.xml.apache  |  115 +
 .../sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp |   88 +
 core/sql/cli/SessionDefaults.cpp                |    2 +
 core/sql/nskgmake/Makerules.mk                  |   16 +-
 core/sql/pom.xml                                |   12 +-
 core/sql/pom.xml.apache                         |  131 +
 core/sql/pom.xml.hdp                            |  111 +
 core/sql/regress/core/DIFF116.KNOWN.SB          |   21 -
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |    1 -
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   57 +-
 .../java/org/trafodion/sql/HBaseClient.java     |   21 +-
 .../src/asciidoc/_chapters/odbc_windows.adoc    |    1 -
 install/installer/traf_config_check             |    7 +-
 72 files changed, 20114 insertions(+), 14074 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/19f236f2/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------


[03/50] [abbrv] incubator-trafodion git commit: add copyright

Posted by db...@apache.org.
add copyright


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

Branch: refs/heads/master
Commit: 4c9cfe45ab55e42d6e5df6d2b429e493476692bf
Parents: 78abccb
Author: mashengchen <ma...@gmail.com>
Authored: Tue Mar 1 01:46:40 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Tue Mar 1 01:46:40 2016 +0000

----------------------------------------------------------------------
 .../generated/TrxRegionProtos.java              | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4c9cfe45/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
index d773aed..564c517 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/generated/TrxRegionProtos.java
@@ -1,3 +1,24 @@
+// @@@ 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 @@@
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: TrxRegion.proto
 


[07/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
update


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

Branch: refs/heads/master
Commit: f1c7f3a7a896031fe37c261d26af52bd8eda611c
Parents: 73c164b e24ea17
Author: mashengchen <ma...@gmail.com>
Authored: Sun Mar 6 07:34:45 2016 +0000
Committer: mashengchen <ma...@gmail.com>
Committed: Sun Mar 6 07:34:45 2016 +0000

----------------------------------------------------------------------
 core/.gitignore                                 |    1 +
 core/Makefile                                   |    5 +-
 core/conn/trafci/manualtests/README             |   50 +
 core/conn/trafci/manualtests/statcheck.sql      |   47 +
 .../src/org/trafodion/ci/DatabaseQuery.java     |    3 +-
 .../odbc/odbcclient/unixcli/makefile.lnx        |    2 +-
 .../odbc/odbcclient/unixcli/package/LICENSE     |    1 -
 .../odbc/odbcclient/unixcli/package/license.txt |   18 -
 .../odbc/odbcclient/unixcli/package/mklnxpkg.sh |    6 +-
 .../unixcli/package/trafodbclnx_install.sh      |   22 +-
 core/sqf/LocalSettingsTemplate.sh               |    4 +-
 core/sqf/Makefile                               |   32 +-
 core/sqf/hbase_utilities/pom.xml                |    2 +-
 core/sqf/makelink                               |   33 -
 core/sqf/sqenvcom.sh                            |   48 +-
 core/sqf/sql/scripts/install_local_hadoop       |    5 +-
 core/sqf/src/seatrans/hbase-trx/Makefile        |   13 +-
 core/sqf/src/seatrans/hbase-trx/genvers         |    3 +-
 .../seatrans/hbase-trx/hbase-protocol/pom.xml   |  191 --
 core/sqf/src/seatrans/hbase-trx/pom.xml         |  342 ---
 .../transactional/TransactionManager.java       |   22 +-
 .../TransactionalScanner.java.tmpl              |   14 +-
 core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml    |    6 +-
 .../java/org/trafodion/dtm/HBaseTxClient.java   |   14 +-
 .../java/org/trafodion/dtm/TmAuditTlog.java     |   23 +-
 core/sql/SqlCompilerDebugger/mk.sh              |    3 +
 core/sql/arkcmp/CmpContext.cpp                  |   12 +-
 core/sql/arkcmp/CmpContext.h                    |   18 +
 core/sql/arkcmp/CmpStatement.cpp                |   19 +-
 core/sql/arkcmp/CmpStatement.h                  |    1 +
 core/sql/bin/SqlciErrors.txt                    |    1 +
 core/sql/cli/Context.cpp                        |  106 +-
 core/sql/cli/Context.h                          |   13 +-
 core/sql/cli/ExSqlComp.cpp                      |    5 +
 core/sql/cli/Statement.cpp                      |   36 +-
 core/sql/comexe/CmpMessage.h                    |   23 +
 core/sql/comexe/ComTdbHbaseAccess.cpp           |    3 +
 core/sql/comexe/ComTdbHbaseAccess.h             |    4 +-
 core/sql/common/ComSmallDefs.h                  |   11 +
 core/sql/common/DateTimeType.cpp                |    3 +-
 core/sql/executor/ExExeUtil.h                   |    1 +
 core/sql/executor/ExExeUtilGet.cpp              |   55 +-
 core/sql/executor/ExFirstN.cpp                  |   45 +-
 core/sql/executor/ExFirstN.h                    |    4 +-
 core/sql/executor/ExHbaseAccess.cpp             |   22 +-
 core/sql/executor/ExHbaseAccess.h               |    1 +
 core/sql/executor/ExHbaseIUD.cpp                |   11 +-
 core/sql/executor/ExStats.cpp                   |   13 +-
 core/sql/executor/HBaseClient_JNI.cpp           |   41 +-
 core/sql/executor/HBaseClient_JNI.h             |    7 +-
 core/sql/executor/ex_ddl.cpp                    |    2 +
 core/sql/executor/ex_transaction.cpp            |  278 ++-
 core/sql/executor/ex_transaction.h              |    2 +-
 core/sql/exp/ExpHbaseInterface.cpp              |   34 +-
 core/sql/exp/ExpHbaseInterface.h                |   16 +-
 core/sql/generator/GenPreCode.cpp               |   13 -
 core/sql/generator/GenRelExeUtil.cpp            |   31 +-
 core/sql/generator/GenRelMisc.cpp               |   13 +-
 core/sql/generator/GenRelUpdate.cpp             |  112 +-
 core/sql/generator/Generator.cpp                |    5 +
 core/sql/lib_mgmt/.gitignore                    |    7 +
 core/sql/lib_mgmt/Makefile                      |   35 +
 core/sql/lib_mgmt/README.rst                    |   63 +
 core/sql/lib_mgmt/pom.xml                       |  108 +
 .../java/org/trafodion/libmgmt/FileMgmt.java    |  645 ++++++
 .../java/org/trafodion/libmgmt/Vproc.java.tmpl  |   35 +
 .../lib_mgmt/src/main/resources/init_libmgmt.sh |  206 ++
 .../com/trafodion/libmgmt/JarFileMgmtTest.java  |   27 +
 core/sql/nskgmake/Makerules.linux               |   19 +-
 core/sql/nskgmake/SqlCompilerDebugger/Makefile  |   15 +-
 core/sql/optimizer/BindRelExpr.cpp              |   86 +-
 core/sql/optimizer/ItemOther.h                  |    7 +
 core/sql/optimizer/NAColumn.h                   |   43 +-
 core/sql/optimizer/NARoutine.cpp                |    2 +-
 core/sql/optimizer/NARoutineDB.h                |    5 +-
 core/sql/optimizer/NATable.cpp                  |   58 +-
 core/sql/optimizer/NATable.h                    |   10 +-
 core/sql/optimizer/RelExeUtil.cpp               |  155 +-
 core/sql/optimizer/RelExeUtil.h                 |   30 +-
 core/sql/optimizer/RelExpr.cpp                  |    2 +-
 core/sql/optimizer/RelUpdate.h                  |    2 +
 core/sql/parser/SqlParserAux.cpp                |    2 +-
 core/sql/parser/StmtDDLAlter.cpp                |   11 +
 .../sql/parser/StmtDDLAlterTableAlterColumn.cpp |   20 +-
 core/sql/parser/StmtDDLAlterTableAlterColumn.h  |   17 +-
 core/sql/parser/StmtDDLNode.cpp                 |   14 +
 core/sql/parser/StmtDDLNode.h                   |   15 +-
 core/sql/parser/sqlparser.y                     |    6 +-
 core/sql/parser/ulexer.h                        |   21 +
 core/sql/pom.xml                                |   10 +-
 core/sql/regress/charsets/DIFF012.KNOWN.SB      |    2 +
 core/sql/regress/compGeneral/EXPECTED071        |    8 +-
 core/sql/regress/core/DIFF116.KNOWN.SB          |   21 +
 core/sql/regress/core/EXPECTED056.SB            |   75 +-
 core/sql/regress/core/EXPECTED116               |  542 +++--
 core/sql/regress/core/TEST029                   |    2 +-
 core/sql/regress/core/TEST056                   |    7 +-
 core/sql/regress/core/TEST116                   |  123 +-
 core/sql/regress/executor/EXPECTED013.SB        |   39 +-
 core/sql/regress/executor/EXPECTED140           |   40 +-
 core/sql/regress/fullstack2/EXPECTED062         |    3 +
 core/sql/regress/fullstack2/EXPECTED062.RELEASE |    3 +
 core/sql/regress/privs2/EXPECTED135             |  329 ---
 core/sql/regress/privs2/EXPECTED138             |    2 +-
 core/sql/regress/privs2/EXPECTED142             |  760 +++++++
 core/sql/regress/privs2/TEST135                 |   43 -
 core/sql/regress/privs2/TEST142                 |  280 +++
 core/sql/regress/seabase/EXPECTED010            |  460 ++--
 core/sql/regress/seabase/EXPECTED011            |  102 +-
 core/sql/regress/seabase/EXPECTED016            |   35 +-
 core/sql/regress/seabase/EXPECTED020            |  233 ++
 core/sql/regress/seabase/EXPECTED027            |  433 +++-
 core/sql/regress/seabase/TEST011                |   16 -
 core/sql/regress/seabase/TEST020                |   54 +
 core/sql/regress/seabase/TEST027                |   58 +
 core/sql/regress/tools/runregr_catman1.ksh      |    3 +-
 core/sql/regress/tools/runregr_charsets.ksh     |    3 +-
 core/sql/regress/tools/runregr_compGeneral.ksh  |    3 +-
 core/sql/regress/tools/runregr_core.ksh         |    3 +-
 core/sql/regress/tools/runregr_executor.ksh     |    3 +-
 core/sql/regress/tools/runregr_fullstack2.ksh   |    3 +-
 core/sql/regress/tools/runregr_hive.ksh         |    4 +-
 core/sql/regress/tools/runregr_privs1.ksh       |    3 +-
 core/sql/regress/tools/runregr_privs2.ksh       |    3 +-
 core/sql/regress/tools/runregr_qat.ksh          |    3 +-
 core/sql/regress/tools/runregr_seabase.ksh      |    4 +-
 core/sql/regress/tools/runregr_udr.ksh          |    9 +-
 core/sql/regress/tools/sbdefs                   |    1 +
 core/sql/sqlcomp/CmpDescribe.cpp                |  186 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |  104 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp       |   42 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |  490 +++--
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |   98 +-
 core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp         |    2 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp       |    8 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   26 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         | 1990 ++++++++++++------
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp       |   14 +-
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.h         |    6 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |   30 +-
 core/sql/sqlcomp/DefaultConstants.h             |    8 +
 core/sql/sqlcomp/PrivMgrDefs.h                  |    4 +-
 core/sql/sqlcomp/PrivMgrMD.cpp                  |  171 +-
 core/sql/sqlcomp/PrivMgrMD.h                    |  132 +-
 core/sql/sqlcomp/PrivMgrPrivileges.cpp          |  793 ++++---
 core/sql/sqlcomp/PrivMgrPrivileges.h            |   48 +-
 core/sql/sqlcomp/nadefaults.cpp                 |    9 +-
 .../java/org/trafodion/sql/HBaseClient.java     |   70 +-
 core/sql/ustat/hs_globals.cpp                   |   20 -
 dcs/bin/stop-dcs.sh                             |    2 +-
 .../dcs/master/listener/ConnectReply.java       |   60 +-
 .../src/asciidoc/_chapters/about.adoc           |    1 +
 .../src/asciidoc/_chapters/odb.adoc             |   14 +-
 docs/client_install/src/asciidoc/index.adoc     |    3 +-
 docs/command_interface/pom.xml                  |    2 +
 .../src/asciidoc/_chapters/about.adoc           |    1 +
 docs/command_interface/src/asciidoc/index.adoc  |    5 +-
 docs/cqd_reference/pom.xml                      |  291 +++
 .../src/asciidoc/_chapters/about.adoc           |  179 ++
 .../src/asciidoc/_chapters/histograms.adoc      |  215 ++
 .../src/asciidoc/_chapters/introduction.adoc    |  111 +
 .../_chapters/operational_controls.adoc         |  110 +
 .../src/asciidoc/_chapters/query_plans.adoc     |  515 +++++
 .../asciidoc/_chapters/runtime_controls.adoc    |   83 +
 .../src/asciidoc/_chapters/schema_controls.adoc |   49 +
 .../src/asciidoc/_chapters/transactions.adoc    |   94 +
 .../src/asciidoc/_chapters/update_stats.adoc    |   92 +
 docs/cqd_reference/src/asciidoc/index.adoc      |   69 +
 docs/load_transform/pom.xml                     |  289 +++
 .../src/asciidoc/_chapters/about.adoc           |  186 ++
 .../src/asciidoc/_chapters/bulk_load.adoc       |  291 +++
 .../src/asciidoc/_chapters/bulk_unload.adoc     |   73 +
 .../src/asciidoc/_chapters/introduction.adoc    |  117 +
 .../src/asciidoc/_chapters/monitor.adoc         |   77 +
 .../src/asciidoc/_chapters/tables_indexes.adoc  |  208 ++
 .../src/asciidoc/_chapters/trickle_load.adoc    |  496 +++++
 .../src/asciidoc/_chapters/troubleshoot.adoc    |  159 ++
 docs/load_transform/src/asciidoc/index.adoc     |   68 +
 docs/messages_guide/pom.xml                     |    2 +
 .../src/asciidoc/_chapters/about.adoc           |    3 +
 docs/messages_guide/src/asciidoc/index.adoc     |    5 +-
 docs/odb_user/pom.xml                           |    2 +
 docs/odb_user/src/asciidoc/_chapters/about.adoc |    3 +
 docs/odb_user/src/asciidoc/_chapters/load.adoc  |   48 +-
 docs/odb_user/src/asciidoc/index.adoc           |    5 +-
 .../src/asciidoc/_chapters/about.adoc           |    2 +
 .../src/asciidoc/_chapters/prepare.adoc         |   31 +-
 docs/provisioning_guide/src/asciidoc/index.adoc |    3 +-
 docs/shared/trafodion-logo.jpg                  |  Bin 0 -> 28850 bytes
 docs/sql_reference/pom.xml                      |    2 +
 .../src/asciidoc/_chapters/about.adoc           |    2 +
 .../src/asciidoc/_chapters/cqds.adoc            |   20 -
 .../src/asciidoc/_chapters/sql_statements.adoc  |    8 +-
 .../src/asciidoc/_chapters/sql_utilities.adoc   |  117 +-
 docs/sql_reference/src/asciidoc/index.adoc      |    5 +-
 docs/src/site/markdown/download.md              |  134 +-
 docs/src/site/markdown/index.md                 |   12 +-
 docs/src/site/markdown/logo.md                  |   56 +
 docs/src/site/markdown/quickstart.md            |   95 +-
 docs/src/site/resources/css/site.css            |   18 +-
 .../site/resources/images/carousel/scale.png    |  Bin 93783 -> 127571 bytes
 .../site/resources/images/carousel/stack.png    |  Bin 102472 -> 170554 bytes
 .../resources/images/logos/pb-Trafodion.png     |  Bin 0 -> 49089 bytes
 .../resources/images/logos/pb-trafodion.jpg     |  Bin 0 -> 80904 bytes
 .../images/logos/trafodion-dragon-large.jpg     |  Bin 0 -> 50000 bytes
 .../images/logos/trafodion-dragon-large.png     |  Bin 0 -> 20595 bytes
 .../resources/images/logos/trafodion-dragon.png |  Bin 0 -> 12786 bytes
 .../resources/images/logos/trafodion-logo.jpg   |  Bin 0 -> 58953 bytes
 docs/src/site/site.xml                          |  113 +-
 install/traf_tools_setup.sh                     |    6 +-
 licenses/lic-clients-bin                        |  206 +-
 licenses/lic-server-bin                         |   15 -
 .../phoenix/end2end/AlterTableTest.java         |   22 +
 .../phoenix/end2end/ArithmeticQueryTest.java    |   22 +
 .../phoenix/end2end/AutoCommitTest.java         |   22 +
 .../org/trafodion/phoenix/end2end/BaseTest.java |   22 +
 .../phoenix/end2end/BinaryRowKeyTest.java       |   22 +
 .../phoenix/end2end/CoalesceFunctionTest.java   |   22 +
 .../end2end/CompareDecimalToLongTest.java       |   22 +
 .../phoenix/end2end/CreateTableTest.java        |   22 +
 .../phoenix/end2end/CustomEntityDataTest.java   |   22 +
 .../phoenix/end2end/DeleteRangeTest.java        |   22 +
 .../end2end/DescColumnSortOrderTest.java        |   24 +-
 .../phoenix/end2end/DistinctCountTest.java      |   22 +
 .../phoenix/end2end/ExecuteStatementsTest.java  |   22 +
 .../phoenix/end2end/ExtendedQueryExecTest.java  |   22 +
 .../phoenix/end2end/FunkyNamesTest.java         |   22 +
 .../phoenix/end2end/GroupByCaseTest.java        |   22 +
 .../trafodion/phoenix/end2end/IndexTest.java    |   22 +
 .../trafodion/phoenix/end2end/IsNullTest.java   |   22 +
 .../trafodion/phoenix/end2end/KeyOnlyTest.java  |   22 +
 .../phoenix/end2end/MultiCfQueryExecTest.java   |   22 +
 .../trafodion/phoenix/end2end/OrderByTest.java  |   22 +
 .../phoenix/end2end/ProductMetricsTest.java     |   24 +-
 .../phoenix/end2end/QueryExecTest.java          |   22 +
 .../end2end/QueryExecWithoutSCNTest.java        |   22 +
 .../phoenix/end2end/QueryPlanTest.java          |   22 +
 .../phoenix/end2end/ReadIsolationLevelTest.java |   22 +
 .../phoenix/end2end/SaltedTableTest.java        |   22 +
 .../end2end/SaltedTableUpsertSelectTest.java    |   22 +
 .../end2end/SaltedTableVarLengthRowKeyTest.java |   22 +
 .../phoenix/end2end/ServerExceptionTest.java    |   22 +
 .../phoenix/end2end/SkipScanQueryTest.java      |   22 +
 .../phoenix/end2end/StatementHintsTest.java     |   22 +
 .../trafodion/phoenix/end2end/StddevTest.java   |   22 +
 .../phoenix/end2end/ToCharFunctionTest.java     |   22 +
 .../phoenix/end2end/ToNumberFunctionTest.java   |   22 +
 .../org/trafodion/phoenix/end2end/TopNTest.java |   22 +
 .../phoenix/end2end/UpsertBigValuesTest.java    |   22 +
 .../end2end/UpsertSelectAutoCommitTest.java     |   22 +
 .../phoenix/end2end/UpsertSelectTest.java       |   22 +
 .../phoenix/end2end/UpsertValuesTest.java       |   22 +
 .../phoenix/end2end/VariableLengthPKTest.java   |   22 +
 253 files changed, 13242 insertions(+), 3950 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/hbase_utilities/pom.xml
----------------------------------------------------------------------
diff --cc core/sqf/hbase_utilities/pom.xml
index 1a996e3,4e77b68..c7081e4
--- a/core/sqf/hbase_utilities/pom.xml
+++ b/core/sqf/hbase_utilities/pom.xml
@@@ -28,8 -28,8 +28,8 @@@
  
    <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 -    <hadoop.version>2.5.0</hadoop.version>
 +    <hadoop.version>2.6.0</hadoop.version>
-     <hbase.version>1.0.0-cdh5.4.4</hbase.version>
+     <hbase.version>${env.HBASE_DEP_VER}</hbase.version>
      <java.version>1.7</java.version>
    </properties>
  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --cc core/sqf/sqenvcom.sh
index 5555bc6,c2335d4..34d4f7a
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@@ -139,23 -140,18 +139,29 @@@ f
  export MY_SQROOT=$PWD
  export SQ_HOME=$PWD
  
+ # general Hadoop & TRX dependencies - not distro specific, choose one to build against
  export HBASE_TRXDIR=$MY_SQROOT/export/lib
- export HBASE_TRX_JAR=hbase-trx-cdh5_4-${TRAFODION_VER}.jar
 -export HBASE_TRX_ID=hbase-trx-cdh5_3
 -export HBASE_DEP_VER=0.98.6-cdh5.3.0
++export HBASE_TRX_ID=hbase-trx-cdh5_4
++export HBASE_DEP_VER=hbase-1.0.0-cdh5.4.4.tar.gz
+ export HBASE_TRX_JAR=${HBASE_TRX_ID}-${TRAFODION_VER}.jar
 +export DTM_COMMON_JAR=trafodion-dtm-${TRAFODION_VER}.jar
 +export SQL_JAR=trafodion-sql-${TRAFODION_VER}.jar
  export UTIL_JAR=trafodion-utility-${TRAFODION_VER}.jar
 -if [[ "$SQ_HBASE_DISTRO" = "HDP" ]]; then
 -    export HBASE_TRX_JAR=hbase-trx-hdp2_2-${TRAFODION_VER}.jar
 +if [[ "$HBASE_DISTRO" = "HDP" ]]; then
 +    export HBASE_VERSION_ID=hdp2_3
 +    export HBASE_TRX_JAR=hbase-trx-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
 +    export DTM_COMMON_JAR=trafodion-dtm-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
 +    export SQL_JAR=trafodion-sql-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
 +fi
 +if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
 +    export HBASE_VERSION_ID=apache1_0_2
 +    export HBASE_TRX_JAR=hbase-trx-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
 +    export DTM_COMMON_JAR=trafodion-dtm-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
 +    export SQL_JAR=trafodion-sql-${HBASE_VERSION_ID}-${TRAFODION_VER}.jar
  fi
+ # set common version to be consistent between shared lib and maven dependencies
+ export THRIFT_DEP_VER=0.9.0
+ export HIVE_DEP_VER=0.13.1
  
  # check for workstation env
  # want to make sure SQ_VIRTUAL_NODES is set in the shell running sqstart

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/install_local_hadoop
index 2c10839,5d01264..e0081c2
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@@ -600,28 -602,15 +600,29 @@@ MYSQL_TAR=mysql-5.6.10-linux-glibc2.5-x
  MYSQL_JDBC_URL=http://cdn.mysql.com/archives/mysql-connector-java-5.1
  MYSQL_JDBC_TAR=mysql-connector-java-5.1.23.tar.gz
  
 -HIVE_MIRROR_URL=https://archive.apache.org/dist/hive/hive-${HIVE_DEP_VER}
 -HIVE_PREFIX=apache-hive-${HIVE_DEP_VER}-bin
 +HIVE_MIRROR_URL=http://archive.cloudera.com/cdh5/cdh/5
 +HIVE_PREFIX=hive-1.1.0-cdh5.4.4
  HIVE_TAR=${HIVE_PREFIX}.tar.gz
  
 +if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
-     HIVE_PREFIX=apache-hive-1.2.0-bin
++    HIVE_MIRROR_URL=https://archive.apache.org/dist/hive/hive-${HIVE_DEP_VER}
++    HIVE_PREFIX=apache-hive-${HIVE_DEP_VER}-bin
 +    HIVE_TAR=${HIVE_PREFIX}.tar.gz
 +fi
 +
 +if [[ "$HBASE_DISTRO" = "HDP" ]]; then
 +    HIVE_PREFIX=apache-hive-1.2.1.2.3.2.0-2950-bin
 +    HIVE_TAR=${HIVE_PREFIX}.tar.gz
 +fi
 +
  HBASE_MIRROR_URL=http://archive.cloudera.com/cdh5/cdh/5
- HBASE_TAR=hbase-1.0.0-cdh5.4.4.tar.gz
++HBASE_TARR=hbase-${HBASE_DEP_VER}.tar.gz
  
 -HBASE_TAR=hbase-${HBASE_DEP_VER}.tar.gz
 -if [[ "$SQ_HBASE_DISTRO" = "HDP" ]]; then
 -    HBASE_TAR=hbase-0.98.4.2.2.0.0-2041-hadoop2.tar.gz
 +if [[ "$HBASE_DISTRO" = "HDP" ]]; then
 +    HBASE_TAR=hbase-1.1.2.2.3.2.0-2950.tar.gz
 +fi
 +if [[ "$HBASE_DISTRO" = "APACHE" ]]; then
 +    HBASE_TAR=hbase-1.0.2-bin.tar.gz
  fi
  
  echo "Checking for existing Hadoop processes..."

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/src/seatrans/hbase-trx/Makefile
----------------------------------------------------------------------
diff --cc core/sqf/src/seatrans/hbase-trx/Makefile
index 82ce21d,51ca957..65a4c6c
--- a/core/sqf/src/seatrans/hbase-trx/Makefile
+++ b/core/sqf/src/seatrans/hbase-trx/Makefile
@@@ -36,11 -34,9 +36,12 @@@ REINSTATE_ORIG   	    =./reinstate_ori
  
  all: build_all
  
- jdk_1_7_cdh:
+ jdk_1_7_cdh: build_chk_cdh
 +	$(REINSTATE_ORIG)
 +	$(UNCOMMENT_STRING) CDH1.0
 +	$(MAKE) build_chk_cdh
  	set -o pipefail && $(MAVEN) -f pom.xml.cdh package install -DskipTests | tee -a build_trx.log
+ 	mkdir -p $(MY_SQROOT)/export/lib
  	cp -pf target/$(BLD_HBASE_CDH_TRX_JARNAME) $(MY_SQROOT)/export/lib
  	$(RM) $(VFILE)
  
@@@ -50,26 -46,22 +51,28 @@@ jdk_1_7_mapr: build_chk_map
  	cp -pf target/$(BLD_HBASE_MAPR_TRX_JARNAME) $(MY_SQROOT)/export/lib
  	$(RM) $(VFILE)
  
- jdk_1_7_hdp:
+ jdk_1_7_hdp: build_chk_hdp
 +	$(REINSTATE_ORIG)
 +	$(UNCOMMENT_STRING) HDP2.3 
 +	$(MAKE) build_chk_hdp
  	set -o pipefail && $(MAVEN) -f pom.xml.hdp package -DskipTests | tee -a build_trx.log
+ 	mkdir -p $(MY_SQROOT)/export/lib
  	cp -pf target/$(BLD_HBASE_HDP_TRX_JARNAME) $(MY_SQROOT)/export/lib
  	$(RM) $(VFILE)
  
- jdk_1_7_apache:
+ jdk_1_7_apache: build_chk_apache
 +	$(REINSTATE_ORIG)
 +	$(UNCOMMENT_STRING) APACHE
 +	$(MAKE) build_chk_apache
  	echo "$(MAVEN) package -DskipTests"
  	echo "### For full Maven output, see file build_trx.log"
  	set -o pipefail && $(MAVEN) -f pom.xml.apache package -DskipTests | tee build_trx.log
+ 	mkdir -p $(MY_SQROOT)/export/lib
  	cp -pf target/$(BLD_HBASE_APACHE_TRX_JARNAME) $(MY_SQROOT)/export/lib
  	$(RM) $(VFILE)
 +	$(REINSTATE_ORIG)
  
 -build_all: jdk_1_7_apache jdk_1_7_cdh jdk_1_7_hdp 
 -#build_all: jdk_1_7_apache jdk_1_7_cdh
 +build_all: jdk_1_7_apache jdk_1_7_hdp jdk_1_7_cdh
  
  build_chk_apache:
  	$(GENVERS) > $(VFILE)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalScanner.java.tmpl
----------------------------------------------------------------------
diff --cc core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalScanner.java.tmpl
index 50d088d,0000000..40bbeeb
mode 100755,000000..100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalScanner.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionalScanner.java.tmpl
@@@ -1,323 -1,0 +1,325 @@@
 +/**
 +* @@@ 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 @@@
 +**/
 +
 +
 +package org.apache.hadoop.hbase.client.transactional;
 +
 +import java.io.IOException;
 +import java.util.LinkedList;
 +import java.util.Map;
 +
 +import org.apache.commons.logging.Log;
 +import org.apache.commons.logging.LogFactory;
 +import org.apache.hadoop.hbase.HConstants;
 +import org.apache.hadoop.hbase.HRegionInfo;
 +import org.apache.hadoop.hbase.client.AbstractClientScanner;
 +import org.apache.hadoop.hbase.client.Result;
 +import org.apache.hadoop.hbase.client.Scan;
 +import org.apache.hadoop.hbase.client.coprocessor.Batch;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.CloseScannerRequest;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.CloseScannerResponse;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.OpenScannerRequest;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.PerformScanRequest;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.PerformScanResponse;
 +import org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrxRegionService;
 +import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
 +import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
 +import org.apache.hadoop.hbase.ipc.ServerRpcController;
 +import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 +import org.apache.hadoop.hbase.util.Bytes;
 +
 +import com.google.protobuf.ServiceException;
 +import com.google.protobuf.ByteString;
- 
++import org.apache.commons.codec.binary.Hex;
 +
 +/*
 + *   Transaction Scanner
 + */
 +public class TransactionalScanner extends AbstractClientScanner {
 +    private final Log LOG = LogFactory.getLog(this.getClass());
 +    public Scan scan;
 +    public Long scannerID;
 +    public TransactionState ts;
 +    public TransactionalTable ttable;
 +    protected boolean closed = false;
 +    // Experiment with this parameter, may be faster without having to send the final close()
 +    protected boolean doNotCloseOnLast = true;
 +    protected int nbRows = 100;
 +    protected long nextCallSeq = 0;
 +    private boolean hasMore = true;
 +    private boolean moreScanners = true;
 +    private boolean interrupted = false;
 +    public HRegionInfo currentRegion;
 +    public byte[] currentBeginKey;
 +    public byte[] currentEndKey;
 +    protected final LinkedList<Result> cache = new LinkedList<Result>();
 +
 +    public TransactionalScanner(final TransactionalTable ttable, final TransactionState ts, final Scan scan, final Long scannerID) {
 +        super();
 +        this.scan = scan;
 +        this.scannerID = scannerID;
 +        this.ts = ts;
 +        this.ttable = ttable;
 +        this.nbRows = scan.getCaching();
 +        if (nbRows <= 0)
 +            nbRows = 100;
 +        try {
 +            nextScanner(false);
 +        }catch (IOException e) {
 +            LOG.error("nextScanner error");
 +        }
 +    }
 +
 +    protected boolean checkScanStopRow(final byte [] endKey) {
 +      if (this.scan.getStopRow().length > 0) {
 +        byte [] stopRow = scan.getStopRow();
 +        int cmp = Bytes.compareTo(stopRow, 0, stopRow.length,
 +          endKey, 0, endKey.length);
 +        if (cmp <= 0) {
 +          return true;
 +        }
 +      }
 +      return false;
 +    }
 +    
 +    @Override
 +    public void close() {
 +        if(LOG.isTraceEnabled()) LOG.trace("close() -- ENTRY txID: " + ts.getTransactionId());
 +        if(closed) {
 +            if(LOG.isTraceEnabled()) LOG.trace("close()  already closed -- EXIT txID: " + ts.getTransactionId());
 +            return;
 +        }
 +        this.closed = true;
 +        if(this.interrupted) {
 +            if(LOG.isDebugEnabled()) LOG.debug("close() resetting connection, txID: " + ts.getTransactionId());
 +            try {
 +               ttable.resetConnection();
 +            } catch(IOException e) {
 +               if(LOG.isErrorEnabled()) LOG.error("close() unable to reset connection, txID: " + ts.getTransactionId());
 +               return;
 +            }
 +            this.interrupted = false;
 +        }
 +        TrxRegionProtos.CloseScannerRequest.Builder requestBuilder = CloseScannerRequest.newBuilder();
 +        requestBuilder.setTransactionId(ts.getTransactionId());
 +        requestBuilder.setRegionName(ByteString.copyFromUtf8(currentRegion.getRegionNameAsString()));
 +        requestBuilder.setScannerId(scannerID);
 +        TrxRegionProtos.CloseScannerRequest closeRequest = requestBuilder.build();
 +        try {
 +            CoprocessorRpcChannel channel = ttable.coprocessorService(this.currentBeginKey);
 +            TrxRegionService.BlockingInterface trxService = TrxRegionService.newBlockingStub(channel);
 +            TrxRegionProtos.CloseScannerResponse response = trxService.closeScanner(null, closeRequest);
 +            String exception = response.getException();
 +            if(response.getHasException()) {
 +                String errMsg = "closeScanner encountered Exception txID: " +
 +                        ts.getTransactionId() + " Exception: " + exception;
 +                    LOG.error(errMsg);
 +            }
 +        }
 +        catch(ServiceException se) {
 +            this.interrupted = true;
 +            this.closed = false;
 +        }
 +
 +        catch (Throwable e) {
 +            String errMsg = "CloseScanner error on coprocessor call, scannerID: " + this.scannerID + " " + e;
 +            LOG.error(errMsg);
 +        }
 +
 +        if(LOG.isTraceEnabled()) LOG.trace("close() -- EXIT txID: " + ts.getTransactionId());
 +    }
 +
 +    protected boolean nextScanner(final boolean done) throws IOException{
 +        if(LOG.isTraceEnabled()) LOG.trace("nextScanner() -- ENTRY txID: " + ts.getTransactionId());
 +        if(this.interrupted) {
 +            if(LOG.isDebugEnabled()) LOG.debug("nextScanner() resetting connection, txID: " + ts.getTransactionId());
 +            ttable.resetConnection();
 +            this.interrupted = false;
 +        }
 +        if(this.currentBeginKey != null) {
 +            if(LOG.isTraceEnabled()) LOG.trace("nextScanner() currentBeginKey != null txID: " + ts.getTransactionId());
 +            if (doNotCloseOnLast)
 +              close();
 +            if((this.currentEndKey == HConstants.EMPTY_END_ROW) || 
 +                Bytes.equals(this.currentEndKey, HConstants.EMPTY_BYTE_ARRAY) ||
 +                checkScanStopRow(this.currentEndKey) || 
 +                done) {
 +                if(LOG.isTraceEnabled()) LOG.trace("endKey: " + Bytes.toString(this.currentEndKey));
 +                if(LOG.isTraceEnabled()) LOG.trace("nextScanner() -- EXIT -- returning false txID: " + ts.getTransactionId());
 +                this.moreScanners = false;
 +                return false;
 +            }
 +            else
-                 this.currentBeginKey = TransactionManager.binaryIncrementPos(this.currentEndKey,1);
++                //this.currentBeginKey = TransactionManager.binaryIncrementPos(this.currentEndKey,1);
++                  this.currentBeginKey = this.currentEndKey;
 +        }
 +        else {
 +            // First call to nextScanner
 +            this.currentBeginKey = this.scan.getStartRow();
 +        }
 +
-         this.currentRegion = ttable.getRegionLocation(this.currentBeginKey).getRegionInfo();
++        this.currentRegion = ttable.getRegionLocation(this.currentBeginKey, false).getRegionInfo();
 +        this.currentEndKey = this.currentRegion.getEndKey();
 +
-         if(LOG.isTraceEnabled()) LOG.trace("Region Info: " + currentRegion.getRegionNameAsString());
-         if(this.currentEndKey != HConstants.EMPTY_END_ROW)
-             this.currentEndKey = TransactionManager.binaryIncrementPos(currentRegion.getEndKey(), -1);
++        if(LOG.isTraceEnabled()) LOG.trace("nextScanner() txID: " + ts.getTransactionId() + " Region Info: " + currentRegion.getRegionNameAsString()+ 
++                         "currentBeginKey: " + Hex.encodeHexString(this.currentBeginKey) + "currentEndKey: " + Hex.encodeHexString(this.currentEndKey));
++        //if(this.currentEndKey != HConstants.EMPTY_END_ROW)
++        //   this.currentEndKey = TransactionManager.binaryIncrementPos(currentRegion.getEndKey(), -1);
 +
 +        this.closed = false;
 +
 +      TrxRegionProtos.OpenScannerRequest.Builder requestBuilder = OpenScannerRequest.newBuilder();
 +      requestBuilder.setTransactionId(ts.getTransactionId());
 +      requestBuilder.setRegionName(ByteString.copyFromUtf8(currentRegion.getRegionNameAsString()));
 +      requestBuilder.setScan(ProtobufUtil.toScan(scan));
 +      TrxRegionProtos.OpenScannerRequest openRequest = requestBuilder.build();
 +      try {
 +          CoprocessorRpcChannel channel = ttable.coprocessorService(this.currentBeginKey);
 +          TrxRegionService.BlockingInterface trxService = TrxRegionService.newBlockingStub(channel);
 +          TrxRegionProtos.OpenScannerResponse response = trxService.openScanner(null, openRequest);
 +          String exception = response.getException();
 +          if(response.getHasException()) {
 +              String errMsg = "nextScanner encountered Exception txID: " +
 +                      ts.getTransactionId() + " Exception: " + exception;
 +                  LOG.error(errMsg);
 +                  throw new IOException(errMsg);
 +          }
 +          this.scannerID = response.getScannerId();
 +      }
 +      catch(ServiceException se) {
 +          this.interrupted = true;
 +          String errMsg = "OpenScanner error encountered Service Exception, scannerID: " + this.scannerID + " " + se;
 +          LOG.error(errMsg);
 +          throw new IOException(errMsg);
 +      }
 +      catch (Throwable e) {
 +          String errMsg = "OpenScanner error on coprocessor call, scannerID: " + this.scannerID + " " + e;
 +          LOG.error(errMsg);
 +          throw new IOException(errMsg);
 +      }
 +        this.nextCallSeq = 0;
 +        if(LOG.isTraceEnabled()) LOG.trace("nextScanner() -- EXIT -- returning true txID: " + ts.getTransactionId());
 +        return true;
 +    }
 +
 +    @Override
 +    public Result next() throws IOException {
 +        // if (LOG.isTraceEnabled()) LOG.trace("next -- ENTRY txID: " + ts.getTransactionId() + " cache size: " + cache.size());
 +        if(cache.size() == 0) {
 +            if (LOG.isTraceEnabled()) LOG.trace("next -- cache.size() == 0 txID: " + ts.getTransactionId());
 +            if(this.hasMore) {
 +                if (LOG.isTraceEnabled())
 +                    LOG.trace("next() before coprocessor PerformScan call txID: " + ts.getTransactionId());
 +                final long nextCallSeqInput = this.nextCallSeq;
 +                TrxRegionProtos.PerformScanRequest.Builder requestBuilder = PerformScanRequest.newBuilder();
 +                requestBuilder.setTransactionId(ts.getTransactionId());
 +                requestBuilder.setRegionName(ByteString.copyFromUtf8(currentRegion.getRegionNameAsString()));
 +                requestBuilder.setScannerId(scannerID);
 +                requestBuilder.setNumberOfRows(nbRows);
 +                if (doNotCloseOnLast)
 +                    requestBuilder.setCloseScanner(false);
 +                else
 +                    requestBuilder.setCloseScanner(true);
 +                requestBuilder.setNextCallSeq(nextCallSeqInput);
 +                TrxRegionProtos.PerformScanRequest perfScanRequest = requestBuilder.build();
 +                TrxRegionProtos.PerformScanResponse response;
 +                try {
 +                    CoprocessorRpcChannel channel = ttable.coprocessorService(this.currentBeginKey);
 +                    TrxRegionService.BlockingInterface trxService = TrxRegionService.newBlockingStub(channel);
 +                    response = trxService.performScan(null, perfScanRequest);
 +                    String exception = response.getException();
 +                    if(response.getHasException()) {
 +                        String errMsg = "performScan encountered Exception txID: " +
 +                                ts.getTransactionId() + " Exception: " + exception;
 +                            LOG.error(errMsg);
 +                            throw new IOException(errMsg);
 +                    }
 +                }
 +                catch (ServiceException se) {
 +                    this.interrupted = true;
 +                    if(LOG.isDebugEnabled()) LOG.debug("PerformScan encountered Service Exception, scannerID: " + this.scannerID + " " + se);
 +                    return null;
 +                }
 +                catch (Throwable e) {
 +                    String errMsg = "PerformScan error on coprocessor call, scannerID: " + this.scannerID + " " + e;
 +                    if(LOG.isErrorEnabled()) LOG.error(errMsg);
 +                    throw new IOException(errMsg);
 +                }
 +                int count;
 +                org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result result;
 +
 +                this.nextCallSeq = response.getNextCallSeq();
 +                count = response.getResultCount();
 +                if (LOG.isTraceEnabled()) LOG.trace("next() nextCallSeq: " + this.nextCallSeq +
 +                        " count: " + count);
 +                if(count == 0) {
 +                    this.hasMore = false;
 +                }
 +                else {
 +                    for (int i = 0; i < count; i++) {
 +                        result = response.getResult(i);
 +                        if (result != null) {
 +                            cache.add(ProtobufUtil.toResult(result));
 +                        }
 +                        this.hasMore = response.getHasMore();
 +                        if (LOG.isTraceEnabled())
 +                            LOG.trace("  PerformScan response count " + count + ", hasMore is " + hasMore + ", result " + result);
 +                    }
 +
 +                }
 +            }
 +            else {
 +              if(LOG.isTraceEnabled()) LOG.trace("hasMore is false");
 +              if(nextScanner(false)){
 +                  if(LOG.isTraceEnabled()) LOG.trace("next(), nextScanner == true nextCallSeq: " + this.nextCallSeq);
 +                  this.hasMore = true;
 +                  return next();
 +              }
 +              else {
 +                  if(LOG.isTraceEnabled()) LOG.trace("next(), nextScanner == false");
 +                  this.moreScanners = false;
 +                  return null;
 +              }
 +            }
 +        }
 +        if (cache.size() > 0)  {
 +            // if(LOG.isTraceEnabled()) LOG.trace("next() returning cache.poll()");
 +            return cache.poll();
 +        }
 +        else if(this.moreScanners){
 +            if(LOG.isTraceEnabled()) LOG.trace("next() more scanners");
 +            return next();
 +        }
 +        else {
 +            if(LOG.isTraceEnabled()) LOG.trace("next() returning null");
 +            return null;
 +        }
 +    }
 +#ifdef HDP2.3
 +    @Override
 +#endif
 +    public boolean renewLease() {
 +        return true;
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sql/pom.xml
----------------------------------------------------------------------
diff --cc core/sql/pom.xml
index 1c3ba4f,83472fa..f96c38f
mode 100644,100755..100644
--- a/core/sql/pom.xml
+++ b/core/sql/pom.xml
@@@ -28,11 -28,10 +28,11 @@@
  
    <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 +    <hadoop.version>2.6.0-cdh5.4.4</hadoop.version>
-     <hbase.version>1.0.0-cdh5.4.4</hbase.version>    
-     <hbase-trx.id>hbase-trx-cdh5_4</hbase-trx.id>
-     <hive.version>1.1.0-cdh5.4.4</hive.version>
-     <thrift.version>0.9.0</thrift.version>
+     <hbase.version>${env.HBASE_DEP_VER}</hbase.version>
+     <hbase-trx.id>${env.HBASE_TRX_ID}</hbase-trx.id>
+     <hive.version>${env.HIVE_DEP_VER}</hive.version>
+     <thrift.version>${env.THRIFT_DEP_VER}</thrift.version>
      <java.version>1.7</java.version>
    </properties>
  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f1c7f3a7/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
----------------------------------------------------------------------



[29/50] [abbrv] incubator-trafodion git commit: update

Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/681cad66/core/sql/regress/charsets/EXPECTED012
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED012 b/core/sql/regress/charsets/EXPECTED012
index 4574ba5..d38b2df 100755
--- a/core/sql/regress/charsets/EXPECTED012
+++ b/core/sql/regress/charsets/EXPECTED012
@@ -19,7 +19,7 @@
 >>
 >>showddl tlongvarchar0;
 
-CREATE TABLE CAT.SCH.TLONGVARCHAR0
+CREATE TABLE TRAFODION.SCH.TLONGVARCHAR0
   (
     A                                VARCHAR(10) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT NULL
@@ -29,7 +29,7 @@ CREATE TABLE CAT.SCH.TLONGVARCHAR0
 --- SQL operation complete.
 >>showddl tlongwvarchar0;
 
-CREATE TABLE CAT.SCH.TLONGWVARCHAR0
+CREATE TABLE TRAFODION.SCH.TLONGWVARCHAR0
   (
     A                                VARCHAR(50) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT NULL
@@ -39,11 +39,12 @@ CREATE TABLE CAT.SCH.TLONGWVARCHAR0
 --- SQL operation complete.
 >>invoke  tlongwvarchar1;
 
--- Definition of table CAT.SCH.TLONGWVARCHAR1
--- Definition current  Sat Jul 29 13:18:17 2006
+-- Definition of Trafodion table TRAFODION.SCH.TLONGWVARCHAR1
+-- Definition current  Thu Feb 25 10:25:29 2016
 
   (
-    A                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
+    SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
+  , A                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT _UCS2'good day'
   , B                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
       DEFAULT DEFAULT _UCS2'today'
@@ -120,11 +121,11 @@ tomorrow_suffix
 >>select a || _ucs2'_suffix' from tlongwvarchar1;
 
 (EXPR)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------------------------
 
-abc_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
-today_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
-good day_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
+abc_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                           
+today_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                           
+good day_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                           
 
 --- 3 row(s) selected.
 >>