[GitHub] incubator-trafodion pull request #1248: [trafodion-2728] - bug fix - SHOWSTA...

2017-10-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-trafodion/pull/1248


---


[GitHub] incubator-trafodion pull request #1248: [trafodion-2728] - bug fix - SHOWSTA...

2017-09-28 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1248#discussion_r141729695
  
--- Diff: 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 *));
+HSHandleError(retcode);
+if (cnt == 0)
+  return 0;
--- End diff --

We need to do an LM->StopTimer() before returning.


---


[GitHub] incubator-trafodion pull request #1248: [trafodion-2728] - bug fix - SHOWSTA...

2017-09-28 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1248#discussion_r141730360
  
--- Diff: 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)
--- End diff --

Are there any other examples of this kind of bug besides native HBase 
access? What happens if we do SHOWSTATS on a native Hive table, for example, 
but the "_HIVESTATS_" schema has not yet been created? (This kind of question 
is why I was hoping for a solution where we interpreted the error code from 
cursor103.open() instead.)


---


[GitHub] incubator-trafodion pull request #1248: [trafodion-2728] - bug fix - SHOWSTA...

2017-09-28 Thread andyyangcn
GitHub user andyyangcn opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1248

[trafodion-2728] - bug fix - SHOWSTATS sometimes gives strange messag…

…e when stats don't exist

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/andyyangcn/incubator-trafodion fix1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/1248.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1248


commit 9474cc43b82f4ac977ae8ca365823145be2a9bed
Author: Andy Yang 
Date:   2017-09-28T09:14:13Z

[trafodion-2728] - bug fix - SHOWSTATS sometimes gives strange message when 
stats don't exist




---