trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/2] incubator-trafodion git commit: [TRAFODION-2781] Omit LOB columns from update stats sample tables
Date Wed, 25 Oct 2017 21:38:30 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master ea24774d7 -> 6b07d620e


[TRAFODION-2781] Omit LOB columns from update stats sample tables


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

Branch: refs/heads/master
Commit: 328c1b2c8662cd11662f73e6a072cf5bf941be37
Parents: c66fca2
Author: Dave Birdsall <dbirdsall@apache.org>
Authored: Tue Oct 24 22:31:10 2017 +0000
Committer: Dave Birdsall <dbirdsall@apache.org>
Committed: Tue Oct 24 22:31:10 2017 +0000

----------------------------------------------------------------------
 core/sql/common/OperTypeEnum.h              |  1 +
 core/sql/parser/ElemDDLLikeOptions.cpp      | 26 ++++++++++++
 core/sql/parser/ElemDDLLikeOptions.h        | 28 +++++++++++++
 core/sql/parser/ElemDDLNode.cpp             |  5 +++
 core/sql/parser/ElemDDLNode.h               |  2 +
 core/sql/parser/ParDDLLikeOpts.cpp          | 16 ++++++++
 core/sql/parser/ParDDLLikeOptsCreateTable.h | 14 +++++++
 core/sql/parser/sqlparser.y                 |  5 +++
 core/sql/regress/compGeneral/EXPECTED023    | 50 ++++++++++++------------
 core/sql/sqlcomp/CmpDescribe.cpp            | 14 ++++++-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp     |  3 ++
 core/sql/ustat/hs_cli.cpp                   |  4 +-
 core/sql/ustat/hs_globals.cpp               | 41 +++++++------------
 core/sql/ustat/hs_la.cpp                    |  5 ++-
 14 files changed, 158 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/common/OperTypeEnum.h
----------------------------------------------------------------------
diff --git a/core/sql/common/OperTypeEnum.h b/core/sql/common/OperTypeEnum.h
index b917f23..bbf064c 100644
--- a/core/sql/common/OperTypeEnum.h
+++ b/core/sql/common/OperTypeEnum.h
@@ -1085,6 +1085,7 @@ enum OperatorTypeEnum {
                         ELM_LIKE_OPT_WITHOUT_DIVISION_ELEM,
                         ELM_LIKE_OPT_LIMIT_COLUMN_LENGTH,
                         ELM_LIKE_OPT_WITHOUT_ROW_FORMAT_ELEM,
+                        ELM_LIKE_OPT_WITHOUT_LOB_COLUMNS,
                         ELM_LOCATION_ELEM,
                         ELM_OPTION_LIST,
                         ELM_PARALLEL_EXEC_ELEM,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ElemDDLLikeOptions.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLLikeOptions.cpp b/core/sql/parser/ElemDDLLikeOptions.cpp
index b4970bc..fa40bfd 100644
--- a/core/sql/parser/ElemDDLLikeOptions.cpp
+++ b/core/sql/parser/ElemDDLLikeOptions.cpp
@@ -272,6 +272,32 @@ const NAString ElemDDLLikeOptWithoutRowFormat::getText() const
   return "ElemDDLLikeOptWithoutRowFormat";
 }
 
+
+// -----------------------------------------------------------------------
+// methods for class ElemDDLLikeOptWithoutLobColumns
+// -----------------------------------------------------------------------
+
+// virtual destructor
+ElemDDLLikeOptWithoutLobColumns::~ElemDDLLikeOptWithoutLobColumns()
+{
+}
+
+// casting
+ElemDDLLikeOptWithoutLobColumns * ElemDDLLikeOptWithoutLobColumns::castToElemDDLLikeOptWithoutLobColumns()
+{
+  return this;
+}
+
+//
+// methods for tracing
+//
+
+const NAString ElemDDLLikeOptWithoutLobColumns::getText() const
+{
+  return "ElemDDLLikeOptWithoutLobColumns";
+}
+
+
 //
 // End of File
 //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ElemDDLLikeOptions.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLLikeOptions.h b/core/sql/parser/ElemDDLLikeOptions.h
index acc2534..ef06865 100644
--- a/core/sql/parser/ElemDDLLikeOptions.h
+++ b/core/sql/parser/ElemDDLLikeOptions.h
@@ -320,4 +320,32 @@ private:
 
 }; // class ElemDDLLikeOptWithoutRowFormat
 
+// -----------------------------------------------------------------------
+// definition of class ElemDDLLikeOptWithoutLobColumns
+// -----------------------------------------------------------------------
+class ElemDDLLikeOptWithoutLobColumns : public ElemDDLLikeOpt
+{
+
+public:
+
+  // constructor
+  ElemDDLLikeOptWithoutLobColumns()
+    : ElemDDLLikeOpt(ELM_LIKE_OPT_WITHOUT_LOB_COLUMNS)
+  { }
+
+  // virtual destructor
+  virtual ~ElemDDLLikeOptWithoutLobColumns();
+
+  // cast
+  virtual ElemDDLLikeOptWithoutLobColumns *
+    castToElemDDLLikeOptWithoutLobColumns();
+
+  // method for tracing
+  virtual const NAString getText() const;
+
+
+private:
+
+}; // class ElemDDLLikeOptWithoutLobColumns
+
 #endif // ELEMDDLLIKEOPTIONS_H

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ElemDDLNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.cpp b/core/sql/parser/ElemDDLNode.cpp
index b973e72..5c7b602 100644
--- a/core/sql/parser/ElemDDLNode.cpp
+++ b/core/sql/parser/ElemDDLNode.cpp
@@ -578,6 +578,11 @@ ElemDDLLikeOptWithoutRowFormat * ElemDDLNode::castToElemDDLLikeOptWithoutRowForm
   return NULL;
 }
 
+ElemDDLLikeOptWithoutLobColumns * ElemDDLNode::castToElemDDLLikeOptWithoutLobColumns()
+{
+  return NULL;
+}
+
 ElemDDLList *
 ElemDDLNode::castToElemDDLList()
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ElemDDLNode.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.h b/core/sql/parser/ElemDDLNode.h
index e3dabe2..1c8b039 100644
--- a/core/sql/parser/ElemDDLNode.h
+++ b/core/sql/parser/ElemDDLNode.h
@@ -139,6 +139,7 @@ class ElemDDLLikeSaltClause;
 class ElemDDLLikeOptWithoutDivision;
 class ElemDDLLikeLimitColumnLength;
 class ElemDDLLikeOptWithoutRowFormat;
+class ElemDDLLikeOptWithoutLobColumns;
 class ElemDDLList;
 class ElemDDLLocation;
 class ElemDDLOptionList;
@@ -464,6 +465,7 @@ public:
   virtual ElemDDLLikeOptWithoutDivision * castToElemDDLLikeOptWithoutDivision();
   virtual ElemDDLLikeLimitColumnLength  * castToElemDDLLikeLimitColumnLength();
   virtual ElemDDLLikeOptWithoutRowFormat* castToElemDDLLikeOptWithoutRowFormat();
+  virtual ElemDDLLikeOptWithoutLobColumns * castToElemDDLLikeOptWithoutLobColumns();
   virtual ElemDDLList                   * castToElemDDLList();
   virtual ElemDDLLocation               * castToElemDDLLocation();
   virtual ElemDDLOptionList             * castToElemDDLOptionList();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ParDDLLikeOpts.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParDDLLikeOpts.cpp b/core/sql/parser/ParDDLLikeOpts.cpp
index 9b37d99..c331b6b 100644
--- a/core/sql/parser/ParDDLLikeOpts.cpp
+++ b/core/sql/parser/ParDDLLikeOpts.cpp
@@ -115,6 +115,7 @@ ParDDLLikeOptsCreateTable::operator=(
   isLikeOptWithoutDivisionSpec_ = likeOptions.isLikeOptWithoutDivisionSpec_;
   isLikeOptLimitColumnLengthSpec_ = likeOptions.isLikeOptLimitColumnLengthSpec_;
   isLikeOptWithoutRowFormatSpec_  = likeOptions.isLikeOptWithoutRowFormatSpec_;
+  isLikeOptWithoutLobColumnsSpec_  = likeOptions.isLikeOptWithoutLobColumnsSpec_;
 
   isLikeOptWithComments_        = likeOptions.isLikeOptWithComments_;
   isLikeOptWithoutConstraints_  = likeOptions.isLikeOptWithoutConstraints_;
@@ -125,6 +126,7 @@ ParDDLLikeOptsCreateTable::operator=(
   isLikeOptWithoutDivision_     = likeOptions.isLikeOptWithoutDivision_;
   isLikeOptColumnLengthLimit_   = likeOptions.isLikeOptColumnLengthLimit_;
   isLikeOptWithoutRowFormat_    = likeOptions.isLikeOptWithoutRowFormat_;
+  isLikeOptWithoutLobColumns_    = likeOptions.isLikeOptWithoutLobColumns_;
 
   if (this != &likeOptions)  // make sure not assigning to self
     {
@@ -161,6 +163,7 @@ ParDDLLikeOptsCreateTable::initializeDataMembers()
   isLikeOptWithoutDivisionSpec_ = FALSE;
   isLikeOptLimitColumnLengthSpec_ = FALSE;
   isLikeOptWithoutRowFormatSpec_  = FALSE;
+  isLikeOptWithoutLobColumnsSpec_  = FALSE;
 
   isLikeOptWithComments_        = FALSE;
   isLikeOptWithoutConstraints_  = FALSE;
@@ -172,6 +175,7 @@ ParDDLLikeOptsCreateTable::initializeDataMembers()
   isLikeOptWithoutDivision_     = FALSE;
   isLikeOptColumnLengthLimit_   = UINT_MAX;
   isLikeOptWithoutRowFormat_    = FALSE;
+  isLikeOptWithoutLobColumns_    = FALSE;
 }
 
 void
@@ -297,6 +301,18 @@ ParDDLLikeOptsCreateTable::setLikeOption(ElemDDLLikeOpt * pLikeOption)
     isLikeOptWithoutRowFormatSpec_ = TRUE;
     break;
 
+  case ELM_LIKE_OPT_WITHOUT_LOB_COLUMNS :
+    if (isLikeOptWithoutLobColumnsSpec_)
+    {
+      // ERROR[3152] Duplicate WITHOUT LOB COLUMNS phrases were specified
+      //             in LIKE clause in CREATE TABLE statement.
+      *SqlParser_Diags << DgSqlCode(-3152) << DgString0("LOB COLUMNS");
+    }
+    ComASSERT(pLikeOption->castToElemDDLLikeOptWithoutLobColumns() != NULL);
+    isLikeOptWithoutLobColumns_ = TRUE;
+    isLikeOptWithoutLobColumnsSpec_ = TRUE;
+    break;
+
   default :
     NAAbort("ParDDLLikeOpts.C", __LINE__, "internal logic error");
     break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/ParDDLLikeOptsCreateTable.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParDDLLikeOptsCreateTable.h b/core/sql/parser/ParDDLLikeOptsCreateTable.h
index 4851d33..844696d 100644
--- a/core/sql/parser/ParDDLLikeOptsCreateTable.h
+++ b/core/sql/parser/ParDDLLikeOptsCreateTable.h
@@ -143,6 +143,12 @@ public:
     return isLikeOptWithoutRowFormat_;
   }
 
+  const NABoolean
+  getIsWithoutLobColumns() const
+  {
+    return isLikeOptWithoutLobColumns_;
+  }
+
   // mutators
 
   void setLikeOption(ElemDDLLikeOpt * pLikeOptParseNode);
@@ -201,6 +207,12 @@ public:
     isLikeOptWithoutRowFormat_ = setting;
   }
 
+  void
+  setIsWithoutLobColumns(const NABoolean setting)
+  {
+    isLikeOptWithoutLobColumns_ = setting;
+  }
+
 private:
 
   // ---------------------------------------------------------------------
@@ -227,6 +239,7 @@ private:
   NABoolean isLikeOptWithoutDivisionSpec_;
   NABoolean isLikeOptLimitColumnLengthSpec_;
   NABoolean isLikeOptWithoutRowFormatSpec_;
+  NABoolean isLikeOptWithoutLobColumnsSpec_;
 
   // legal Like options in DDL Create Table statements
 
@@ -240,6 +253,7 @@ private:
   NABoolean isLikeOptWithoutDivision_;
   UInt32 isLikeOptColumnLengthLimit_;  // in bytes; max UInt32 if no limit specified
   NABoolean isLikeOptWithoutRowFormat_;
+  NABoolean isLikeOptWithoutLobColumns_;
 
 }; // class ParDDLLikeOptsCreateTable
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index df09422..e019918 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -26285,6 +26285,11 @@ like_option : TOK_WITHOUT TOK_CONSTRAINTS
                                   $$ = new (PARSERHEAP())
 				    ElemDDLLikeOptWithoutRowFormat();
                                 }
+                      | TOK_WITHOUT TOK_LOB TOK_COLUMNS
+                                {
+                                  $$ = new (PARSERHEAP())
+				    ElemDDLLikeOptWithoutLobColumns();
+                                }
 
 /* type pElemDDL */
 optional_create_table_attribute_list : create_table_as_attr_list_start

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/regress/compGeneral/EXPECTED023
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED023 b/core/sql/regress/compGeneral/EXPECTED023
index 180a962..46352b8 100644
--- a/core/sql/regress/compGeneral/EXPECTED023
+++ b/core/sql/regress/compGeneral/EXPECTED023
@@ -125,7 +125,7 @@ STEST_EMPTY
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490504707_1499123202_644772                                                                                                                                                                                                                                                                                                                                                                                                                                      M                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
+STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882731_922052                                                                                                                                                                                                                                                                                                                                                                                                                                      M                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>-- should see one row
@@ -141,7 +141,7 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123202_644772
+TRAF_SAMPLE_04737367368240681236_1508882731_922052
 
 --- SQL operation complete.
 >> -- should be stest, stest_empty, stestc, sb_* tables + a sample table
@@ -165,7 +165,7 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123287_739643
+TRAF_SAMPLE_04737367368240681236_1508882785_656325
 
 --- SQL operation complete.
 >> -- should be stest, stest_empty, stestc, sb_* tables + a different sample table
@@ -175,7 +175,7 @@ TRAF_SAMPLE_08256920717490504707_1499123287_739643
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490504707_1499123287_739643                                                                                                                                                                                                                                                                                                                                                                                                                                      M                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
+STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882785_656325                                                                                                                                                                                                                                                                                                                                                                                                                                      M                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>-- should see one row
@@ -222,7 +222,7 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123343_842843
+TRAF_SAMPLE_04737367368240681236_1508882823_902847
 
 --- SQL operation complete.
 >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table
@@ -232,7 +232,7 @@ TRAF_SAMPLE_08256920717490504707_1499123343_842843
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490504707_1499123343_842843                                                                                                                                                                                                                                                                                                                                                                                                                                      I                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
+STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882823_902847                                                                                                                                                                                                                                                                                                                                                                                                                                      I                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>-- should see one row
@@ -256,7 +256,7 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
 
 --- SQL operation complete.
 >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table
@@ -266,7 +266,7 @@ TRAF_SAMPLE_08256920717490504707_1499123383_331045
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490504707_1499123383_331045                                                                                                                                                                                                                                                                                                                                                                                                                                      I                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
+STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882873_484291                                                                                                                                                                                                                                                                                                                                                                                                                                      I                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>-- should see one row
@@ -327,7 +327,7 @@ STEST
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490504707_1499123383_331045                                                                                                                                                                                                                                                                                                                                                                                                                                      I        c1 >= 100000                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                
+STEST                                                                                                                                                                                                                                                             TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882873_484291                                                                                                                                                                                                                                                                                                                                                                                                                                      I        c1 >= 100000                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>
@@ -384,8 +384,8 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
-TRAF_SAMPLE_08256920717490506747_1499123452_066783
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
+TRAF_SAMPLE_04737367368240683297_1508882959_040281
 
 --- SQL operation complete.
 >>
@@ -394,7 +394,7 @@ TRAF_SAMPLE_08256920717490506747_1499123452_066783
 OBJECT_NAME                                                                                                                                                                                                                                                       SAMPLE_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           REASON  LAST_WHERE_PREDICATE
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-STESTC                                                                                                                                                                                                                                                            TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490506747_1499123452_066783                                                                                                                                                                                                                                                                                                                                                                                                                                      I        c1 >= 'naaaa'                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                
+STESTC                                                                                                                                                                                                                                                            TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240683297_1508882959_040281                                                                                                                                                                                                                                                                                                                                                                                                                                      I        c1 >= 'naaaa'                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                
 
 --- 1 row(s) selected.
 >>
@@ -419,8 +419,8 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
-TRAF_SAMPLE_08256920717490506747_1499123452_066783
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
+TRAF_SAMPLE_04737367368240683297_1508882959_040281
 
 --- SQL operation complete.
 >> -- should be the same as previous "get tables"
@@ -447,8 +447,8 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
-TRAF_SAMPLE_08256920717490506747_1499123452_066783
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
+TRAF_SAMPLE_04737367368240683297_1508882959_040281
 
 --- SQL operation complete.
 >> -- should be the same as previous "get tables"
@@ -476,8 +476,8 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
-TRAF_SAMPLE_08256920717490506747_1499123452_066783
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
+TRAF_SAMPLE_04737367368240683297_1508882959_040281
 
 --- SQL operation complete.
 >> -- should be the same as previous "get tables"
@@ -488,10 +488,10 @@ TRAF_SAMPLE_08256920717490506747_1499123452_066783
 *** ERROR[9219] Incremental UPDATE STATISTICS: An operation failed, possibly due to an invalid WHERE clause.
 
 *** ERROR[15001] A syntax error occurred at or before: 
-UPSERT USING LOAD INTO TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_08256920717490
-504707_1499123383_331045_I (SELECT * FROM TRAFODION.COMPGENERAL_TEST023.STEST W
-HERE  1  SAMPLE RANDOM 9.963000 PERCENT );
-                     ^ (180 characters from start of SQL statement)
+UPSERT USING LOAD INTO TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240
+681236_1508882873_484291_I (SELECT "C1", "C2", "C3" FROM TRAFODION.COMPGENERAL_
+TEST023.STEST WHERE  1  SAMPLE RANDOM 9.943000 PERCENT );
+                                    ^ (195 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -508,8 +508,8 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
-TRAF_SAMPLE_08256920717490506747_1499123452_066783
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
+TRAF_SAMPLE_04737367368240683297_1508882959_040281
 
 --- SQL operation complete.
 >> -- should be the same as previous "get tables"
@@ -560,7 +560,7 @@ SB_PERSISTENT_SAMPLES
 STEST
 STESTC
 STEST_EMPTY
-TRAF_SAMPLE_08256920717490504707_1499123383_331045
+TRAF_SAMPLE_04737367368240681236_1508882873_484291
 
 --- SQL operation complete.
 >> -- should be the same as previous "get tables" except only one sample table

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index d731faf..6386ec5 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -201,6 +201,7 @@ short CmpDescribeSeabaseTable (
      NABoolean withoutSalt = FALSE,
      NABoolean withoutDivisioning = FALSE,
      NABoolean withoutRowFormat = FALSE,
+     NABoolean withoutLobColumns = FALSE,
      UInt32 columnLengthLimit = UINT_MAX,
      NABoolean noTrailingSemi = FALSE,
      
@@ -2472,6 +2473,7 @@ short CmpDescribeHiveTable (
                                          dummyBuf, dummyLen, heap, 
                                          NULL, 
                                          TRUE, FALSE, FALSE, FALSE, 
+                                         FALSE,
                                          UINT_MAX, TRUE,
                                          NULL, 0, NULL, NULL, &space);
 
@@ -2747,6 +2749,7 @@ short cmpDisplayColumns(const NAColumnArray & naColArr,
                         Lng32 &identityColPos,
                         NABoolean isExternalTable,
                         NABoolean isAlignedRowFormat,
+                        NABoolean omitLobColumns = FALSE,
                         char * inColName = NULL,
                         short ada = 0, // 0,add. 1,drop. 2,alter
                         const NAColumn * nacol = NULL,
@@ -2767,6 +2770,12 @@ short cmpDisplayColumns(const NAColumnArray & naColArr,
           continue;
         }
 
+      if (omitLobColumns &&
+          (nac->getType()->isLob()))
+        {
+          continue;
+        }
+
       const NAString &colName = nac->getColName();
 
       if ((inColName) && (ada == 1))
@@ -2894,6 +2903,7 @@ short CmpDescribeSeabaseTable (
                                NABoolean withoutSalt,
                                NABoolean withoutDivisioning,
                                NABoolean withoutRowFormat,
+                               NABoolean withoutLobColumns,
                                UInt32 columnLengthLimit,
                                NABoolean noTrailingSemi,
                                char * colName,
@@ -3155,6 +3165,7 @@ short CmpDescribeSeabaseTable (
                         identityColPos,
                         (isExternalTable && (NOT isHbaseMapTable)),
                         naTable->isSQLMXAlignedTable(),
+                        withoutLobColumns,
                         colName, ada, nacol, natype,
                         columnLengthLimit,
                         &truncatedColumnList);
@@ -3557,7 +3568,8 @@ short CmpDescribeSeabaseTable (
 				(type == 2),
                                 dummy,
                                 isExternalTable,
-                                isAligned);
+                                isAligned,
+                                withoutLobColumns);
 	      outputShortLine(*space, "  )");
 	      
 	      sprintf(buf,  "  PRIMARY KEY ");

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 177f7b5..bc33864 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -69,6 +69,7 @@ extern short CmpDescribeSeabaseTable (
      NABoolean withoutSalt = FALSE,
      NABoolean withoutDivisioning = FALSE,
      NABoolean withoutRowFormat = FALSE,
+     NABoolean withoutLobColumns = FALSE,
      UInt32 columnLengthLimit = UINT_MAX,
      NABoolean noTrailingSemi = FALSE,
      
@@ -386,6 +387,7 @@ void CmpSeabaseDDL::createSeabaseTableLike(ExeCliInterface * cliInterface,
                                       likeOptions.getIsWithoutSalt(),
                                       likeOptions.getIsWithoutDivision(),
                                       likeOptions.getIsWithoutRowFormat(),
+                                      likeOptions.getIsWithoutLobColumns(),
                                       likeOptions.getIsLikeOptColumnLengthLimit(),
                                       TRUE);
   if (retcode)
@@ -5164,6 +5166,7 @@ short CmpSeabaseDDL::createSeabaseTableLike2(
                                     NULL,
                                     withPartns, withoutSalt, withoutDivision,
                                     withoutRowFormat,
+                                    FALSE, // include LOB columns (if any)
                                     UINT_MAX,
                                     TRUE);
   if (retcode)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/ustat/hs_cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_cli.cpp b/core/sql/ustat/hs_cli.cpp
index 22fce96..777a92b 100644
--- a/core/sql/ustat/hs_cli.cpp
+++ b/core/sql/ustat/hs_cli.cpp
@@ -602,7 +602,7 @@ Lng32 HSSample::create(NAString& tblName, NABoolean unpartitioned, NABoolean isP
 
     NAString userLocation;
     ComObjectName *sampleName;
-    NAString tableOptions;
+    NAString tableOptions = " WITHOUT LOB COLUMNS";
     HSTranMan *TM = HSTranMan::Instance();
 
     if (objDef->getObjectFormat() == SQLMX)
@@ -611,7 +611,7 @@ Lng32 HSSample::create(NAString& tblName, NABoolean unpartitioned, NABoolean isP
         // Do not emit the WITH PARTITIONS clause for native table. 
         // Rather, the SALT USING clause will be used. 
         if ( !isNativeTable ) 
-           tableOptions = " WITH PARTITIONS";
+           tableOptions += " WITH PARTITIONS";
         if (hs_globals->hasOversizedColumns)
           {
             // We will be truncating some columns when populating the sample table,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index e89eef4..b73b31b 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -4276,15 +4276,10 @@ Lng32 HSSample::make(NABoolean rowCountIsEstimate, // input
     dml  = insertType;
     dml += sampleTable;
     dml += " SELECT ";
-    if (hs_globals->hasOversizedColumns)
-      {
-        // The source table has an oversized column. We have to generate
-        // SUBSTRING calls on such columns to fit them into the sample
-        // table.
-        objDef->addTruncatedSelectList(dml);
-      }      
-    else
-      dml += "*";
+
+    // Generate the select list. Truncate any over-long char/varchar columns
+    // by using SUBSTRING calls. Omit any LOB columns.
+    objDef->addTruncatedSelectList(dml);
 
     dml += " FROM ";
 
@@ -12636,15 +12631,11 @@ void HSGlobalsClass::generateIUSSelectInsertQuery(const NAString& smplTable,
   queryText.append("UPSERT USING LOAD INTO "); // for algorithm 1
   queryText.append(smplTable.data());
   queryText.append(" (SELECT ");
-  if (hasOversizedColumns)
-    {
-      // The source table has an oversized column. We have to generate
-      // SUBSTRING calls on such columns to fit them into the sample
-      // table.
-      objDef->addTruncatedSelectList(queryText);
-    }      
-  else
-    queryText.append("*");
+  
+  // Generate the select list. Truncate any over-long char/varchar columns
+  // by using SUBSTRING calls. Omit any LOB columns.
+  objDef->addTruncatedSelectList(queryText);
+
   queryText.append(" FROM ");
 
   if (CmpCommon::getDefault(USTAT_INCREMENTAL_UPDATE_STATISTICS) == DF_ON)
@@ -16354,15 +16345,11 @@ HSInMemoryTable::generateInsertSelectIQuery(NAString& targetTable,
   queryText.append(targetTable.data());
 
   queryText.append(" (SELECT ");
-  if (hasOversizedColumns)
-    {
-      // The source table has an oversized column. We have to generate
-      // SUBSTRING calls on such columns to fit them into the sample
-      // table.
-      objDef->addTruncatedSelectList(queryText);
-    }      
-  else
-    queryText.append("*");
+
+  // Generate the select list. Truncate any over-long char/varchar columns
+  // by using SUBSTRING calls. Omit any LOB columns.
+  objDef->addTruncatedSelectList(queryText);
+
   queryText.append(" FROM ");
 
   queryText.append(sourceTable.data());

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/328c1b2c/core/sql/ustat/hs_la.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_la.cpp b/core/sql/ustat/hs_la.cpp
index b95f3b6..6609873 100644
--- a/core/sql/ustat/hs_la.cpp
+++ b/core/sql/ustat/hs_la.cpp
@@ -1357,7 +1357,7 @@ Lng32 HSHbaseTableDef::DescribeColumnNames()
 //          column references or a SUBSTRING
 //          on column references which truncates the
 //          column to the maximum length allowed in
-//          UPDATE STATISTICS.
+//          UPDATE STATISTICS. Also skips LOB columns.
 //
 // INPUT:   'qry' - the SQL query string to append the 
 //          select list to.
@@ -1367,6 +1367,9 @@ void HSTableDef::addTruncatedSelectList(NAString & qry)
     bool first = true;
     for (Lng32 i = 0; i < getNumCols(); i++)
       {
+        if (DFS2REC::isLOB(getColInfo(i).datatype)) // skip LOB columns
+          continue;
+
         if (!ComTrafReservedColName(*getColInfo(i).colname))
           {
             if (!first)


Mime
View raw message