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 2017/10/03 15:15:30 UTC
[1/3] incubator-trafodion git commit: [trafodion-2728] - bug fix -
SHOWSTATS sometimes gives strange message when stats don't exist
Repository: incubator-trafodion
Updated Branches:
refs/heads/master e1c0776d5 -> 81d5b83f5
[trafodion-2728] - bug fix - SHOWSTATS sometimes gives strange message when stats don't exist
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9474cc43
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9474cc43
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9474cc43
Branch: refs/heads/master
Commit: 9474cc43b82f4ac977ae8ca365823145be2a9bed
Parents: 4c9423f
Author: Andy Yang <yo...@esgyn.cn>
Authored: Thu Sep 28 17:14:13 2017 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Thu Sep 28 17:14:13 2017 +0800
----------------------------------------------------------------------
core/sql/ustat/hs_globals.cpp | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9474cc43/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index 0bdd05a..6b70666 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -8472,6 +8472,23 @@ Lng32 HSGlobalsClass::groupListFromTable(HSColGroupStruct*& groupList,
// Initialize the pointer to the group list we will build.
groupList = NULL;
+
+ // if showstats for a native hbase table, need to check if the schema _HBASESTATS_ exist
+ if (strcmp(hstogram_table->data(), "TRAFODION.\"_HBASESTATS_\".SB_HISTOGRAMS") == 0)
+ {
+ NAString queryStr = "SELECT count(*) FROM \"_MD_\".OBJECTS WHERE SCHEMA_NAME='_HBASESTATS_' "
+ "AND OBJECT_NAME='__SCHEMA__' AND OBJECT_TYPE='PS';";
+ HSCursor cursor;
+ retcode = cursor.prepareQuery(queryStr.data(), 0, 1);
+ HSHandleError(retcode);
+ retcode = cursor.open();
+ HSHandleError(retcode);
+ ULng32 cnt;
+ retcode = cursor.fetch (1, (void *)&cnt);
+ HSHandleError(retcode);
+ if (cnt == 0)
+ return 0;
+ }
#ifdef NA_USTAT_USE_STATIC // use static query defined in module file
HSCliStatement::statementIndex stmt;
[2/3] incubator-trafodion git commit: [mantis-4973] add fix for hive
table and table under seabase.
Posted by db...@apache.org.
[mantis-4973] add fix for hive table and table under seabase.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/e0e8890f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/e0e8890f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/e0e8890f
Branch: refs/heads/master
Commit: e0e8890f08ec0fa6ed659b1b8461a4170cd00aed
Parents: 9474cc4
Author: Andy Yang <yo...@esgyn.cn>
Authored: Fri Sep 29 17:31:37 2017 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Fri Sep 29 17:31:37 2017 +0800
----------------------------------------------------------------------
core/sql/ustat/hs_globals.cpp | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e0e8890f/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index 6b70666..fbaf1d3 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -8473,11 +8473,19 @@ Lng32 HSGlobalsClass::groupListFromTable(HSColGroupStruct*& groupList,
// Initialize the pointer to the group list we will build.
groupList = NULL;
- // if showstats for a native hbase table, need to check if the schema _HBASESTATS_ exist
+ // if showstats for a native hbase table,hive table or table under seabase schema,
+ // need to check if the table SB_HISTOGRAMS exist
+ NAString schemaName;
if (strcmp(hstogram_table->data(), "TRAFODION.\"_HBASESTATS_\".SB_HISTOGRAMS") == 0)
+ schemaName = "_HBASESTATS_";
+ else if (strcmp(hstogram_table->data(), "TRAFODION.\"_HIVESTATS_\".SB_HISTOGRAMS") == 0)
+ schemaName = "_HIVESTATS_";
+ else if (strcmp(hstogram_table->data(), "TRAFODION.SEABASE.SB_HISTOGRAMS") == 0)
+ schemaName = "SEABASE";
+ if (!schemaName.isNull())
{
- NAString queryStr = "SELECT count(*) FROM \"_MD_\".OBJECTS WHERE SCHEMA_NAME='_HBASESTATS_' "
- "AND OBJECT_NAME='__SCHEMA__' AND OBJECT_TYPE='PS';";
+ NAString queryStr = "SELECT count(*) FROM \"_MD_\".OBJECTS WHERE SCHEMA_NAME='" + schemaName +
+ "' AND OBJECT_NAME='SB_HISTOGRAMS' AND OBJECT_TYPE='BT';";
HSCursor cursor;
retcode = cursor.prepareQuery(queryStr.data(), 0, 1);
HSHandleError(retcode);
@@ -8487,7 +8495,10 @@ Lng32 HSGlobalsClass::groupListFromTable(HSColGroupStruct*& groupList,
retcode = cursor.fetch (1, (void *)&cnt);
HSHandleError(retcode);
if (cnt == 0)
- return 0;
+ {
+ LM->StopTimer();
+ return 0;
+ }
}
#ifdef NA_USTAT_USE_STATIC // use static query defined in module file
[3/3] incubator-trafodion git commit: Merge [TRAFODION-2728] PR 1248
SHOWSTATS error message improvement
Posted by db...@apache.org.
Merge [TRAFODION-2728] PR 1248 SHOWSTATS error message improvement
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/81d5b83f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/81d5b83f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/81d5b83f
Branch: refs/heads/master
Commit: 81d5b83f5b0f2437d22ffe48fe3cc46efe142859
Parents: e1c0776 e0e8890
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Oct 3 15:14:51 2017 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Oct 3 15:14:51 2017 +0000
----------------------------------------------------------------------
core/sql/ustat/hs_globals.cpp | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/81d5b83f/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------