You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2018/03/26 15:53:45 UTC

[1/4] trafodion git commit: [TRAFODION-3007] update statistics report error on volatile table

Repository: trafodion
Updated Branches:
  refs/heads/master 2236a6571 -> 0cf2e6b0b


[TRAFODION-3007] update statistics report error on volatile table


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

Branch: refs/heads/master
Commit: 9ae9c5999cd87544e96410c6082caccc9ebd4650
Parents: 3e26f86
Author: Andy Yang <yo...@esgyn.cn>
Authored: Thu Mar 22 09:08:59 2018 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Thu Mar 22 09:08:59 2018 +0800

----------------------------------------------------------------------
 core/sql/optimizer/BindRelExpr.cpp       | 5 ++++-
 core/sql/optimizer/ObjectNames.cpp       | 7 +++++++
 core/sql/optimizer/ObjectNames.h         | 1 +
 core/sql/regress/executor/EXPECTED013.SB | 4 +---
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 7 +++++--
 core/sql/ustat/hs_parser.cpp             | 7 -------
 6 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index 0faae6f..e6c3eb3 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -1521,7 +1521,10 @@ NATable *BindWA::getNATable(CorrName& corrName,
           ((bindWA->inViewDefinition()) ||
            (bindWA->inMVDefinition())))
       {
-        if (! CmpCommon::context()->sqlSession()->validateVolatileQualifiedSchemaName
+        // for Histogram, support to use VOLATILE SCHEMA
+        // or else, don't support
+        if (!corrName.getQualifiedNameObj().isHistogramTable() && 
+            !CmpCommon::context()->sqlSession()->validateVolatileQualifiedSchemaName
             (corrName.getQualifiedNameObj()))
         {
           bindWA->setErrStatus();

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/optimizer/ObjectNames.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.cpp b/core/sql/optimizer/ObjectNames.cpp
index fb4f9b1..1101c2d 100644
--- a/core/sql/optimizer/ObjectNames.cpp
+++ b/core/sql/optimizer/ObjectNames.cpp
@@ -1441,6 +1441,13 @@ NABoolean QualifiedName::isHistogramIntervals() const
    return (getObjectName() == HBASE_HISTINT_NAME);
 }
 
+NABoolean QualifiedName::isHistogramTable() const
+{
+   const NAString objName = getObjectName();
+   return (objName == HBASE_HIST_NAME || 
+           objName == HBASE_HISTINT_NAME ||
+           objName == HBASE_PERS_SAMP_NAME );
+}
 
 void ExtendedQualName::print(FILE* ofd, const char* indent, const char* title) const
 {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/optimizer/ObjectNames.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.h b/core/sql/optimizer/ObjectNames.h
index 5ed7450..afa95fc 100644
--- a/core/sql/optimizer/ObjectNames.h
+++ b/core/sql/optimizer/ObjectNames.h
@@ -332,6 +332,7 @@ public:
 
   NABoolean isHistograms() const;
   NABoolean isHistogramIntervals() const;
+  NABoolean isHistogramTable() const;
   NABoolean isLOBDesc() const;
   void setObjectName(const NAString &objName)   { objectName_ = objName; }
   void setObjectNameSpace(ComAnsiNameSpace objNameSpace)   { objectNameSpace_ = objNameSpace; }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/regress/executor/EXPECTED013.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED013.SB b/core/sql/regress/executor/EXPECTED013.SB
index db07760..bb94d75 100644
--- a/core/sql/regress/executor/EXPECTED013.SB
+++ b/core/sql/regress/executor/EXPECTED013.SB
@@ -93,9 +93,7 @@ A            B
 >>
 >>update statistics for table t013t1 on every column;
 
-*** ERROR[9247] UPDATE STATISTICS is not supported on volatile tables presently.
-
---- SQL operation failed with errors.
+--- SQL operation complete.
 >>
 >>select * from t013_sch.t013t1;
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index d2f0c89..dcc7971 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -302,7 +302,7 @@ void CmpSeabaseDDL::createSeabaseSchema(
    // not reserved
    NAString tableNotCreated;
 
-   if (!createSchemaNode->isVolatile() && !ComIsTrafodionReservedSchemaName(schName))
+   if (!ComIsTrafodionReservedSchemaName(schName))
    {
       if (createHistogramTables(&cliInterface, schemaName.getExternalName(), 
                                 FALSE, tableNotCreated))
@@ -1742,7 +1742,10 @@ Lng32 cliRC = 0;
 
 
 
-   if (isVolatile)
+   if (isVolatile && 
+       strcmp(objectName, HBASE_HIST_NAME) != 0 && 
+       strcmp(objectName, HBASE_HISTINT_NAME) != 0 && 
+       strcmp(objectName, HBASE_PERS_SAMP_NAME) != 0)
       strcpy(volatileString,"VOLATILE");
 
    if (ifExists)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9ae9c599/core/sql/ustat/hs_parser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_parser.cpp b/core/sql/ustat/hs_parser.cpp
index c01a6d9..2b0fff2 100644
--- a/core/sql/ustat/hs_parser.cpp
+++ b/core/sql/ustat/hs_parser.cpp
@@ -243,13 +243,6 @@ Lng32 AddTableName( const hs_table_type type
           }
         else 
           {
-            // This is for UPDATE STATISTICS; the volatile schema name exists.
-            // For now, UPDATE STATISTICS is not supported. (See also JIRA Trafodion-2004.)
-
-            HSFuncMergeDiags(-UERR_VOLATILE_TABLES_NOT_SUPPORTED);
-            retcode = -1;
-            HSHandleError(retcode); // causes a return from this function
-
             // The code below is old code that will be needed once we turn on
             // support for UPDATE STATISTICS on volatile tables. We leave it here
             // until the code changes described in JIRA Trafodion-2004 are complete.


[3/4] trafodion git commit: [TRAFODION-3007] update statistics report error on volatile table - remove useless comments

Posted by db...@apache.org.
[TRAFODION-3007] update statistics report error on volatile table - remove useless comments


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

Branch: refs/heads/master
Commit: 8913b31fe771b3212da860d03e9c2a0d36bf87cc
Parents: b682d75
Author: Andy Yang <yo...@esgyn.cn>
Authored: Fri Mar 23 09:50:13 2018 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Fri Mar 23 09:50:13 2018 +0800

----------------------------------------------------------------------
 core/sql/ustat/hs_parser.cpp | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/8913b31f/core/sql/ustat/hs_parser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_parser.cpp b/core/sql/ustat/hs_parser.cpp
index 2b0fff2..497419b 100644
--- a/core/sql/ustat/hs_parser.cpp
+++ b/core/sql/ustat/hs_parser.cpp
@@ -243,12 +243,6 @@ Lng32 AddTableName( const hs_table_type type
           }
         else 
           {
-            // The code below is old code that will be needed once we turn on
-            // support for UPDATE STATISTICS on volatile tables. We leave it here
-            // until the code changes described in JIRA Trafodion-2004 are complete.
-            // The code below is never reached because of the HSHandleError call
-            // above.
-
             // if schema name was specified, validate that it is the
             // current username.
             if (schema)


[4/4] trafodion git commit: Merge [TRAFODION-3007] PR 1492 Support UPDATE STATS on volatile tables

Posted by db...@apache.org.
Merge [TRAFODION-3007] PR 1492 Support UPDATE STATS on volatile tables


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

Branch: refs/heads/master
Commit: 0cf2e6b0bddb3274cd629da03d4727591228cc5a
Parents: 2236a65 8913b31
Author: Dave Birdsall <db...@apache.org>
Authored: Mon Mar 26 15:51:51 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Mon Mar 26 15:51:51 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/BindRelExpr.cpp       |  5 ++++-
 core/sql/optimizer/ObjectNames.cpp       |  7 +++++++
 core/sql/optimizer/ObjectNames.h         |  1 +
 core/sql/regress/executor/EXPECTED013.SB |  4 +---
 core/sql/regress/seabase/EXPECTED010     |  3 +++
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp |  7 +++++--
 core/sql/ustat/hs_parser.cpp             | 13 -------------
 7 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------



[2/4] trafodion git commit: [TRAFODION-3007] update statistics report error on volatile table - update test case

Posted by db...@apache.org.
[TRAFODION-3007] update statistics report error on volatile table - update test case


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

Branch: refs/heads/master
Commit: b682d75e7784d6296d5d234aebafd9e49e11274d
Parents: 9ae9c59
Author: Andy Yang <yo...@esgyn.cn>
Authored: Thu Mar 22 15:03:05 2018 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Thu Mar 22 15:03:05 2018 +0800

----------------------------------------------------------------------
 core/sql/regress/seabase/EXPECTED010 | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b682d75e/core/sql/regress/seabase/EXPECTED010
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED010 b/core/sql/regress/seabase/EXPECTED010
index ab7f2f3..1b83dd0 100644
--- a/core/sql/regress/seabase/EXPECTED010
+++ b/core/sql/regress/seabase/EXPECTED010
@@ -11244,7 +11244,10 @@ Schema(Active  ): VOLATILE_SCHEMA_MXID110000244152123793487270871880000000002
 
 Schema(Active  ): VOLATILE_SCHEMA_MXID110000244152123793487270871880000000002
   Table: VTAB1
+  Table: SB_HISTOGRAM_INTERVALS
+  Table: SB_HISTOGRAMS
   Table: VTAB2
+  Table: SB_PERSISTENT_SAMPLES
 
 --- SQL operation complete.
 >>drop schema minotaur cascade;