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 2015/09/22 01:12:27 UTC
[12/14] incubator-trafodion git commit: rework the fix to JIRA1443:
add copyright notes and move isUpdatestatsStmt into HSGLOBALCLASS
rework the fix to JIRA1443: add copyright notes and move isUpdatestatsStmt into HSGLOBALCLASS
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a906cca5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a906cca5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a906cca5
Branch: refs/heads/master
Commit: a906cca5c43666ca67aa592f765781e329de8d86
Parents: 3b1cf85
Author: Qifan Chen <qf...@dev02.trafodion.org>
Authored: Mon Sep 21 17:59:50 2015 +0000
Committer: Qifan Chen <qf...@dev02.trafodion.org>
Committed: Mon Sep 21 17:59:50 2015 +0000
----------------------------------------------------------------------
core/sql/regress/seabase/ddl.sb028 | 22 ++++++++++++++++++++++
core/sql/regress/seabase/dml.sb028 | 22 ++++++++++++++++++++++
core/sql/ustat/hs_globals.cpp | 3 ++-
core/sql/ustat/hs_globals.h | 1 +
core/sql/ustat/hs_parser.cpp | 11 ++++-------
core/sql/ustat/hs_yacc.y | 6 ++----
6 files changed, 53 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/regress/seabase/ddl.sb028
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/ddl.sb028 b/core/sql/regress/seabase/ddl.sb028
index a58ab55..9d0f806 100644
--- a/core/sql/regress/seabase/ddl.sb028
+++ b/core/sql/regress/seabase/ddl.sb028
@@ -1,3 +1,25 @@
+-- tests for updating statistics for external native hbase tables.
+--
+-- @@@ START COPYRIGHT @@@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+-- @@@ END COPYRIGHT @@@
set schema hbase."_CELL_";
drop hbase table t028tbl1;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/regress/seabase/dml.sb028
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/dml.sb028 b/core/sql/regress/seabase/dml.sb028
index 08d3b26..e700882 100644
--- a/core/sql/regress/seabase/dml.sb028
+++ b/core/sql/regress/seabase/dml.sb028
@@ -1,3 +1,25 @@
+-- tests for updating statistics for external native hbase tables.
+--
+-- @@@ START COPYRIGHT @@@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+-- @@@ END COPYRIGHT @@@
log LOG028;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index d5dba38..c64d26d 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -2785,7 +2785,8 @@ HSGlobalsClass::HSGlobalsClass(ComDiagsArea &diags)
sample_I_generated(FALSE),
jitLogThreshold(0),
stmtStartTime(0),
- jitLogOn(FALSE)
+ jitLogOn(FALSE),
+ isUpdatestatsStmt(FALSE)
{
// Must add the context first in the constructor.
contID_ = AddHSContext(this);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/ustat/hs_globals.h
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.h b/core/sql/ustat/hs_globals.h
index e55f27a..e6a6592 100644
--- a/core/sql/ustat/hs_globals.h
+++ b/core/sql/ustat/hs_globals.h
@@ -1604,6 +1604,7 @@ public:
NABoolean sampleTableUsed; /* sample table created */
NABoolean samplingUsed; /* sample (w/wo sample tbl)*/
NABoolean unpartitionedSample; /* sample tbl not partitned*/
+ NABoolean isUpdatestatsStmt; /* is update stats command */
Lng32 groupCount; /* total #column groups */
Lng32 singleGroupCount; /* #single-column groups */
HSColGroupStruct *singleGroup; /* single-column group list*/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/ustat/hs_parser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_parser.cpp b/core/sql/ustat/hs_parser.cpp
index 5738438..162a211 100644
--- a/core/sql/ustat/hs_parser.cpp
+++ b/core/sql/ustat/hs_parser.cpp
@@ -58,9 +58,6 @@ extern void destroy_scanner(void* &scanner);
Lng32 AddSingleColumn(const Lng32 colNumber);
-NABoolean isUpdatestatsStmt = FALSE;
-
-
// -----------------------------------------------------------------------
// Invoke yyparse, set hsGlobal structure for each column group.
// -----------------------------------------------------------------------
@@ -303,7 +300,7 @@ Lng32 AddTableName( const hs_table_type type
hs_globals->tableType,
hs_globals->nameSpace);
- if (NOT hs_globals->objDef->objExists(isUpdatestatsStmt))
+ if (NOT hs_globals->objDef->objExists(hs_globals->isUpdatestatsStmt))
{
// now look into the regular schema
delete hs_globals->objDef;
@@ -351,7 +348,7 @@ Lng32 AddTableName( const hs_table_type type
// try public schema if an object is not qualified and not found
if ((NOT schema) &&
- (NOT hs_globals->objDef->objExists(isUpdatestatsStmt)))
+ (NOT hs_globals->objDef->objExists(hs_globals->isUpdatestatsStmt)))
{
NAString pubSch = ActiveSchemaDB()->getDefaults().getValue(PUBLIC_SCHEMA_NAME);
ComSchemaName pubSchema(pubSch);
@@ -370,7 +367,7 @@ Lng32 AddTableName( const hs_table_type type
hs_globals->tableType,
hs_globals->nameSpace);
- if (pubObjDef->objExists(isUpdatestatsStmt))
+ if (pubObjDef->objExists(hs_globals->isUpdatestatsStmt))
{
hs_globals->objDef = pubObjDef;
}
@@ -378,7 +375,7 @@ Lng32 AddTableName( const hs_table_type type
}
}
- if (NOT hs_globals->objDef->objExists(isUpdatestatsStmt))
+ if (NOT hs_globals->objDef->objExists(hs_globals->isUpdatestatsStmt))
{
HSFuncMergeDiags(-UERR_OBJECT_INACCESSIBLE, extName);
retcode = -1;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a906cca5/core/sql/ustat/hs_yacc.y
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_yacc.y b/core/sql/ustat/hs_yacc.y
index 7acf82f..2a602c7 100644
--- a/core/sql/ustat/hs_yacc.y
+++ b/core/sql/ustat/hs_yacc.y
@@ -60,8 +60,6 @@ extern THREAD_P HSGlobalsClass *hs_globals_y;
extern int yylex(YYSTYPE * lvalp, void* scanner);
//extern int yylex();
-extern NABoolean isUpdatestatsStmt;
-
#define scanner scanner
%}
@@ -104,9 +102,9 @@ extern NABoolean isUpdatestatsStmt;
same syntax it will fail to parse there and never get here.
*/
-statement : UPDATE STATISTICS { isUpdatestatsStmt = TRUE; } FOR table_kind table_identifier histogram_options
+statement : UPDATE STATISTICS { hs_globals_y->isUpdatestatsStmt = TRUE; } FOR table_kind table_identifier histogram_options
{
- isUpdatestatsStmt = FALSE;
+ hs_globals_y->isUpdatestatsStmt = FALSE;
}
| UPDATE STATISTICS LOG ON
{