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

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

Fixes for Jira's trafodion-19 & trafodion-29

See Jira's for a description.
Also removed obsolete code from the parser


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

Branch: refs/heads/master
Commit: 74020c2ef9f8db1c9edc14eebb7db820484bb72e
Parents: d081b7d
Author: Roberta Marton <ro...@esgyn.com>
Authored: Wed Aug 19 23:20:10 2015 +0000
Committer: Roberta Marton <ro...@esgyn.com>
Committed: Wed Aug 19 23:20:10 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                 |    5 +-
 core/sql/comexe/ComTdb.h                     |    5 +-
 core/sql/common/ComMisc.cpp                  |   14 +
 core/sql/common/ComMisc.h                    |    5 +
 core/sql/common/ComObjectName.h              |   47 +
 core/sql/common/ComSmallDefs.cpp             |    4 +-
 core/sql/common/ComSmallDefs.h               |   23 +-
 core/sql/common/OperTypeEnum.h               |    2 -
 core/sql/generator/Generator.cpp             |    2 +
 core/sql/optimizer/BindRelExpr.cpp           |   20 +-
 core/sql/optimizer/NATable.cpp               |  169 ++--
 core/sql/optimizer/NATable.h                 |   19 +-
 core/sql/optimizer/ObjectNames.h             |   29 +-
 core/sql/optimizer/RelExeUtil.cpp            |   47 +-
 core/sql/parser/AllElemDDL.h                 |    1 -
 core/sql/parser/ElemDDLIndexPopulateOption.h |    6 +-
 core/sql/parser/ElemDDLNode.cpp              |   18 -
 core/sql/parser/ElemDDLNode.h                |    6 -
 core/sql/parser/ElemDDLPartition.cpp         |   54 --
 core/sql/parser/ElemDDLPartitionSystem.h     |   69 --
 core/sql/parser/ParAll.cpp                   |    1 -
 core/sql/parser/SqlParserAux.cpp             |   83 ++
 core/sql/parser/SqlParserAux.h               |   65 ++
 core/sql/parser/StmtDDLCreate.cpp            |  135 ---
 core/sql/parser/StmtDDLCreateIndex.h         |   46 -
 core/sql/parser/StmtDDLCreateTable.h         |   89 +-
 core/sql/parser/StmtDDLNode.h                |   11 +-
 core/sql/parser/sqlparser.y                  |  410 +++-----
 core/sql/regress/catman1/EXPECTED135         |    8 +-
 core/sql/regress/compGeneral/EXPECTED042     |   32 +-
 core/sql/regress/executor/EXPECTED106        | 1074 ++++++++++-----------
 core/sql/regress/executor/TEST106            |  270 +++---
 core/sql/regress/hive/EXPECTED009            |  275 ++++++
 core/sql/regress/hive/TEST009                |  106 ++
 core/sql/regress/hive/TEST009_a.hive.sql     |   64 ++
 core/sql/sqlcat/desc.h                       |    1 +
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h       |    4 +-
 core/sql/sqlcomp/CmpDescribe.cpp             |   25 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h             |   24 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp     |  126 ++-
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp      |   11 +-
 core/sql/sqlcomp/CmpSeabaseDDLmd.h           |   10 +
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp    |   46 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp      |  587 ++++++++---
 core/sql/sqlcomp/CmpSeabaseDDLutil.cpp       |    3 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp       |   40 +-
 core/sql/sqlcomp/PrivMgrMD.cpp               |    8 +-
 47 files changed, 2415 insertions(+), 1684 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index f90cfa6..200c944 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -179,8 +179,8 @@
 1177 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Internal error: trying to create an object with a qualified name type of $0~string0. This qualified name type is not supported. 
 1178 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Internal error: unable to find catalog associated with uid $0~string0.  This catalog is being accessed by role $1~string1.
 1179 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Internal error: inconsistent object definition for $0~TableName found for object in name space $0~string0. Object owned by $1~string1. Unable to find object details in $2~string2;
-1180 ZZZZZ 99999 BEGINNER MAJOR DBADMIN The required subvolume name for locations in schema $0~SchemaName is $1~String0.
-1181 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Label $0~String0 could not be dropped (file error $1~NSKCode). 
+1180 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to create an external table $0~TableName with a different schema or table name than the source table $1~TableName.  The external schema and table name must be the same as the source. 
+1181 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to create a schema with name $0~TableName to store the definition of a native HIVE or HBASE table and the name is too long.  Maximum length supported is $0~Int0.
 1182 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $0~NSKCode was returned by the file system on resource fork $1~String0.
 1183 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $0~NSKCode was returned by the file system on metadata table $1~TableName (file name $2~String0).
 1184 ZZZZZ 99999 BEGINNER MAJOR DBADMIN You do not have the required privilege(s) on $0~ColumnName.
@@ -1287,6 +1287,7 @@ $1~String1 --------------------------------
 4255 ZZZZZ 99999 BEGINNER MINOR DBADMIN Provided schema name does not exist in metadata. Cleanup will be performed on objects in this schema, if they exist.
 4256 ZZZZZ 99999 BEGINNER MINOR DBADMIN Object type specified for this object does not match the object type stored in metadata.
 4257 ZZZZZ 99999 BEGINNER MINOR DBADMIN DIVISION BY with an approximate numeric data type is not supported.
+4258 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Trying to access external table $0~TableName through its external name format. Please use the native table name.
 4300 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Use of procedure $0~TableName was not valid - a UDR was invoked within a trigger.
 4301 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Use of routine $0~TableName was not valid - return of result sets is not allowed within a trigger.
 4302 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Procedure $0~TableName expects $1~Int0 parameters but was called with $1~int1 parameters.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/comexe/ComTdb.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdb.h b/core/sql/comexe/ComTdb.h
index b72b836..93f3553 100644
--- a/core/sql/comexe/ComTdb.h
+++ b/core/sql/comexe/ComTdb.h
@@ -897,11 +897,10 @@ class ComTdbVirtTableTableInfo  : public ComTdbVirtTableBase
   Int32 schemaOwnerID;
   const char * hbaseCreateOptions;
   Lng32 numSaltPartns; // num of salted partitions this table was created with.
-
-  ComRowFormat rowFormat; 
-
+  ComRowFormat rowFormat;
   const char * defaultColFam;
   const char * allColFams;
+  Int64 objectFlags; 
 };
 
 class ComTdbVirtTableColumnInfo : public ComTdbVirtTableBase

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/common/ComMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.cpp b/core/sql/common/ComMisc.cpp
index 9445138..16bb69c 100644
--- a/core/sql/common/ComMisc.cpp
+++ b/core/sql/common/ComMisc.cpp
@@ -99,3 +99,17 @@ NABoolean ComIsTrafodionReservedSchemaName(
   return FALSE;
 }
 
+// schema names of pattern "_HV ... _" and "_HB_ ... _" are reserved to store
+// external hive and hbase tables
+NABoolean ComIsTrafodionExternalSchemaName (
+                                    const NAString &schName)
+{
+  Int32 len (schName.length());
+  Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
+  if (len > prefixLen && 
+      (schName(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX || 
+       schName(0,prefixLen-1) == HBASE_EXT_SCHEMA_PREFIX) && 
+      schName(len-1) == '_' )
+    return TRUE;
+  return FALSE;
+}

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

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/common/ComObjectName.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComObjectName.h b/core/sql/common/ComObjectName.h
index caf5c85..10dedbe 100644
--- a/core/sql/common/ComObjectName.h
+++ b/core/sql/common/ComObjectName.h
@@ -280,6 +280,9 @@ class ComObjectName : public NABasicObject
     void setIsVolatile(NABoolean v)
     { (v ? flags_ |= IS_VOLATILE : flags_ &= ~IS_VOLATILE);}
 
+    inline NABoolean isExternalHive(); 
+    inline NABoolean isExternalHbase();
+
   protected:
 
     // The following constructor is invoked by a constructor of class CatRoutineActionName
@@ -591,6 +594,50 @@ ComObjectName::isValid() const
   return (NOT objectNamePart_.isEmpty());
 }
 
+// ----------------------------------------------------------------------------
+// Method: isExternalHive
+//
+// Looks at the prefix and suffix of the schema name to see the schema contains
+// external (native) hive table information.
+//
+// returns TRUE if it is a HIVE schema
+// ----------------------------------------------------------------------------
+NABoolean
+ComObjectName::isExternalHive()
+{
+  if (schemaNamePart_.isEmpty())
+    return FALSE;
+  
+  NAString schemaName(schemaNamePart_.getInternalName());
+  Int32 len (schemaName.length());
+  if (len > sizeof(HIVE_EXT_SCHEMA_PREFIX))
+    return (schemaName(0,sizeof(HIVE_EXT_SCHEMA_PREFIX)-1) == HIVE_EXT_SCHEMA_PREFIX &&
+            schemaName(len-1) == '_');
+  return FALSE;
+}
+  
+// ----------------------------------------------------------------------------
+// Method: isExternalHbase
+//
+// Looks at the prefix and suffix of the schema name to see the schema contains
+// external (native) hbase table information.
+//
+// returns TRUE if it is a hbase schema
+// ----------------------------------------------------------------------------
+NABoolean
+ComObjectName::isExternalHbase()
+{
+  if (schemaNamePart_.isEmpty())
+    return FALSE;
+
+  NAString schemaName(schemaNamePart_.getInternalName());
+  Int32 len (schemaName.length());
+  if (len > sizeof(HBASE_EXT_SCHEMA_PREFIX))
+    return (schemaName(0,sizeof(HBASE_EXT_SCHEMA_PREFIX)-1) == HBASE_EXT_SCHEMA_PREFIX &&
+            schemaName(len-1) == '_');
+  return FALSE;
+}
+
 void
 ComObjectName::setCatalogNamePart(const ComAnsiNamePart &catalogNamePart)
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/common/ComSmallDefs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSmallDefs.cpp b/core/sql/common/ComSmallDefs.cpp
index 7d44801..09211af 100644
--- a/core/sql/common/ComSmallDefs.cpp
+++ b/core/sql/common/ComSmallDefs.cpp
@@ -208,10 +208,10 @@ const char* comObjectTypeLit(ComObjectType objType)
         return COM_SYNONYM_OBJECT_LIT;
       case COM_SHARED_SCHEMA_OBJECT:
         return COM_SHARED_SCHEMA_OBJECT_LIT;
-      case COM_PRIVATE_SCHEMA_OBJECT:
-        return COM_PRIVATE_SCHEMA_OBJECT_LIT;
       case COM_EXCEPTION_TABLE_OBJECT:
         return COM_EXCEPTION_TABLE_OBJECT_LIT;
+      case COM_PRIVATE_SCHEMA_OBJECT:
+        return COM_PRIVATE_SCHEMA_OBJECT_LIT;
       case COM_SEQUENCE_GENERATOR_OBJECT:
         return COM_SEQUENCE_GENERATOR_OBJECT_LIT;
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/common/ComSmallDefs.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSmallDefs.h b/core/sql/common/ComSmallDefs.h
index 203d31d..7d19491 100644
--- a/core/sql/common/ComSmallDefs.h
+++ b/core/sql/common/ComSmallDefs.h
@@ -88,17 +88,20 @@ typedef Int32			ComUserID;
 
 typedef NABoolean               ComBoolean;
 
-#define SERVICES_USER 33334       // user id of DB__ServicesUser
-#define SUPER_USER 33333          // user id of DB__ROOT
-#define SUPER_USER_LIT "33333"
 
-// Defines for special users
-#define DB__USERADMIN_ROLE      "DB__USERADMIN"
+// Defines for special users and roles
+#define DB__HIVEROLE      "DB__HIVEROLE"
+#define DB__HBASEROLE      "DB__HBASEROLE"
 #define DB__ROOTROLE            "DB__ROOTROLE"
 #define DB__ROOT                "DB__ROOT"
-// Defines for special users
+#define SUPER_USER_LIT "33333"
+
 #define SYSTEM_USER -2
 #define PUBLIC_USER -1
+#define SUPER_USER 33333          // user id of DB__ROOT
+
+#define HIVE_ROLE_ID 1490000      // role id of DB__HIVEROLE
+#define HBASE_ROLE_ID 1490001     // role id of DB__HBASEROLE
 
 // Defaults for system attributes
 #define SMD_LOCATION  "$SYSTEM"
@@ -114,6 +117,7 @@ typedef NABoolean               ComBoolean;
 #define HIVE_SYSTEM_SCHEMA           "HIVE"
 #define HIVE_STATS_CATALOG           "TRAFODION"
 #define HIVE_STATS_SCHEMA            "HIVESTATS"
+#define HIVE_EXT_SCHEMA_PREFIX       "_HV_"
 
 #define HBASE_SYSTEM_CATALOG          "HBASE"
 #define HBASE_SYSTEM_SCHEMA           "HBASE"
@@ -121,6 +125,8 @@ typedef NABoolean               ComBoolean;
 #define HBASE_HISTINT_NAME            "SB_HISTOGRAM_INTERVALS"
 #define HBASE_HIST_PK                    "SB_HISTOGRAMS_PK"
 #define HBASE_HISTINT_PK               "SB_HISTOGRAM_INTERVALS_PK"
+#define HBASE_EXT_SCHEMA_PREFIX       "_HB_"
+
 #define TRAFODION_SYSCAT_LIT              "TRAFODION"
 #define SEABASE_SYSTEM_SCHEMA           "SEABASE"
 #define SEABASE_OLD_PRIVMGR_SCHEMA         "PRIVMGR_MD"
@@ -1062,6 +1068,7 @@ enum ComRowFormat {  COM_UNKNOWN_FORMAT_TYPE
                      , COM_PACKED_FORMAT_TYPE
                      , COM_ALIGNED_FORMAT_TYPE
                      , COM_HBASE_FORMAT_TYPE
+                     , COM_HIVE_EXTERNAL_FORMAT_TYPE
 };
 
 #define COM_ROWFORMAT_LIT_LEN                2
@@ -1069,6 +1076,7 @@ enum ComRowFormat {  COM_UNKNOWN_FORMAT_TYPE
 #define COM_PACKED_FORMAT_LIT                "PF"
 #define COM_ALIGNED_FORMAT_LIT               "AF"
 #define COM_HBASE_FORMAT_LIT                   "HF"
+#define COM_HIVE_EXTERNAL_FORMAT_TYPE_LIT    "EV"
 
 // table load action: regular, SET or MULTISET.
 // Regular:  will error out if duplicate key is inserted.
@@ -1517,7 +1525,8 @@ enum ComSchemaType { COM_USER_TYPE,
 enum ComSchemaClass { COM_SCHEMA_CLASS_UNKNOWN = 2,
                       COM_SCHEMA_CLASS_PRIVATE = 3,
                       COM_SCHEMA_CLASS_SHARED = 4,
-                      COM_SCHEMA_CLASS_DEFAULT = 5};
+                      COM_SCHEMA_CLASS_DEFAULT = 5
+                    };
 
 enum ComSQLDataType { COM_UNKNOWN_SDT
                     , COM_CHARACTER_SDT

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/common/OperTypeEnum.h
----------------------------------------------------------------------
diff --git a/core/sql/common/OperTypeEnum.h b/core/sql/common/OperTypeEnum.h
index fd01f5a..17eb793 100644
--- a/core/sql/common/OperTypeEnum.h
+++ b/core/sql/common/OperTypeEnum.h
@@ -1044,8 +1044,6 @@ enum OperatorTypeEnum {
                         ELM_LIKE_OPT_WITH_HORIZONTAL_PARTITIONS_ELEM,
                         ELM_LIKE_OPT_WITHOUT_SALT_ELEM,
                         ELM_LIKE_OPT_WITHOUT_DIVISION_ELEM,
-                        ELM_LOAD_OPT_D_SLACK_ELEM,
-                        ELM_LOAD_OPT_I_SLACK_ELEM,
                         ELM_LOCATION_ELEM,
                         ELM_OPTION_LIST,
                         ELM_PARALLEL_EXEC_ELEM,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/generator/Generator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/Generator.cpp b/core/sql/generator/Generator.cpp
index 9176bfe..38fa134 100644
--- a/core/sql/generator/Generator.cpp
+++ b/core/sql/generator/Generator.cpp
@@ -1868,6 +1868,8 @@ desc_struct * Generator::createVirtualTableDesc(
       strcpy(table_desc->body.table_desc.all_col_fams, tableInfo->allColFams);
     }
 
+  table_desc->body.table_desc.tableFlags = (tableInfo ? tableInfo->objectFlags : 0);
+
   desc_struct * files_desc = readtabledef_allocate_desc(DESC_FILES_TYPE);
   //  files_desc->body.files_desc.audit = -1; // audited table
   files_desc->body.files_desc.audit = (tableInfo ? tableInfo->isAudited : -1);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index 63329b1..8afe3b7 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -1391,8 +1391,6 @@ NATable *BindWA::getNATable(CorrName& corrName,
       CorrName newCorrName = 
         CmpCommon::context()->sqlSession()->getVolatileCorrName
           (corrName);
-      newCorrName.applyDefaults(bindWA, bindWA->getDefaultSchema());
-	  newCorrName.setGenRcb(corrName.genRcb());
       if (bindWA->errStatus())
         return NULL;
 
@@ -1571,6 +1569,21 @@ NATable *BindWA::getNATable(CorrName& corrName,
       ((QualifiedName&)(table->getTableName())).setIsVolatile(TRUE);
     }
       
+  // For now, do not allow access through the Trafodion external name created for
+  // the HIVE object unless the inDDL flag is set.  inDDL is set for drop 
+  // table and SHOWDDL statements.  
+  // TDB - may want to merge the Trafodion version with the HIVE version.
+  // TDB - similar operation may be needed for external HBase tables
+  if ((table) && (table->isExternalTable() && (! bindWA->inDDL())))
+    {
+      *CmpCommon::diags() << DgSqlCode(-4258)
+                          << DgTableName(table->getTableName().getQualifiedNameAsAnsiString());
+
+      bindWA->setErrStatus();
+      return NULL;
+    }
+
+    
   HostVar *proto = corrName.getPrototype();
   if (proto && proto->isPrototypeValid())
     corrName.getPrototype()->bindNode(bindWA);
@@ -7004,9 +7017,6 @@ OptSqlTableOpenInfo *setupStoi(OptSqlTableOpenInfo *&optStoi_,
                                const CorrName &corrName,
                                NABoolean noSecurityCheck)
 {
-  if ( naTable->isHiveTable() )
-     return NULL;
-
   // Get the PHYSICAL (non-Ansi/non-delimited) filename of the table or view.
   CMPASSERT(!naTable->getViewText() || naTable->getViewFileName());
   NAString fileName( naTable->getViewText() ?

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index 81ebed1..2f8def0 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -4851,7 +4851,8 @@ NATable::NATable(BindWA *bindWA,
     privInfo_(NULL),
     secKeySet_(heap),
     newColumns_(heap),
-    snapshotName_(NULL)
+    snapshotName_(NULL),
+    prototype_(NULL)
 {
   NAString tblName = qualifiedName_.getQualifiedNameObj().getQualifiedNameAsString();
   NAString mmPhase;
@@ -4959,6 +4960,11 @@ NATable::NATable(BindWA *bindWA,
     setDroppableTable( TRUE );
   }
 
+  if (corrName.isExternal())
+  {
+    setIsExternalTable(TRUE);
+  }
+ 
   insertMode_ = table_desc->body.table_desc.insertMode;
 
   setRecordLength(table_desc->body.table_desc.record_length);
@@ -4990,6 +4996,10 @@ NATable::NATable(BindWA *bindWA,
   if (!(corrName.isSeabaseMD() || corrName.isSpecialTable()))
     setupPrivInfo();
 
+  if ((table_desc->body.table_desc.tableFlags & SEABASE_OBJECT_IS_EXTERNAL_HIVE) != 0 ||
+      (table_desc->body.table_desc.tableFlags & SEABASE_OBJECT_IS_EXTERNAL_HBASE) != 0)
+    setIsExternalTable(TRUE);
+
   rcb_ = table_desc->body.table_desc.rcb;
   rcbLen_ = table_desc->body.table_desc.rcbLen;
   keyLength_ = table_desc->body.table_desc.keyLen;
@@ -5447,6 +5457,50 @@ NATable::NATable(BindWA *bindWA,
 #pragma warn(770)  // warning elimination
 
 
+// ----------------------------------------------------------------------------
+// method: lookupObjectUid
+//
+// Calls DDL manager to get the object UID for the specified object
+//
+// params:
+//    qualName - name of object to lookup
+//    objectType - type of object
+//
+// returns:
+//   -1 -> error found trying to read metadata including object not found
+//   UID of found object
+//
+// the diags area contains details of any error detected
+//
+// *** recent change - move this function up in this file and move resetting
+//     of ComDiagsArea to the caller ***
+// ----------------------------------------------------------------------------      
+Int64 lookupObjectUid( const QualifiedName& qualName
+                     , ComObjectType objectType
+                     )
+{
+  ExeCliInterface cliInterface(STMTHEAP);
+  Int64 objectUID = 0;
+
+  CmpSeabaseDDL cmpSBD(STMTHEAP);
+  if (cmpSBD.switchCompiler(CmpContextInfo::CMPCONTEXT_TYPE_META))
+    {
+      if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) == 0)
+        *CmpCommon::diags() << DgSqlCode( -4400 );
+
+      return -1;
+    }
+
+  objectUID = cmpSBD.getObjectUID(&cliInterface,
+                                  qualName.getCatalogName().data(),
+                                  qualName.getSchemaName().data(),
+                                  qualName.getObjectName().data(),
+                                  comObjectTypeLit(objectType));
+
+  cmpSBD.switchBackCompiler();
+
+  return objectUID;
+}
 
 // Constructor for a Hive table
 NATable::NATable(BindWA *bindWA,
@@ -5589,39 +5643,60 @@ NATable::NATable(BindWA *bindWA,
   cacheTime_  = longArrayToInt64(table_desc->body.table_desc.cachetime);
 */
 
-  // To get from the qualified name for catalog and schema
-/*
-  catalogUID_ = longArrayToInt64(table_desc->body.table_desc.catUID);
-  schemaUID_ = longArrayToInt64(table_desc->body.table_desc.schemaUID);
-  objectUID_ = longArrayToInt64(table_desc->body.table_desc.objectUID);
-*/
+  // NATable has a schemaUID column, probably should propogate it.
+  // for now, set to 0.
+  schemaUID_ = 0;
 
-/*
+  // Set the objectUID_
+  // If the HIVE table has been registered in Trafodion, get the objectUID
+  // from Trafodion, otherwise, set it to 0.
+  // TBD - does getQualifiedNameObj handle delimited names correctly?
+  QualifiedName extObjName (corrName.getQualifiedNameObj().getObjectName(),
+                            corrName.getQualifiedNameObj().getSchemaName(),
+                            TRAFODION_SYSCAT_LIT,
+                            STMTHEAP);
 
-  if (table_desc->body.table_desc.owner)
-    {
-#ifdef NA_WINNT
-      NAUserInfo userInfo;
-      userInfo.setUserId(table_desc->body.table_desc.owner, TRUE);
-#else
-      NAUserInfo userInfo (table_desc->body.table_desc.owner);
-#endif
-      owner_ = userInfo;
-    }
-  if (table_desc->body.table_desc.schemaOwner)
+  Lng32 diagsMark = CmpCommon::diags()->mark();
+  objectUID_ = ::lookupObjectUid(extObjName, COM_BASE_TABLE_OBJECT);
+
+  // If the objectUID is not found, then the table is not externally defined
+  // in Trafodion, set the objectUID to 0
+  // If an unexpected error occurs, then return with the error
+  if (objectUID_ <= 0)
     {
-#ifdef NA_WINNT
-      NAUserInfo schemaUser;
-      schemaUser.setUserId(table_desc->body.table_desc.schemaOwner, TRUE);
-#else
-      NAUserInfo schemaUser(table_desc->body.table_desc.schemaOwner);
-#endif
-      schemaOwner_ = schemaUser;
+      if (CmpCommon::diags()->contains(-1389))
+        {
+          CmpCommon::diags()->rewind(diagsMark);
+          objectUID_ = 0;
+        }
+      else
+        return;
     }
-*/
+  else
+    setHasExternalTable(TRUE);
+ 
+  // for HIVE objects, the schema owner and table owner is HIVE_ROLE_ID
+  if (CmpCommon::context()->isAuthorizationEnabled())
+  {
+    owner_ = HIVE_ROLE_ID;
+    schemaOwner_ = HIVE_ROLE_ID;
+  }
+  else
+  {
+     owner_ = SUPER_USER;
+     schemaOwner_ = SUPER_USER;
+  }
 
+  if (hasExternalTable())
+    setupPrivInfo();
 
-// What object type code to use? 
+  // TBD - if authorization is enabled and there is no external table to store
+  // privileges, go get privilege information from HIVE metadata ...
+  
+  // TBD - add a check to verify that the column list coming from HIVE matches
+  // the column list stored in the external table.  Maybe some common method
+  // that can be used to compare other things as well...
+ 
   objectType_ = COM_BASE_TABLE_OBJECT;
 
 // to check
@@ -6611,7 +6686,8 @@ void NATable::setupPrivInfo()
     }
 
   privInfo_ = new(heap_) PrivMgrUserPrivs;
-  if (!isSeabaseTable() || 
+
+  if ((!isSeabaseTable() && !isHiveTable()) ||
       !CmpCommon::context()->isAuthorizationEnabled() ||
       isVolatileTable() ||
       ComUser::isRootUserID()||
@@ -6673,31 +6749,6 @@ void NATable::setupPrivInfo()
 
 }
 
-Int64 lookupObjectUid( const QualifiedName& qualName
-                     , ComObjectType objectType
-                    )
-{
-  ExeCliInterface cliInterface(STMTHEAP);
-  Int64 objectUID = 0;
-
-  Lng32 diagsMark = CmpCommon::diags()->mark();
-
-  CmpSeabaseDDL cmpSBD(STMTHEAP);
-  objectUID = cmpSBD.getObjectUID(&cliInterface, 
-                                  qualName.getCatalogName().data(),
-                                  qualName.getSchemaName().data(),
-                                  qualName.getObjectName().data(),
-                                  comObjectTypeLit(objectType));
-
-  if (objectUID <= 0)
-    {
-      // remove errors
-      CmpCommon::diags()->rewind(diagsMark);
-    }
-
-  return objectUID;
-}
-
 // Query the metadata to find the object uid of the table. This is used when
 // the uid for a metadata table is requested, since 0 is usually stored for
 // these tables.
@@ -7788,12 +7839,6 @@ NATable * NATableDB::get(CorrName& corrName, BindWA * bindWA,
   //check cache to see if a cached NATable object exists
   NATable *table = get(&corrName.getExtendedQualNameObj(), bindWA);  
 
-  if (table && corrName.genRcb())
-    {
-      remove(table->getKey());
-      table = NULL;
-    }
-
   if (table && (corrName.isHbase() || corrName.isSeabase()) && inTableDescStruct)
     {
       remove(table->getKey());
@@ -8277,12 +8322,16 @@ void NATableDB::removeNATable(CorrName &corrName, QiScope qiScope,
       // add its objectUID to the set.
       if (0 == objectUIDs.entries())
       {
+        // ignore any errors returned
+        Lng32 diagsMark = CmpCommon::diags()->mark();
         Int64 ouid = lookupObjectUid(
                        toRemove->getQualifiedNameObj(), 
                        ot); 
+        CmpCommon::diags()->rewind(diagsMark);
         if (ouid > 0)
           objectUIDs.insert(ouid);
       }
+
       Int32 numKeys = objectUIDs.entries();
       if (numKeys > 0)
       {                 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/optimizer/NATable.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.h b/core/sql/optimizer/NATable.h
index 76fd913..571e542 100644
--- a/core/sql/optimizer/NATable.h
+++ b/core/sql/optimizer/NATable.h
@@ -697,6 +697,19 @@ public:
   NABoolean hasSerializedColumn() const
   {  return (flags_ & SERIALIZED_COLUMN) != 0; }
 
+  void setIsExternalTable( NABoolean value )
+  {  value ? flags_ |= IS_EXTERNAL_TABLE : flags_ &= ~IS_EXTERNAL_TABLE; }
+
+  NABoolean isExternalTable() const
+  {  return (flags_ & IS_EXTERNAL_TABLE) != 0; }
+
+
+  void setHasExternalTable( NABoolean value )
+  {  value ? flags_ |= HAS_EXTERNAL_TABLE : flags_ &= ~HAS_EXTERNAL_TABLE; }
+
+  NABoolean hasExternalTable() const
+  {  return (flags_ & HAS_EXTERNAL_TABLE) != 0; }
+
   const CheckConstraintList &getCheckConstraints() const
                                                 { return checkConstraints_; }
   const AbstractRIConstraintList &getUniqueConstraints() const
@@ -909,8 +922,10 @@ private:
     DROPPABLE                 = 0x00004000,
     LOB_COLUMN                = 0x00008000,
     REMOVE_FROM_CACHE_BNC     = 0x00010000,  // Remove from NATable Cache Before Next Compilation
-    SERIALIZED_ENCODED_COLUMN  = 0x00020000,
-    SERIALIZED_COLUMN          = 0x00040000
+    SERIALIZED_ENCODED_COLUMN = 0x00020000,
+    SERIALIZED_COLUMN         = 0x00040000,
+    IS_EXTERNAL_TABLE         = 0x00080000,
+    HAS_EXTERNAL_TABLE        = 0x00100000
   };
     
   UInt32 flags_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/optimizer/ObjectNames.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.h b/core/sql/optimizer/ObjectNames.h
index f973ad3..5889b18 100644
--- a/core/sql/optimizer/ObjectNames.h
+++ b/core/sql/optimizer/ObjectNames.h
@@ -45,6 +45,7 @@
 #include "NAString.h"
 #include "NAStringDef.h"
 #include "charinfo.h"
+#include "ComMisc.h"
 
 // -----------------------------------------------------------------------
 // forward declarations
@@ -664,11 +665,7 @@ private:
     OFF           = 0, 
     ISFABRICATED = 0x1, 
     IS_VOLATILE  = 0x2,
-    
-    // this bit is set to indicate that RCB needs to be generated during 
-    // readtabledef processing. 
-    // Set by callers before calling getNATable() method.
-    GEN_RCB      = 0x4
+    IS_EXTERNAL  = 0x4
   };
 
 public:
@@ -692,6 +689,13 @@ public:
     defaultMatchCount_(-1),
     flagbits_(0)
   {
+    setIsExternal(ComIsTrafodionExternalSchemaName(schemaName));
+    //Int32 len (schemaName.length());
+    //Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
+    //if (len > prefixLen)
+    //  setIsExternal(schemaName(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX &&
+    //                schemaName(len-1) == '_' );
+
     setLocationName (locName) ;
   }
 
@@ -710,6 +714,13 @@ public:
     defaultMatchCount_(-1),
     flagbits_(0)
   {
+    setIsExternal(ComIsTrafodionExternalSchemaName(qualName.getSchemaName()));
+    //Int32 len (qualName.getSchemaName().length());
+    //Int32 prefixLen = sizeof(HIVE_EXT_SCHEMA_PREFIX);
+    //if (len > prefixLen)
+    //  setIsExternal(qualName.getSchemaName()(0,prefixLen-1) == HIVE_EXT_SCHEMA_PREFIX &&
+    //                qualName.getSchemaName()(len-1) == '_');
+
     setLocationName (locName) ;
   }
 
@@ -773,10 +784,6 @@ public:
   NABoolean isVolatile() const      { return (qualName_.getQualifiedNameObj().isVolatile()); }
   void setIsVolatile(NABoolean v)   { qualName_.getQualifiedNameObj().setIsVolatile(v);      }
 
-  NABoolean genRcb() const      { return (flagbits_ & GEN_RCB) != 0; }
-  void setGenRcb(NABoolean v)
-  { (v ? flagbits_ |= GEN_RCB : flagbits_ &= ~GEN_RCB);}
-
   NABoolean nodeIsBound() const				{ return bound_; }
   void markAsBound()					{ bound_ = TRUE; }
 
@@ -876,6 +883,10 @@ public:
   NABoolean isHbaseCell() const;
   NABoolean isHbaseRow() const;
 
+  NABoolean isExternal() const { return (flagbits_ & IS_EXTERNAL) != 0; }
+  void setIsExternal(NABoolean v) 
+   { (v ? flagbits_ |= IS_EXTERNAL : flagbits_ &= ~IS_EXTERNAL); }
+
   // Display/print, for debugging.
   const NAString getTextWithSpecialType() const 
   { return qualName_.getTextWithSpecialType(); }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index 6804b68..27607f7 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -3668,7 +3668,8 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
   NABoolean alterRenameTable = FALSE;
   NABoolean alterIdentityCol = FALSE;
   NABoolean alterColDatatype = FALSE;
-
+  NABoolean externalTable = FALSE;
+  
   returnStatus_ = FALSE;
 
   NABoolean specialType = FALSE;
@@ -3733,6 +3734,23 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
         return NULL;
       }
 
+      // Hive tables can only be specified as external and must be created
+      // with the FOR clause
+      if (qualObjName_.isHive()) 
+      {
+        if (createTableNode->isExternal())
+        {
+          externalTable = TRUE;
+          isHbase_ = TRUE;
+        }
+        else
+        {
+          *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("DDL");
+          bindWA->setErrStatus();
+          return NULL;
+        }
+      }
+ 
       // if unique, ref or check constrs are specified, then dont start a transaction.
       // ddl with these clauses is executed as a compound create.
       // A compound create cannot run under a user transaction.
@@ -3791,9 +3809,28 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
       isDrop_ = TRUE;
       isTable_ = TRUE;
 
-      qualObjName_ =
-        getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropTable()->
-        getTableNameAsQualifiedName();
+      StmtDDLDropTable * dropTableNode =
+        getExprNode()->castToElemDDLNode()->castToStmtDDLDropTable();
+
+      qualObjName_ = dropTableNode->getTableNameAsQualifiedName();
+
+      // Hive tables can only be specified as external and must be created
+      // with the FOR clause
+      if (qualObjName_.isHive())
+      {
+        if (dropTableNode->isExternal())
+        {
+          isHbase_ = TRUE;
+          externalTable = TRUE;
+        }
+        else
+        {
+          *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("DDL");
+          bindWA->setErrStatus();
+          return NULL;
+        }
+
+      }
     }
     else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropHbaseTable())
     {
@@ -4090,7 +4127,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
   if (bindWA->errStatus())
     return NULL;
 
-  if (isHbase_)
+  if (isHbase_ || externalTable)
     return boundExpr;
 
   *CmpCommon::diags() << DgSqlCode(-4222) << DgString0("DDL");

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/AllElemDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/AllElemDDL.h b/core/sql/parser/AllElemDDL.h
index b7e0196..9c3b2d1 100644
--- a/core/sql/parser/AllElemDDL.h
+++ b/core/sql/parser/AllElemDDL.h
@@ -58,7 +58,6 @@
 #include "ElemDDLLibClientName.h"
 #include "ElemDDLLibPathName.h"
 #include "ElemDDLLikeOptions.h"
-#include "ElemDDLLoadOptions.h"
 #include "ElemDDLLocation.h"
 #include "ElemDDLTableFeature.h"
 #include "ElemDDLHbaseOptions.h"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ElemDDLIndexPopulateOption.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLIndexPopulateOption.h b/core/sql/parser/ElemDDLIndexPopulateOption.h
index cca7ef9..ad211c5 100644
--- a/core/sql/parser/ElemDDLIndexPopulateOption.h
+++ b/core/sql/parser/ElemDDLIndexPopulateOption.h
@@ -39,9 +39,7 @@
  *****************************************************************************
  */
 
-#include "ElemDDLLoadOptions.h"
-
-class ElemDDLIndexPopulateOption : public ElemDDLLoadOpt
+class ElemDDLIndexPopulateOption : public ElemDDLNode
 {
 
 public:
@@ -50,7 +48,7 @@ public:
       // no populate both exist in one statement. Error will be issue if both populate and no populate 
       // clause exist.
       ElemDDLIndexPopulateOption ()
-        :  ElemDDLLoadOpt(ELM_WITH_POPULATE_OPTION_ELEM)
+        :  ElemDDLNode(ELM_WITH_POPULATE_OPTION_ELEM)
   
       {
 	populateCount_ = 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ElemDDLNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.cpp b/core/sql/parser/ElemDDLNode.cpp
index 2bdea29..e8a532c 100644
--- a/core/sql/parser/ElemDDLNode.cpp
+++ b/core/sql/parser/ElemDDLNode.cpp
@@ -575,24 +575,6 @@ ElemDDLNode::castToElemDDLList()
   return NULL;
 }
 
-ElemDDLLoadOpt *
-ElemDDLNode::castToElemDDLLoadOpt()
-{
-  return NULL;
-}
-
-ElemDDLLoadOptDSlack *
-ElemDDLNode::castToElemDDLLoadOptDSlack()
-{
-  return NULL;
-}
-
-ElemDDLLoadOptISlack *
-ElemDDLNode::castToElemDDLLoadOptISlack()
-{
-  return NULL;
-}
-
 ElemDDLLocation *
 ElemDDLNode::castToElemDDLLocation()
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ElemDDLNode.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.h b/core/sql/parser/ElemDDLNode.h
index 2f977bf..ad4932d 100644
--- a/core/sql/parser/ElemDDLNode.h
+++ b/core/sql/parser/ElemDDLNode.h
@@ -138,9 +138,6 @@ class ElemDDLLikeOptWithHorizontalPartitions;
 class ElemDDLLikeOptWithoutSalt;
 class ElemDDLLikeOptWithoutDivision;
 class ElemDDLList;
-class ElemDDLLoadOpt;
-class ElemDDLLoadOptDSlack;
-class ElemDDLLoadOptISlack;
 class ElemDDLLocation;
 class ElemDDLOptionList;
 class ElemDDLParallelExec;
@@ -461,9 +458,6 @@ public:
   virtual ElemDDLLikeOptWithoutSalt     * castToElemDDLLikeOptWithoutSalt();
   virtual ElemDDLLikeOptWithoutDivision * castToElemDDLLikeOptWithoutDivision();
   virtual ElemDDLList                   * castToElemDDLList();
-  virtual ElemDDLLoadOpt                * castToElemDDLLoadOpt();
-  virtual ElemDDLLoadOptDSlack          * castToElemDDLLoadOptDSlack();
-  virtual ElemDDLLoadOptISlack          * castToElemDDLLoadOptISlack();
   virtual ElemDDLLocation               * castToElemDDLLocation();
   virtual ElemDDLOptionList             * castToElemDDLOptionList();
   virtual ElemDDLParallelExec           * castToElemDDLParallelExec();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ElemDDLPartition.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLPartition.cpp b/core/sql/parser/ElemDDLPartition.cpp
index b8f7a90..fa5dc06 100644
--- a/core/sql/parser/ElemDDLPartition.cpp
+++ b/core/sql/parser/ElemDDLPartition.cpp
@@ -44,7 +44,6 @@
 #include "ComOperators.h"
 #include "ComLocationNames.h"
 #include "ElemDDLKeyValue.h"
-#include "ElemDDLLoadOptions.h"
 #include "ElemDDLLocation.h"
 #include "ElemDDLPartitionList.h"
 #include "ItemConstValueArray.h"
@@ -355,15 +354,6 @@ ElemDDLPartitionSystem::initializeDataMembers()
 
   isMaxExtentSpec_         = FALSE;
   ParSetDefaultMaxExtents(maxExt_);
- //
-  // load options
-  //
-
-  isDSlackSpec_         = FALSE;
-  dSlackPercentage_     = ElemDDLLoadOptDSlack::DEFAULT_PERCENTAGE;
-
-  isISlackSpec_         = FALSE;
-  iSlackPercentage_     = ElemDDLLoadOptISlack::DEFAULT_PERCENTAGE;
 
   //
   // location
@@ -467,28 +457,6 @@ ElemDDLPartitionSystem::setPartitionAttr(ElemDDLNode * pPartitionAttr)
 	  }
     }
 	break;
-    case ELM_LOAD_OPT_D_SLACK_ELEM :
-    if (isDSlackSpec_)
-    {
-      // cout << "*** Error *** Duplicate DSLACK phrases in PARTITION clause.
-      *SqlParser_Diags << DgSqlCode(-3063);
-    }
-    isDSlackSpec_ = TRUE;
-    dSlackPercentage_ =
-      pPartitionAttr->castToElemDDLLoadOptDSlack()->getPercentage();
-    break;
-
-    case ELM_LOAD_OPT_I_SLACK_ELEM :
-    if (isISlackSpec_)
-    {
-      // Duplicate ISLACK phrases in PARTITION clause.
-      *SqlParser_Diags << DgSqlCode(-3064);
-    }
-    isISlackSpec_ = TRUE;
-    iSlackPercentage_ =
-      pPartitionAttr->castToElemDDLLoadOptISlack()->getPercentage();
-    break;
-
   default :
     ABORT("internal logic error");
     break;
@@ -659,28 +627,6 @@ ElemDDLPartitionSystem::getDetailInfo() const
   detailText += maxSizeFileAttr.getMaxSizeUnitAsNAString();;
   detailTextList.append(detailText);
 
-  //
-  // load options for this partition
-  //
-
-  detailTextList.append("Load options:");
-
-  detailText = "    dslack spec?   ";
-  detailText += YesNo(isDSlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    dslack %:      ";
-  detailText += LongToNAString((Lng32)getDSlackPercentage());
-  detailTextList.append(detailText);
-
-  detailText = "    islack spec?   ";
-  detailText += YesNo(isISlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    islack %:      ";
-  detailText += LongToNAString((Lng32)getISlackPercentage());
-  detailTextList.append(detailText);
-
   return detailTextList;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ElemDDLPartitionSystem.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLPartitionSystem.h b/core/sql/parser/ElemDDLPartitionSystem.h
index b791a34..4a552d6 100644
--- a/core/sql/parser/ElemDDLPartitionSystem.h
+++ b/core/sql/parser/ElemDDLPartitionSystem.h
@@ -90,9 +90,6 @@ public:
   virtual Int32 getArity() const;
   virtual ExprNode * getChild(Lng32 index);
 
-  inline unsigned short getDSlackPercentage() const;
-  inline unsigned short getISlackPercentage() const;
-
   inline const NAString & getGuardianLocation() const;
 
         // returns an empty string unless the parse node
@@ -150,8 +147,6 @@ public:
         // Same as getOption() except that this method returns
         // NAString("ADD") or NAString("DROP").
 
-  inline NABoolean isDSlackSpecified() const;
-  inline NABoolean isISlackSpecified() const;
   inline NABoolean isMaxSizeSpecified() const;
   inline NABoolean isMaxSizeUnbounded() const;
   inline NABoolean isExtentSpecified() const;
@@ -162,10 +157,6 @@ public:
   //
 
   virtual void setChild(Lng32 index, ExprNode * pChildNode);
-  inline void setDSlackPercentage(unsigned short dSlackPercentage);
-  inline void setISlackPercentage(unsigned short iSlackPercentage);
-  inline void setIsDSlackSpecified(NABoolean isDSlackSpecified);
-  inline void setIsISlackSpecified(NABoolean isISlackSpecified);
   inline void setIsMaxSizeSpecified(NABoolean isMaxSizeSpecified);
   inline void setIsMaxSizeUnbounded(NABoolean isMaxSizeUnbounded);
   inline void setIsExtentSpecified(NABoolean isExtentSpecified);
@@ -272,18 +263,6 @@ private:
   NABoolean isMaxExtentSpec_;
   ULng32 maxExt_;
 
-  //
-  // load options
-  //
-
-  // DSLACK
-  NABoolean isDSlackSpec_;
-  unsigned short dSlackPercentage_;     // percentage of free data blocks
-
-  // ISLACK
-  NABoolean isISlackSpec_;
-  unsigned short iSlackPercentage_;     // percentage of free index blocks
-
 }; // class ElemDDLPartitionSystem
 
 // -----------------------------------------------------------------------
@@ -294,18 +273,6 @@ private:
 // accessors
 //
 
-inline unsigned short
-ElemDDLPartitionSystem::getDSlackPercentage() const
-{
-  return dSlackPercentage_;
-}
-
-inline unsigned short
-ElemDDLPartitionSystem::getISlackPercentage() const
-{
-  return iSlackPercentage_;
-}
-
 inline const NAString &
 ElemDDLPartitionSystem::getGuardianLocation() const
 {
@@ -387,18 +354,6 @@ ElemDDLPartitionSystem::getPartitionSystemAttrList() const
 }
 
 inline NABoolean
-ElemDDLPartitionSystem::isDSlackSpecified() const
-{
-  return isDSlackSpec_;
-}
-
-inline NABoolean
-ElemDDLPartitionSystem::isISlackSpecified() const
-{
-  return isISlackSpec_;
-}
-
-inline NABoolean
 ElemDDLPartitionSystem::isMaxSizeSpecified() const
 {
   return isMaxSizeSpec_;
@@ -426,30 +381,6 @@ ElemDDLPartitionSystem::isMaxSizeUnbounded() const
 // mutators
 //
 
-inline void 
-ElemDDLPartitionSystem::setDSlackPercentage(unsigned short dSlackPercentage)
-{
-  dSlackPercentage_ = dSlackPercentage;
-}
-
-inline void 
-ElemDDLPartitionSystem::setISlackPercentage(unsigned short iSlackPercentage)
-{
-  iSlackPercentage_ = iSlackPercentage;
-}
-
-inline void
-ElemDDLPartitionSystem::setIsDSlackSpecified(NABoolean isDSlackSpecified)
-{
-  isDSlackSpec_ = isDSlackSpecified;
-}
-
-inline void
-ElemDDLPartitionSystem::setIsISlackSpecified(NABoolean isISlackSpecified)
-{
-  isISlackSpec_ = isISlackSpecified;
-}
-
 inline void
 ElemDDLPartitionSystem::setIsMaxSizeSpecified(NABoolean isMaxSizeSpecified)
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/ParAll.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParAll.cpp b/core/sql/parser/ParAll.cpp
index ebddbcc..e73ac87 100644
--- a/core/sql/parser/ParAll.cpp
+++ b/core/sql/parser/ParAll.cpp
@@ -34,7 +34,6 @@
 #include "ElemDDLLike.cpp"		
 #include "ElemDDLLikeOptions.cpp"	
 #include "ElemDDLList.cpp"		
-#include "ElemDDLLoadOptions.cpp"	
 #include "ElemDDLNode.cpp"        
 #include "ElemDDLParam.cpp"           
 #include "ElemDDLPartition.cpp"	

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/SqlParserAux.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.cpp b/core/sql/parser/SqlParserAux.cpp
index ab9b4f8..6044ec5 100644
--- a/core/sql/parser/SqlParserAux.cpp
+++ b/core/sql/parser/SqlParserAux.cpp
@@ -3294,6 +3294,89 @@ SqlParserAux_buildDescribeForFunctionAndAction
                                     );
 }
 
+// ----------------------------------------------------------------------------
+// method:: TableTokens::setTableTokens
+//
+// Method that sets appropriate values in the createTableNode parser tree
+// based on options described in this class.
+//
+// in:  StmtDDLCreateTable *pNode - pointer to the create table parse tress
+//
+// ----------------------------------------------------------------------------
+void
+TableTokens::setTableTokens(StmtDDLCreateTable *pNode)
+{
+  pNode->setCreateIfNotExists(ifNotExistsSet());
+
+  switch (type_)
+  {
+    case TableTokens::TYPE_REGULAR_TABLE:
+    case TableTokens::TYPE_GHOST_TABLE:
+      break;
+
+    case TableTokens::TYPE_EXTERNAL_TABLE:
+      pNode->setIsExternal(TRUE);
+      break;
+
+    case TableTokens::TYPE_SET_TABLE:
+      pNode->setInsertMode(COM_SET_TABLE_INSERT_MODE);
+      break;
+
+    case TableTokens::TYPE_MULTISET_TABLE:
+      pNode->setInsertMode(COM_MULTISET_TABLE_INSERT_MODE);
+      break;
+
+    case TableTokens::TYPE_VOLATILE_TABLE:
+      pNode->setIsVolatile(TRUE);
+      pNode->setProcessAsExeUtil(TRUE);
+      break;
+
+    case TableTokens::TYPE_VOLATILE_TABLE_MODE_SPECIAL1:
+    case TableTokens::TYPE_VOLATILE_SET_TABLE:
+      pNode->setIsVolatile(TRUE);
+      pNode->setProcessAsExeUtil(TRUE);
+      pNode->setInsertMode(COM_SET_TABLE_INSERT_MODE);
+      break;
+
+    case TableTokens::TYPE_VOLATILE_MULTISET_TABLE:
+      pNode->setProcessAsExeUtil(TRUE);
+      pNode->setInsertMode(COM_MULTISET_TABLE_INSERT_MODE);
+      break;
+
+    default:
+      NAAbort("TableTokens - TypeAttr", __LINE__, "internal logic error");
+      break;
+  }
+
+  switch (options_)
+  {
+    case TableTokens::OPT_NONE:
+      break;
+
+    case TableTokens::OPT_LOAD:
+      pNode->setLoadIfExists(TRUE);
+      break;
+
+    case TableTokens::OPT_NO_LOAD:
+      pNode->setNoLoad(TRUE);
+      break;
+
+    case TableTokens::OPT_IN_MEM:
+      pNode->setNoLoad(TRUE);
+      pNode->setInMemoryObjectDefn(TRUE);
+      break;
+
+    case TableTokens::OPT_LOAD_WITH_DELETE:
+      pNode->setLoadIfExists(TRUE);
+      pNode->setDeleteData(TRUE);
+      break;
+
+    default:
+      NAAbort("TableTokens - LoadAttr", __LINE__, "internal logic error");
+      break;
+  }
+}
+
 //
 // End of File
 //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/SqlParserAux.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.h b/core/sql/parser/SqlParserAux.h
index b6e40c7..d7ac3dd 100644
--- a/core/sql/parser/SqlParserAux.h
+++ b/core/sql/parser/SqlParserAux.h
@@ -55,6 +55,7 @@
 #include "LateBindInfo.h"
 #include "ComVersionDefs.h"
 #include "ParScannedTokenQueue.h"
+#include "StmtDDLCreateTable.h"
 
 class NAWString;
 
@@ -741,6 +742,70 @@ class MultiValueExprList
 // INSERT2000 COLUMN FIX ENDS HERE
 // */
 
+// ----------------------------------------------------------------------------
+// Class: TableTokens
+//
+// This is a helper class that gathers tokens from different create table
+// productions to make setting values in the create table parser node more
+// uniform.
+//
+// Class contains three members:
+//   type_ - describe the type of table as specified by the create table
+//           start tokens
+//   options_ - describe how data is loaded for create table statements
+//           that load data
+//   ifNotExistsSet - A table token that tells the create code to ignore
+//           already exists errors.
+// ----------------------------------------------------------------------------           
+class TableTokens : public NABasicObject
+{
+public:
+  // Type of tables available from create table start tokens
+  enum TableType
+    { TYPE_REGULAR_TABLE = 0,
+      TYPE_EXTERNAL_TABLE,
+      TYPE_SET_TABLE,
+      TYPE_MULTISET_TABLE,
+      TYPE_VOLATILE_TABLE,
+      TYPE_VOLATILE_TABLE_MODE_SPECIAL1,
+      TYPE_VOLATILE_SET_TABLE,
+      TYPE_VOLATILE_MULTISET_TABLE,
+      TYPE_GHOST_TABLE
+    };
+
+  // load/in memory options
+  enum TableOptions
+    { OPT_NONE,
+      OPT_LOAD,
+      OPT_NO_LOAD,
+      OPT_IN_MEM,
+      OPT_LOAD_WITH_DELETE
+    };
+
+  TableTokens(TableType type, NABoolean ifNotExistsSet)
+  : type_(type),
+    options_ (OPT_NONE),
+    ifNotExistsSet_(ifNotExistsSet)
+  {}
+
+  TableType getType() { return type_; }
+  NABoolean isVolatile()
+   { return (type_ == TYPE_VOLATILE_TABLE ||
+             type_ == TYPE_VOLATILE_TABLE_MODE_SPECIAL1 ||
+             type_ == TYPE_VOLATILE_SET_TABLE ||
+             type_ == TYPE_VOLATILE_MULTISET_TABLE); }
+  TableOptions getOptions() { return options_; }
+  NABoolean ifNotExistsSet() { return ifNotExistsSet_; }
+
+  void setOptions( TableOptions load) { options_ = load; }
+  void setTableTokens(StmtDDLCreateTable *pNode);
+
+private:
+  TableType    type_;
+  TableOptions options_;
+  NABoolean    ifNotExistsSet_;
+};
+
 // -----------------------------------------------------------------------
 // Declarations of global functions
 // -----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/StmtDDLCreate.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreate.cpp b/core/sql/parser/StmtDDLCreate.cpp
index 5c31d46..7627e29 100644
--- a/core/sql/parser/StmtDDLCreate.cpp
+++ b/core/sql/parser/StmtDDLCreate.cpp
@@ -62,7 +62,6 @@
 #include "ElemDDLConstraintUnique.h"
 #include "ElemDDLFileAttrClause.h"
 #include "ElemDDLGrantee.h"
-#include "ElemDDLLoadOptions.h"
 #include "ElemDDLLibClientFilename.h"
 #include "ElemDDLLibClientName.h"
 #include "ElemDDLList.h"
@@ -202,10 +201,8 @@ ParViewTableColsUsageList::~ParViewTableColsUsageList()
 {
   for (CollIndex i = 0; i < entries(); i++)
   {
-//KSKSKS
     delete &operator[](i);
 //    NADELETE(&operator[](i), ParViewTableColsUsage, heap_);
-//KSKSKS
   }
 }
 
@@ -323,10 +320,8 @@ ParViewColTablesUsageList::~ParViewColTablesUsageList()
 {
   for (CollIndex i = 0; i < entries(); i++)
   {
-//KSKSKS
     delete &operator[](i);
 //    NADELETE(&operator[](i), ParViewColTablesUsage, heap_);
-//KSKSKS
   }
 }
 
@@ -459,10 +454,8 @@ ParViewColTableColsUsageList::~ParViewColTableColsUsageList()
 {
   for (CollIndex i = 0; i < entries(); i++)
   {
-//KSKSKS
     delete &operator[](i);
 //    NADELETE(&operator[](i), ParViewColTableColsUsage, heap_);
-//KSKSKS
   }
 }
 
@@ -542,7 +535,6 @@ ParViewColTableColsUsageList::clear()
   for (CollIndex i = 0; i < entries(); i++)
   {
     //    NADELETE(&operator[](i), ParViewColTableColsUsage, heap_);
-    // KSKSKS
 
 
     //#define NADELETE(p,C,h)  \
@@ -576,7 +568,6 @@ ParViewColTableColsUsageList::clear()
           )
          )
 
-    // KSKSKS
 #endif // 0
   }
   LIST(ParViewColTableColsUsage *)::clear();
@@ -657,7 +648,6 @@ ParViewUsages::~ParViewUsages()
 {
 }
 
-// KSKSKS
 
 
 const ParViewColTableColsUsageList &
@@ -674,7 +664,6 @@ ParViewUsages::getViewColTableColsUsageList()
 
 
 
-// KSKSKS
 
 // -----------------------------------------------------------------------
 // Methods for class StmtDDLCreateSynonym
@@ -1430,10 +1419,6 @@ StmtDDLCreateIndex::StmtDDLCreateIndex(NABoolean isUnique,
           isParallelExec_(FALSE),
           configFileName_(heap),
           isParallelExecutionClauseSpec_(FALSE),
-          isDSlackClauseSpec_(FALSE),
-          dSlackPercentage_(ElemDDLLoadOptDSlack::DEFAULT_PERCENTAGE),
-          isISlackClauseSpec_(FALSE),
-          iSlackPercentage_(ElemDDLLoadOptISlack::DEFAULT_PERCENTAGE),
           isAttributeClauseSpec_(FALSE),
           pPrimaryPartition_(NULL),
           columnRefArray_(heap),
@@ -1626,30 +1611,6 @@ StmtDDLCreateIndex::setIndexOption(ElemDDLNode * pIndexOption)
     isDivisionClauseSpec_ = TRUE;
     break;
 
-  case ELM_LOAD_OPT_D_SLACK_ELEM :
-    ComASSERT(pIndexOption->castToElemDDLLoadOptDSlack() NEQ NULL);
-    if (isDSlackSpecified())
-    {
-      // Duplicate DSLACK clauses.
-      *SqlParser_Diags << DgSqlCode(-3100);
-    }
-    isDSlackClauseSpec_ = TRUE;
-    dSlackPercentage_ =
-      pIndexOption->castToElemDDLLoadOptDSlack()->getPercentage();
-    break;
-
-  case ELM_LOAD_OPT_I_SLACK_ELEM :
-    ComASSERT(pIndexOption->castToElemDDLLoadOptISlack() NEQ NULL);
-    if (isISlackSpecified())
-    {
-      // Duplicate ISLACK clauses.
-      *SqlParser_Diags << DgSqlCode(-3101);
-    }
-    isISlackClauseSpec_ = TRUE;
-    iSlackPercentage_ =
-      pIndexOption->castToElemDDLLoadOptISlack()->getPercentage();
-    break;
-
   case ELM_PARALLEL_EXEC_ELEM :
     {
       ElemDDLParallelExec * pParallelExec =
@@ -2046,22 +2007,6 @@ StmtDDLCreateIndex::synthesize()
   }
 
   //
-  // load options
-  //
-
-  if (isDSlackSpecified())
-  {
-    pSystemPart->setIsDSlackSpecified(isDSlackSpecified());
-    pSystemPart->setDSlackPercentage(getDSlackPercentage());
-  }
-
-  if (isISlackSpecified())
-  {
-    pSystemPart->setIsISlackSpecified(isISlackSpecified());
-    pSystemPart->setISlackPercentage(getISlackPercentage());
-  }
-
-  //
   // Check to see if the index is a range partitioned index.
   // If it is then the FIRST-KEY option is required.
   // 
@@ -2175,22 +2120,6 @@ StmtDDLCreateIndex::getDetailInfo() const
 
   detailTextList.append("Load options: ");
 
-  detailText = "    dslack spec?   ";
-  detailText += YesNo(isDSlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    dslack %:      ";
-  detailText += LongToNAString((Lng32)getDSlackPercentage());
-  detailTextList.append(detailText);
-
-  detailText = "    iSlack spec?   ";
-  detailText += YesNo(isISlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    iSlack %:      ";
-  detailText += LongToNAString((Lng32)getISlackPercentage());
-  detailTextList.append(detailText);
-
   detailText = "    par exec spec? ";
   detailText += YesNo(isParallelExecutionClauseSpecified());
   detailTextList.append(detailText);
@@ -3845,10 +3774,6 @@ StmtDDLCreateTable::StmtDDLCreateTable(const QualifiedName & aTableQualName,
           isUniqueStoreByPrimaryKey_(FALSE),
           storeOption_(COM_UNKNOWN_STORE_OPTION),
           isRoundRobinPartitioningSpecified_(FALSE),
-          isDSlackClauseSpec_(FALSE),
-          dSlackPercentage_(ElemDDLLoadOptDSlack::DEFAULT_PERCENTAGE),
-          isISlackClauseSpec_(FALSE),
-          iSlackPercentage_(ElemDDLLoadOptISlack::DEFAULT_PERCENTAGE),
           isHashV1PartitionSpec_(FALSE),
           isHashV2PartitionSpec_(FALSE),
           isPartitionClauseSpec_(FALSE),
@@ -4651,7 +4576,6 @@ StmtDDLCreateTable::synthesize()
 	{
 	  
 	  // LIKE clause currently not supported.
-	  // KSKSKS ****    *SqlParser_Diags << DgSqlCode(-3131);
 	  
 	  if (isLikeClauseSpec_)
 	    {
@@ -4897,21 +4821,6 @@ StmtDDLCreateTable::synthesize()
       pSysPart->setMaxExt           (fileAttrs.getMaxExt());
     }
 
-    //
-    // load options
-    //
-
-    if (isDSlackSpecified())
-    {
-      pSysPart->setIsDSlackSpecified(isDSlackSpecified());
-      pSysPart->setDSlackPercentage(getDSlackPercentage());
-    }
-
-    if (isISlackSpecified())
-    {
-      pSysPart->setIsISlackSpecified(isISlackSpecified());
-      pSysPart->setISlackPercentage(getISlackPercentage());
-    }
   } // else (pSysPart NEQ NULL)
 
   if (isStoreBySpecified() AND
@@ -5428,11 +5337,6 @@ StmtDDLCreateTable::setTableOption(ElemDDLNode * pTableOption)
 
   if (pTableOption->castToElemDDLStoreOpt() NEQ NULL)
   {
-    if (isLikeClauseSpec_)
-    {
-      // If you specify the LIKE clause you cannot specify the STORE BY clause.
-      // KSKSKS       *SqlParser_Diags << DgSqlCode(-3108);
-    }
     if (isStoreByClauseSpec_)
     {
       // Duplicate STORE BY clauses.
@@ -5489,12 +5393,6 @@ StmtDDLCreateTable::setTableOption(ElemDDLNode * pTableOption)
   switch (pTableOption->getOperatorType())
   {
   case ELM_FILE_ATTR_CLAUSE_ELEM :
-    if (isLikeClauseSpec_)
-    {
-      // If you specify the LIKE clause, you cannot specify the file ATTRIBUTES clause.
-      // KSKSKS      *SqlParser_Diags << DgSqlCode(-3110);
-    }
-    //
     // no needs to check for duplication - the syntax only allows
     // a single file ATTRIBUTES clause.
     //
@@ -5512,11 +5410,6 @@ StmtDDLCreateTable::setTableOption(ElemDDLNode * pTableOption)
 
   case ELM_LOCATION_ELEM :
     ComASSERT(pTableOption->castToElemDDLLocation() NEQ NULL);
-    if (isLikeClauseSpec_)
-    {
-      // If you specify the LIKE clause,you cannot specify the LOCATION clause.
-      // KSKSKS      *SqlParser_Diags << DgSqlCode(-3111);
-    }
     if (isLocationClauseSpec_)
     {
       // Duplicate LOCATION clauses.
@@ -5532,12 +5425,6 @@ StmtDDLCreateTable::setTableOption(ElemDDLNode * pTableOption)
     break;
 
   case ELM_PARTITION_CLAUSE_ELEM :
-    if (isLikeClauseSpec_)
-    {
-      // If you specify the LIKE clause, you cannot specify the PARTITION clause.
-      // KSKSKS      *SqlParser_Diags << DgSqlCode(-3112);
-    }
-    //
     // no needs to check for duplication - the syntax only allows
     // a single PARTITION clause.
     //
@@ -5986,28 +5873,6 @@ StmtDDLCreateTable::getDetailInfo() const
   detailTextList.append("    ", fileAttribs.getDetailInfo());
 
   //
-  // load options
-  //
-
-  detailTextList.append("Load options: ");
-
-  detailText = "    dslack spec?   ";
-  detailText += YesNo(isDSlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    dslack %:      ";
-  detailText += LongToNAString((Lng32)getDSlackPercentage());
-  detailTextList.append(detailText);
-
-  detailText = "    iSlack spec?   ";
-  detailText += YesNo(isISlackSpecified());
-  detailTextList.append(detailText);
-
-  detailText = "    iSlack %:      ";
-  detailText += LongToNAString((Lng32)getISlackPercentage());
-  detailTextList.append(detailText);
-
-  //
   // partitions
   //
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/StmtDDLCreateIndex.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreateIndex.h b/core/sql/parser/StmtDDLCreateIndex.h
index d2270d3..c0baa69 100644
--- a/core/sql/parser/StmtDDLCreateIndex.h
+++ b/core/sql/parser/StmtDDLCreateIndex.h
@@ -96,8 +96,6 @@ public:
 
         // returns a NAList of ElemDDLColRef parse nodes.
 
-  inline unsigned short getDSlackPercentage() const;
-
   inline const ParDDLFileAttrsCreateIndex & getFileAttributes() const;
   inline       ParDDLFileAttrsCreateIndex & getFileAttributes();
 
@@ -117,8 +115,6 @@ public:
         // clause is not specified, a default location is
         // used.
 
-  inline unsigned short getISlackPercentage() const;
-
   inline const QualifiedName & getOrigTableNameAsQualifiedName() const;
   inline       QualifiedName & getOrigTableNameAsQualifiedName();
 
@@ -178,21 +174,11 @@ public:
         // returns TRUE if the index file attribute clause appears;
         // returns FALSE otherwise.
 
-  inline NABoolean isDSlackSpecified() const;
-
-        // returns TRUE if DSlack clause appears;
-        // returns FALSE otherwise.
-
   inline NABoolean isLocationSpecified() const;
 
         // returns TRUE if location clause is specified;
         // returns FALSE otherwise.
 
-  inline NABoolean isISlackSpecified() const;
-
-        // returns TRUE if ISlack clause appears;
-        // returns FALSE otherwise.
-
   inline NABoolean isPopulateOptionSpecified() const;
         
         // return TRUE if IsPopulate clause appear;
@@ -439,12 +425,6 @@ private:
   // Index load information
   //
 
-  NABoolean isDSlackClauseSpec_;
-  unsigned short dSlackPercentage_;
-
-  NABoolean isISlackClauseSpec_;
-  unsigned short iSlackPercentage_;
-
   NABoolean isParallelExecutionClauseSpec_;
   NABoolean isParallelExec_;  // TRUE (ON); FALSE (OFF)
   NABoolean isPopulated_;     // True if populate option is specified, false if no populate is specified.
@@ -537,12 +517,6 @@ StmtDDLCreateIndex::getColRefArray()
   return columnRefArray_;
 }
 
-inline unsigned short
-StmtDDLCreateIndex::getDSlackPercentage() const
-{
-  return dSlackPercentage_;
-}
-
 inline const ParDDLFileAttrsCreateIndex &
 StmtDDLCreateIndex::getFileAttributes() const
 {
@@ -561,12 +535,6 @@ StmtDDLCreateIndex::getGuardianLocation() const
   return guardianLocation_;
 }
 
-inline unsigned short
-StmtDDLCreateIndex::getISlackPercentage() const
-{
-  return iSlackPercentage_;
-}
-
 // get index name
 inline const NAString &
 StmtDDLCreateIndex::getIndexName() const
@@ -699,20 +667,6 @@ StmtDDLCreateIndex::isAttributeSpecified() const
   return isAttributeClauseSpec_;
 }
 
-// is the DSlack clause specified?
-inline NABoolean
-StmtDDLCreateIndex::isDSlackSpecified() const
-{
-  return isDSlackClauseSpec_;
-}
-
-// is the ISlack clause specified?
-inline NABoolean
-StmtDDLCreateIndex::isISlackSpecified() const
-{
-  return isISlackClauseSpec_;
-}
-
 // is location clause specified?
 inline NABoolean
 StmtDDLCreateIndex::isLocationSpecified() const

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/StmtDDLCreateTable.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreateTable.h b/core/sql/parser/StmtDDLCreateTable.h
index 6de068a..9606c70 100644
--- a/core/sql/parser/StmtDDLCreateTable.h
+++ b/core/sql/parser/StmtDDLCreateTable.h
@@ -182,27 +182,12 @@ public:
         // object only apply to the primary partition of the
         // table.
 
-  inline unsigned short getISlackPercentage() const;
-
-        // returns the slack percentage of the index block
-        // associating with the primary partition.
-
   inline NABoolean getIsConstraintPKSpecified() const;
 
         // returns TRUE if a primary key (column or table)
         // constraint definition appears; returns FALSE
         // otherwise.
 
-  inline NABoolean getIsDSlackSpecified() const;
-
-        // returns TRUE if the dslack clause/phrase appears;
-        // returns FALSE otherwise.
-
-  inline NABoolean getIsISlackSpecified() const;
-
-        // returns TRUE if the islack clause/phrase appears;
-        // returns FALSE otherwise.
-
   inline NABoolean getIsLikeOptionSpecified() const;
 
         // returns TRUE if LIKE clause appears;
@@ -278,11 +263,6 @@ public:
         // Create Table.  If LIKE clause is not specified,
         // the returned information is not relevant.
 
-  inline unsigned short getDSlackPercentage() const;
-
-        // returns the slack percentage of the data block
-        // associating with the primary partition.
-
   inline const NAString & getGuardianLocation() const;
 
         // returns an empty string unless the parse node
@@ -352,18 +332,6 @@ public:
   inline ExtendedQualName::SpecialTableType getTableType() const; // ++MV
   inline NABoolean isSpecialTypeSpecified() const; // ++MV
 
-  inline NABoolean isDSlackSpecified() const;
-
-        // same as getIsDSlackSpecified() -
-        // returns TRUE if the dslack clause/phrase appears;
-        // returns FALSE otherwise.
-
-  inline NABoolean isISlackSpecified() const;
-
-        // same as getIsISlackSpecified() -
-        // returns TRUE if the islack clause/phrase appears;
-        // returns FALSE otherwise.
-
   inline NABoolean isLikeOptionSpecified() const;
 
         // same as getIsLikeOptionSpecified() -
@@ -522,6 +490,8 @@ public:
   const Int32 getCreateTableAsScannedInputCharset() const;
   inline void setCreateTableAsScannedInputCharset(const Int32 charset);
 
+  //void setTableTraits(StmtDDLTableTraits tableTraits );
+
   // ---------------------------------------------------------------------
   // other public methods
   // ---------------------------------------------------------------------
@@ -770,19 +740,6 @@ private:
   // Aligned or Packed table data format
   NABoolean isAlignedTableFormatSpecified_;
 
-  //
-  // load options
-  //
-
-  // DSLACK clause/phrase
-  NABoolean isDSlackClauseSpec_;
-  unsigned short dSlackPercentage_;
-
-  // ISLACK clause/phrase
-  NABoolean isISlackClauseSpec_;
-  unsigned short iSlackPercentage_;
-
-  //
   // Each element of the following arrays is a pointer
   // pointing to a StmtDDLAddConstraint parse node in
   // the parse sub-tree containing the table body
@@ -974,12 +931,6 @@ StmtDDLCreateTable::getColDefArray()
   return columnDefArray_;
 }
 
-inline unsigned short
-StmtDDLCreateTable::getDSlackPercentage() const
-{
-  return dSlackPercentage_;
-}
-
 inline const ParDDLFileAttrsCreateTable &
 StmtDDLCreateTable::getFileAttributes() const
 {
@@ -998,32 +949,12 @@ StmtDDLCreateTable::getGuardianLocation() const
   return guardianLocation_;
 }
 
-inline unsigned short
-StmtDDLCreateTable::getISlackPercentage() const
-{
-  return iSlackPercentage_;
-}
-
 inline NABoolean
 StmtDDLCreateTable::getIsConstraintPKSpecified() const
 {
   return isPrimaryKeyClauseSpec_;
 }
 
-// is dslack clause/phrase specified?
-inline NABoolean
-StmtDDLCreateTable::getIsDSlackSpecified() const
-{
-  return isDSlackClauseSpec_;
-}
-
-// is islack clause/phrase specified?
-inline NABoolean
-StmtDDLCreateTable::getIsISlackSpecified() const
-{
-  return isISlackClauseSpec_;
-}
-
 // is the like clause specified?
 inline NABoolean
 StmtDDLCreateTable::getIsLikeOptionSpecified() const
@@ -1271,22 +1202,6 @@ StmtDDLCreateTable::getTableName() const
   return tableQualName_.getQualifiedNameAsAnsiString();
 }
 
-// is dslack clause/phrase specified?
-// same as getIsDSlackSpecified()
-inline NABoolean
-StmtDDLCreateTable::isDSlackSpecified() const
-{
-  return isDSlackClauseSpec_;
-}
-
-// is islack clause/phrase specified?
-// same as getIsISlackSpecified()
-inline NABoolean
-StmtDDLCreateTable::isISlackSpecified() const
-{
-  return isISlackClauseSpec_;
-}
-
 // is the like clause specified?
 // same as getIsLikeOptionSpecified()
 inline NABoolean

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/74020c2e/core/sql/parser/StmtDDLNode.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLNode.h b/core/sql/parser/StmtDDLNode.h
index e81d190..a2928c1 100644
--- a/core/sql/parser/StmtDDLNode.h
+++ b/core/sql/parser/StmtDDLNode.h
@@ -69,7 +69,8 @@ public:
     isVolatile_(FALSE),
     exeUtil_(FALSE),
     isGhostObject_(FALSE),
-    inMemoryObjectDefn_(FALSE)
+    inMemoryObjectDefn_(FALSE),
+    isExternal_(FALSE)
   { }
 
   // virtual destructor
@@ -110,6 +111,11 @@ public:
   NABoolean processAsExeUtil() { return exeUtil_; }
   void setProcessAsExeUtil(NABoolean eu) { exeUtil_ = eu; }
 
+  // External object
+  NABoolean isExternal() { return isExternal_; }
+  NABoolean isExternal() const { return isExternal_; }
+  void setIsExternal(NABoolean e) { isExternal_ = e; }
+
   // Ghost Object
   NABoolean isGhostObject() { return isGhostObject_; }
   NABoolean isGhostObject() const { return isGhostObject_; }
@@ -146,6 +152,9 @@ private:
   // if this DDL operation was specified using GHOST syntax.
   NABoolean isGhostObject_;
   
+  // if this DDL operation was specified using EXTERNAL syntax.
+  NABoolean isExternal_;
+
 }; // class StmtDDLNode
 
 // -----------------------------------------------------------------------