Repository: trafodion Updated Branches: refs/heads/master efd564727 -> 8b56ed242
[TRAFODION-3101] enhance get command to show rows get Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/591e0fa6 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/591e0fa6 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/591e0fa6 Branch: refs/heads/master Commit: 591e0fa60a13f9f57eee1bc7a9b35fe5a10145a2 Parents: 0db94ea Author: Liu Ming <ovis_p...@sina.com> Authored: Sun Jun 24 20:48:37 2018 -0400 Committer: Liu Ming <ovis_p...@sina.com> Committed: Sun Jun 24 20:48:37 2018 -0400 ---------------------------------------------------------------------- core/sql/executor/ExExeUtilGet.cpp | 14 +++++++ core/sql/regress/compGeneral/EXPECTED023 | 56 +++++++++++++++++++++++++++ core/sql/regress/core/EXPECTED116 | 21 ++++++++++ core/sql/regress/executor/EXPECTED130 | 4 ++ core/sql/regress/seabase/EXPECTED011 | 4 ++ core/sql/regress/seabase/EXPECTED012 | 52 +++++++++++++++++++++++++ core/sql/regress/seabase/EXPECTED022 | 17 ++++++++ core/sql/regress/seabase/EXPECTED031 | 4 ++ 8 files changed, 172 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/executor/ExExeUtilGet.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExExeUtilGet.cpp b/core/sql/executor/ExExeUtilGet.cpp index 163b190..5bb4793 100644 --- a/core/sql/executor/ExExeUtilGet.cpp +++ b/core/sql/executor/ExExeUtilGet.cpp @@ -949,6 +949,7 @@ short ExExeUtilGetMetadataInfoTcb::displayHeading() { if (getMItdb().noHeader()) { +printf("LMDBG noheader is true\n"); return 0; } // make sure there is enough space to move header @@ -1818,8 +1819,12 @@ short ExExeUtilGetMetadataInfoTcb::work() { short retcode = 0; Lng32 cliRC = 0; + Lng32 returnRowCount=0; + char returnMsg[256]; ex_expr::exp_return_type exprRetCode = ex_expr::EXPR_OK; + memset(returnMsg, 0, 256); + // if no parent request, return if (qparent_.down->isEmpty()) return WORK_OK; @@ -3184,6 +3189,7 @@ short ExExeUtilGetMetadataInfoTcb::work() } infoList_->advance(); + returnRowCount++; } break; @@ -3343,6 +3349,14 @@ short ExExeUtilGetMetadataInfoTcb::work() case DONE_: { + if (NOT getMItdb().noHeader()) + { + short rc = 0; + sprintf(returnMsg, "\n=======================\nSummary info of get:\nGet %d rows.", returnRowCount); + moveRowToUpQueue(returnMsg, strlen(returnMsg), &rc); + moveRowToUpQueue(" "); + } + retcode = handleDone(); if (retcode == 1) return WORK_OK; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/compGeneral/EXPECTED023 ---------------------------------------------------------------------- diff --git a/core/sql/regress/compGeneral/EXPECTED023 b/core/sql/regress/compGeneral/EXPECTED023 index 8a46e13..2f1f012 100644 --- a/core/sql/regress/compGeneral/EXPECTED023 +++ b/core/sql/regress/compGeneral/EXPECTED023 @@ -23,6 +23,10 @@ SB_HISTOGRAMS SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES +======================= +Summary info of get: +Get 3 rows. + --- SQL operation complete. >> >>CREATE TABLE stest @@ -106,6 +110,10 @@ STEST STESTC STEST_EMPTY +======================= +Summary info of get: +Get 6 rows. + --- SQL operation complete. >> -- should be just stest, stest_empty, stestc, and the sb_* tables >> @@ -149,6 +157,10 @@ STESTC STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441663_444545 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + a sample table >> @@ -173,6 +185,10 @@ STESTC STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441711_141471 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + a different sample >> table >> @@ -203,6 +219,10 @@ STEST STESTC STEST_EMPTY +======================= +Summary info of get: +Get 6 rows. + --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables only >> @@ -230,6 +250,10 @@ STESTC STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441748_979037 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table >> @@ -264,6 +288,10 @@ STESTC STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table >> @@ -393,6 +421,10 @@ STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 TRAF_SAMPLE_07158060726899023220_1517441862_582002 +======================= +Summary info of get: +Get 8 rows. + --- SQL operation complete. >> >>execute s1 using 'STESTC'; @@ -428,6 +460,10 @@ STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 TRAF_SAMPLE_07158060726899023220_1517441862_582002 +======================= +Summary info of get: +Get 8 rows. + --- SQL operation complete. >> -- should be the same as previous "get tables" >> @@ -456,6 +492,10 @@ STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 TRAF_SAMPLE_07158060726899023220_1517441862_582002 +======================= +Summary info of get: +Get 8 rows. + --- SQL operation complete. >> -- should be the same as previous "get tables" >> @@ -485,6 +525,10 @@ STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 TRAF_SAMPLE_07158060726899023220_1517441862_582002 +======================= +Summary info of get: +Get 8 rows. + --- SQL operation complete. >> -- should be the same as previous "get tables" >> @@ -516,6 +560,10 @@ STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 TRAF_SAMPLE_07158060726899023220_1517441862_582002 +======================= +Summary info of get: +Get 8 rows. + --- SQL operation complete. >> -- should be the same as previous "get tables" >> @@ -567,6 +615,10 @@ STESTC STEST_EMPTY TRAF_SAMPLE_07158060726899021395_1517441802_045572 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >> -- should be the same as previous "get tables" except only one sample table >> @@ -592,6 +644,10 @@ SB_HISTOGRAMS SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES +======================= +Summary info of get: +Get 3 rows. + --- SQL operation complete. >> -- sample tables should be gone too >> http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/core/EXPECTED116 ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116 index a67e957..fcce935 100644 --- a/core/sql/regress/core/EXPECTED116 +++ b/core/sql/regress/core/EXPECTED116 @@ -735,6 +735,10 @@ Tables in Schema TRAFODION.T116SCH1 T116T1 +======================= +Summary info of get: +Get 1 rows. + --- SQL operation complete. >>drop table t116t1; @@ -748,6 +752,10 @@ SB_HISTOGRAMS SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES +======================= +Summary info of get: +Get 3 rows. + --- SQL operation complete. >>create table t116t2 (a int); @@ -762,12 +770,21 @@ SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES T116T2 +======================= +Summary info of get: +Get 4 rows. + --- SQL operation complete. >>drop schema t116sch1 cascade; --- SQL operation complete. >>get tables in schema t116sch1; + +======================= +Summary info of get: +Get 0 rows. + --- SQL operation complete. >>select count(*) from "_MD_".objects where schema_name = 'T116SCH1' +> for read uncommitted access; @@ -791,6 +808,10 @@ SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES T116T1 +======================= +Summary info of get: +Get 4 rows. + --- SQL operation complete. >> >>set schema sch; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/executor/EXPECTED130 ---------------------------------------------------------------------- diff --git a/core/sql/regress/executor/EXPECTED130 b/core/sql/regress/executor/EXPECTED130 index fa69e88..a14b67e 100644 --- a/core/sql/regress/executor/EXPECTED130 +++ b/core/sql/regress/executor/EXPECTED130 @@ -1595,6 +1595,10 @@ SB_HISTOGRAM_INTERVALS SB_PERSISTENT_SAMPLES TLOB130TS2 +======================= +Summary info of get: +Get 7 rows. + --- SQL operation complete. >>drop schema trafodion.lobsch cascade; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/seabase/EXPECTED011 ---------------------------------------------------------------------- diff --git a/core/sql/regress/seabase/EXPECTED011 b/core/sql/regress/seabase/EXPECTED011 index 56c32a0..b09633a 100644 --- a/core/sql/regress/seabase/EXPECTED011 +++ b/core/sql/regress/seabase/EXPECTED011 @@ -1295,6 +1295,10 @@ METRIC_QUERY_TABLE METRIC_SESSION_TABLE METRIC_TEXT_TABLE +======================= +Summary info of get: +Get 4 rows. + --- SQL operation complete. >>invoke trafodion."_REPOS_".metric_query_table; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/seabase/EXPECTED012 ---------------------------------------------------------------------- diff --git a/core/sql/regress/seabase/EXPECTED012 b/core/sql/regress/seabase/EXPECTED012 index 3a59914..66c882b 100644 --- a/core/sql/regress/seabase/EXPECTED012 +++ b/core/sql/regress/seabase/EXPECTED012 @@ -289,6 +289,10 @@ SB_PERSISTENT_SAMPLES T012T11 T012T12 +======================= +Summary info of get: +Get 5 rows. + --- SQL operation complete. >>get indexes in schema trafodion.zschema; @@ -300,6 +304,10 @@ T012T11C2 T012T11I1 T012T11I2 +======================= +Summary info of get: +Get 4 rows. + --- SQL operation complete. >>get views in schema trafodion.zschema; @@ -308,6 +316,10 @@ Views in Schema TRAFODION.ZSCHEMA T012T11V1 +======================= +Summary info of get: +Get 1 rows. + --- SQL operation complete. >> >>drop schema trafodion.zschema cascade; @@ -316,12 +328,27 @@ T012T11V1 >> >>get tables in schema trafodion.zschema; + +======================= +Summary info of get: +Get 0 rows. + --- SQL operation complete. >>get indexes in schema trafodion.zschema; + +======================= +Summary info of get: +Get 0 rows. + --- SQL operation complete. >>get views in schema trafodion.zschema; + +======================= +Summary info of get: +Get 0 rows. + --- SQL operation complete. >> >>obey TEST012(getStmts); @@ -364,6 +391,10 @@ Tables in View ZSCHEMA1.V TRAFODION.ZSCHEMA1.T TRAFODION.ZSCHEMA2.T +======================= +Summary info of get: +Get 2 rows. + --- SQL operation complete. >>get views on table zschema1.t; @@ -373,6 +404,10 @@ Views on Table ZSCHEMA1.T TRAFODION.ZSCHEMA1.V TRAFODION.ZSCHEMA2.V +======================= +Summary info of get: +Get 2 rows. + --- SQL operation complete. >> >>get tables in view zschema2.v2; @@ -382,6 +417,10 @@ Tables in View ZSCHEMA2.V2 TRAFODION.ZSCHEMA2.T +======================= +Summary info of get: +Get 1 rows. + --- SQL operation complete. >>get all tables in view zschema2.v2; @@ -391,6 +430,10 @@ Tables in View ZSCHEMA2.V2 TRAFODION.ZSCHEMA1.T TRAFODION.ZSCHEMA2.T +======================= +Summary info of get: +Get 2 rows. + --- SQL operation complete. >>get views in view zschema2.v2; @@ -399,6 +442,10 @@ Views in View ZSCHEMA2.V2 TRAFODION.ZSCHEMA1.V +======================= +Summary info of get: +Get 1 rows. + --- SQL operation complete. >>get all objects in view zschema2.v2; @@ -409,6 +456,11 @@ TRAFODION.ZSCHEMA1.T TRAFODION.ZSCHEMA1.V TRAFODION.ZSCHEMA2.T + +======================= +Summary info of get: +Get 3 rows. + --- SQL operation complete. >> >>drop schema zschema1 cascade; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/seabase/EXPECTED022 ---------------------------------------------------------------------- diff --git a/core/sql/regress/seabase/EXPECTED022 b/core/sql/regress/seabase/EXPECTED022 index f7f10d4..c89b2bd 100644 --- a/core/sql/regress/seabase/EXPECTED022 +++ b/core/sql/regress/seabase/EXPECTED022 @@ -1265,6 +1265,9 @@ HBase Registered Tables in Catalog TRAFODION "_CELL_".T022HBM2 "_ROW_".T022HBM2 +======================= +Summary info of get: +Get 2 rows. --- SQL operation complete. >>unregister hbase table t022hbm2; @@ -1280,6 +1283,9 @@ HBase Registered Tables in Catalog TRAFODION "_CELL_".T022HBM2 "_ROW_".T022HBM2 +======================= +Summary info of get: +Get 2 rows. --- SQL operation complete. >>showddl hbase."_CELL_".t022hbm2; @@ -1333,6 +1339,11 @@ REGISTER HBASE TABLE T022HBM2; --- SQL operation complete. >>get hbase registered tables in catalog trafodion, match '%T022HBM2%'; + +======================= +Summary info of get: +Get 0 rows. + --- SQL operation complete. >>showddl hbase."_CELL_".t022hbm2; @@ -1384,6 +1395,9 @@ HBase Registered Tables in Catalog TRAFODION "_CELL_".T022HBM2 +======================= +Summary info of get: +Get 1 rows. --- SQL operation complete. >>showddl hbase."_CELL_".t022hbm2; @@ -1449,6 +1463,9 @@ HBase Registered Tables in Catalog TRAFODION "_CELL_".T022HBM2 +======================= +Summary info of get: +Get 1 rows. --- SQL operation complete. >>showddl hbase."_CELL_".t022hbm2; http://git-wip-us.apache.org/repos/asf/trafodion/blob/591e0fa6/core/sql/regress/seabase/EXPECTED031 ---------------------------------------------------------------------- diff --git a/core/sql/regress/seabase/EXPECTED031 b/core/sql/regress/seabase/EXPECTED031 index f585e01..ea7a11c 100644 --- a/core/sql/regress/seabase/EXPECTED031 +++ b/core/sql/regress/seabase/EXPECTED031 @@ -1072,6 +1072,10 @@ Catalogs TRAFODION HIVE +======================= +Summary info of get: +Get 2 rows. + --- SQL operation complete. >> >>-- external and hive table mismatch on hive 'string' datatype