[GitHub] incubator-trafodion pull request #577: [TRAFODION-1673] support with clause
Github user traflm commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/577#discussion_r71058116 --- Diff: core/sql/parser/sqlparser.y --- @@ -7000,6 +7024,46 @@ rel_subquery_and_as_clause : rel_subquery as_clause CheckModeSpecial1(); $$ = $2; } +with_clause : + TOK_WITH with_clause_elements + { + $$ = NULL; + } + | TOK_WITH TOK_RECURSIVE with_clause_elements + { +*SqlParser_Diags << DgSqlCode(-3022) << DgString0("WITH RECURSIVE"); +YYERROR; + } + +with_clause_elements : with_clause_element + { + $$ = NULL; + } + | with_clause_elements ',' with_clause_element + { + $$ = NULL; + } + +with_clause_element : correlation_name TOK_AS '(' query_expression ')' + { + RelRoot *root = new (PARSERHEAP()) +RelRoot($4, REL_ROOT); + $$= new (PARSERHEAP()) RenameTable(root, *$1); + + //Duplicated definition of WITH + if(SqlParser_CurrentParser->hasWithDefinition($1) ) + { +*SqlParser_Diags << DgSqlCode(-3288) + << DgString0((*$1).toCharStar()); + delete $1; + delete $4; + YYERROR; + } + + SqlParser_CurrentParser->insertWithDefinition($1 , $$); + delete $1; + delete $4; --- End diff -- I agree, will change it. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #596: [JIRA TRAFODION-2060] additional chan...
GitHub user anoopsharma00 opened a pull request: https://github.com/apache/incubator-trafodion/pull/596 [JIRA TRAFODION-2060] additional changes to tinyint datatype support (and one more fix) -- tinyint datatype was not correctly converted to a corresponding datatype(returned type and input params) in all cases for callers that dont yet support tinyint/boolean datatypes. This caused phoenix tests for t4/t2 drivers to fail. That has been fixed. -- unsupported datatypes are no longer converted to equivalent datatypes if select is for a view. -- swstatus output change was causing seabase/hive regressions to incorrectly stop and start hadoop. regression scripts have been updated to reflect the swstatus change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/anoopsharma00/incubator-trafodion ansharma_trafr21_br Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/596.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 #596 commit ff0dd266394973861c9765b364a0a94d6118d908 Author: Anoop SharmaDate: 2016-07-16T00:26:00Z [JIRA TRAFODION-2060] additional changes to tinyint change -- tinyint datatype was not correctly converted to a corresponding datatype(returned type and input params) in all cases for callers that dont yet support tinyint/boolean datatypes. That has been fixed. -- unsupported datatypes are no longer converted to equivalent datatypes if select is for a view. -- swstatus output change was causing seabase/hive regressions to incorrectly stop and start hadoop. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #565: [TRAFODION-2037] Improve DDL concurre...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/565#discussion_r71025584 --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp --- @@ -437,6 +437,10 @@ short CmpSeabaseDDL::convertColAndKeyInfoArrays( ComTdbVirtTableKeyInfo = btKeyInfoArray[ii]; if (strcmp(ci.colName, ki.colName) == 0) { + if (ki.ordering == 0) +nac->setClusteringKey(ASCENDING); + else // ki.ordering should be 1 +nac->setClusteringKey(DESCENDING); naKeyArr->insert(nac); --- End diff -- Will do. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #568: TRAFODION-2016
Github user prashanth-vasudev commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/568#discussion_r71025497 --- Diff: core/sqf/src/seatrans/hbase-trx/Makefile --- @@ -54,35 +65,49 @@ jdk_1_7_mapr: build_chk_mapr jdk_1_7_hdp: build_chk_hdp $(REINSTATE_ORIG) $(UNCOMMENT_STRING) HDP2.3 - $(MAKE) build_chk_hdp set -o pipefail && $(MAVEN) -f pom.xml.hdp package -DskipTests | tee -a build_trx.log mkdir -p $(MY_SQROOT)/export/lib cp -pf target/$(BLD_HBASE_HDP_TRX_JARNAME) $(MY_SQROOT)/export/lib $(RM) $(VFILE) -jdk_1_7_apache: build_chk_apache +jdk_1_7_apache10: build_chk_apache10 $(REINSTATE_ORIG) - $(UNCOMMENT_STRING) APACHE - $(MAKE) build_chk_apache - echo "$(MAVEN) package -DskipTests" - echo "### For full Maven output, see file build_trx.log" - set -o pipefail && $(MAVEN) -f pom.xml.apache package -DskipTests | tee build_trx.log + $(UNCOMMENT_STRING) HBASE1.0 + set -o pipefail && $(MAVEN) -f pom.xml.apache10 package -DskipTests | tee build_trx.log mkdir -p $(MY_SQROOT)/export/lib - cp -pf target/$(BLD_HBASE_APACHE_TRX_JARNAME) $(MY_SQROOT)/export/lib + cp -pf target/$(BLD_HBASE_APACHE10_TRX_JARNAME) $(MY_SQROOT)/export/lib $(RM) $(VFILE) + +jdk_1_7_apache11: build_chk_apache11 $(REINSTATE_ORIG) + $(UNCOMMENT_STRING) HBASE1.1 --- End diff -- apache 11 and hbase 1.1 is used interchangeably here. Can we make this consistent so that there is no ambuiguity? May be change the tag to Apache11? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #565: [TRAFODION-2037] Improve DDL concurre...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/565#discussion_r71025544 --- Diff: core/sql/parser/sqlparser.y --- @@ -16026,13 +16027,30 @@ exe_util_init_hbase : TOK_INITIALIZE TOK_TRAFODION DDLExpr * de = new(PARSERHEAP()) DDLExpr(TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, - FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, --- End diff -- I agree. Cleaning this up is a good idea. I will do it under a separate JIRA. I have written JIRA TRAFODION-2111 for this purpose. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #593: [TRAFODION-2109] Load with log error ...
Github user selvaganesang commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/593#discussion_r71015648 --- Diff: core/sql/executor/ExHbaseAccess.cpp --- @@ -2996,6 +3003,14 @@ void ExHbaseAccessTcb::handleException(NAHeap *heap, errorMsgLen = strlen("[UNKNOWN EXCEPTION]\n"); --- End diff -- will do --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #593: [TRAFODION-2109] Load with log error ...
Github user selvaganesang commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/593#discussion_r71015190 --- Diff: core/sql/executor/ExHbaseAccess.cpp --- @@ -2967,22 +2968,28 @@ void ExHbaseAccessTcb::handleException(NAHeap *heap, ComCondition *errorCond, ExpHbaseInterface * ehi, NABoolean & LoggingFileCreated, -char *loggingFileName) +char *loggingFileName, +ComDiagsArea **loggingErrorDiags) { Lng32 errorMsgLen = 0; charBuf *cBuf = NULL; char *errorMsg; Lng32 retcode; + if (*loggingErrorDiags != NULL) --- End diff -- Basically, we want to skip the error rows in the source and continue to load. Load command has constructs to log the error row and the error information about it. We just want to report the error while logging the error rows as warning at the end of the load command. This check is skipping the logging once an error is encountered in the earlier attempt to log the error row. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #595: [TRAFODION-2110] core/TESTRTS is bein...
GitHub user selvaganesang opened a pull request: https://github.com/apache/incubator-trafodion/pull/595 [TRAFODION-2110] core/TESTRTS is being incorrectly flagged as PASSED Some of the filter conditions were reporting error when it was applied on both the expected and log output. You can merge this pull request into a Git repository by running: $ git pull https://github.com/selvaganesang/incubator-trafodion testrts_issue Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/595.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 #595 commit dab5b45aa426c33d642a981058c9d0ba23ed13b2 Author: selvaganesangDate: 2016-07-15T17:46:37Z [TRAFODION-2110] core/TESTRTS is being incorrectly flagged as PASSED Some of the filter conditions were reporting error when it was applied on both the expected and log output. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #565: [TRAFODION-2037] Improve DDL concurre...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/565#discussion_r71012217 --- Diff: core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp --- @@ -47,8 +47,17 @@ short CmpSeabaseDDL::createRepos(ExeCliInterface * cliInterface) NABoolean xnWasStartedHere = FALSE; + cliRC = cliInterface->holdAndSetCQD +("TRAF_MAX_CHARACTER_COL_LENGTH", "100"); + --- End diff -- The EXPLAIN_PLAN column in the METRIC_QUERY_TABLE was increased in size from 20 to 100 as part of these changes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #565: [TRAFODION-2037] Improve DDL concurre...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/565#discussion_r71011603 --- Diff: core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp --- @@ -114,43 +123,72 @@ short CmpSeabaseDDL::createRepos(ExeCliInterface * cliInterface) } if (endXnIfStartedHere(cliInterface, xnWasStartedHere, cliRC) < 0) -return -1; +goto label_error; } // for + cliRC = cliInterface->restoreCQD("TRAF_MAX_CHARACTER_COL_LENGTH"); return 0; + + label_error: + cliRC = cliInterface->restoreCQD("TRAF_MAX_CHARACTER_COL_LENGTH"); + return -1; } short CmpSeabaseDDL::dropRepos(ExeCliInterface * cliInterface, NABoolean oldRepos, - NABoolean dropSchema) + NABoolean dropSchema, + NABoolean inRecovery) { Lng32 cliRC = 0; - + NABoolean xnWasStartedHere = FALSE; char queryBuf[1000]; for (Int32 i = 0; i < sizeof(allReposUpgradeInfo)/sizeof(MDUpgradeInfo); i++) { const MDUpgradeInfo = allReposUpgradeInfo[i]; + // If we are dropping the new repository as part of a recovery action, + // and there is no "old" table (because the table didn't change in this + // upgrade), then don't drop the new table. (If we did, we would be + // dropping the existing data.) + if (!oldRepos && inRecovery && !rti.oldName) +continue; + if ((oldRepos && !rti.oldName) || (NOT oldRepos && ! rti.newName)) continue; str_sprintf(queryBuf, "drop table %s.\"%s\".%s cascade; ", getSystemCatalog(), SEABASE_REPOS_SCHEMA, (oldRepos ? rti.oldName : rti.newName)); - + + if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere)) +{ + cliInterface->retrieveSQLDiagnostics(CmpCommon::diags()); + return -1; +} + --- End diff -- I do not know of any such plans. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #565: [TRAFODION-2037] Improve DDL concurre...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/565#discussion_r71011442 --- Diff: core/sql/sqlcomp/CmpSeabaseDDLmd.h --- @@ -661,6 +690,452 @@ static const MDTableInfo allMDHistInfo[] = { #define SEABASE_VALIDATE_LIBRARY_OLD_MD SEABASE_VALIDATE_LIBRARY"_OLD_MD" + START_OLD_MD_v11: +OLD metadata Version 1.1 (Major version = 1, Minor version = 1). +// + +static const QString seabaseOldTrafMDv11AuthsDDL[] = +{ + {" create table "SEABASE_AUTHS_OLD_MD" "}, + {" ( "}, + {" auth_id int unsigned not null not serialized, "}, + {" auth_db_name varchar(256 bytes) character set utf8 not null not serialized, "}, + {" auth_ext_name varchar(256 bytes) character set utf8 not null not serialized, "}, + {" auth_type char(2) character set iso88591 not null not serialized, "}, + {" auth_creator int unsigned not null not serialized, "}, + {" auth_is_valid char(2) character set iso88591 not null not serialized, "}, + {" auth_create_time largeint not null not serialized, "}, + {" auth_redef_time largeint not null not serialized, "}, + {" flags largeint not null not serialized "}, + {" ) "}, + {" primary key (auth_id) "}, + {" ; "} +}; + +static const QString seabaseOldTrafMDv11ColumnsDDL[] = +{ + {" create table "SEABASE_COLUMNS_OLD_MD" "}, + {" ( "}, + {" object_uid largeint not null not serialized, "}, + {" column_name varchar(256 bytes) character set utf8 not null not serialized, "}, + {" column_number int not null not serialized, "}, + {" column_class char(2) character set iso88591 not null not serialized, "}, + {" fs_data_type int not null not serialized, "}, + {" sql_data_type char(32) character set iso88591 not null not serialized, "}, + {" column_size int not null not serialized, "}, + {" column_precision int not null not serialized, "}, + {" column_scale int not null not serialized, "}, + {" datetime_start_field int not null not serialized, "}, + {" datetime_end_field int not null not serialized, "}, + {" is_upshifted char(2) character set iso88591 not null not serialized, "}, + {" column_flags int unsigned not null not serialized, "}, + {" nullable int not null not serialized, "}, + {" character_set char(40) character set iso88591 not null not serialized, "}, + {" default_class int not null not serialized, "}, + {" default_value varchar(1024 bytes) character set utf8 not null not serialized, "}, + {" column_heading varchar(256 bytes) character set utf8 not null not serialized, "}, + {" hbase_col_family varchar(40) character set iso88591 not null not serialized, "}, + {" hbase_col_qualifier varchar(40) character set iso88591 not null not serialized, "}, + {" direction char(2) character set iso88591 not null not serialized, "}, + {" is_optional char(2) character set iso88591 not null not serialized, "}, + {" flags largeint not null not serialized "}, + {" ) "}, + {" primary key (object_uid, column_name) "}, + {" ; "} +}; + +enum SeabaseOldTrafMDv11ColumnsFlags { + SEABASE_COLUMN_IS_SALT_V11 = 0x0001, // don't rely on this quite yet, + // since some older tables + // don't have this flag set + SEABASE_COLUMN_IS_DIVISION_V11 = 0x0002 +}; + +static const QString seabaseOldTrafMDv11DefaultsDDL[] = +{ + {" create table "SEABASE_DEFAULTS_OLD_MD" "}, + {" ( "}, + {" attribute varchar(100 bytes) character set utf8 not null not serialized, "}, + {" attr_value varchar(1000 bytes) character set utf8 not null not serialized, "}, + {" attr_comment varchar(1000 bytes) character set utf8 not null not serialized "}, + {" ) "}, + {" primary key (attribute) "}, + {" ; "} +}; + +static const QString seabaseOldTrafMDv11KeysDDL[] = +{ + {" create table "SEABASE_KEYS_OLD_MD" "}, + {" ( "}, + {" object_uid largeint not null not serialized, "}, + {" column_name varchar( 256 bytes ) character set utf8 not null not serialized, "}, + {" keyseq_number int not null not serialized, "}, + {" column_number int not null not serialized, "}, + {" ordering int not null not serialized, "}, + {" nonkeycol int not null not serialized, "}, + {" flags largeint not null not serialized "}, + {" ) "}, + {" primary key (object_uid, keyseq_number) "}, + {" ; "} +}; +
[GitHub] incubator-trafodion pull request #577: [TRAFODION-1673] support with clause
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/577#discussion_r71010941 --- Diff: core/sql/parser/sqlparser.y --- @@ -7000,6 +7024,46 @@ rel_subquery_and_as_clause : rel_subquery as_clause CheckModeSpecial1(); $$ = $2; } +with_clause : + TOK_WITH with_clause_elements + { + $$ = NULL; + } + | TOK_WITH TOK_RECURSIVE with_clause_elements + { +*SqlParser_Diags << DgSqlCode(-3022) << DgString0("WITH RECURSIVE"); +YYERROR; + } + +with_clause_elements : with_clause_element + { + $$ = NULL; + } + | with_clause_elements ',' with_clause_element + { + $$ = NULL; + } + +with_clause_element : correlation_name TOK_AS '(' query_expression ')' + { + RelRoot *root = new (PARSERHEAP()) +RelRoot($4, REL_ROOT); + $$= new (PARSERHEAP()) RenameTable(root, *$1); + + //Duplicated definition of WITH + if(SqlParser_CurrentParser->hasWithDefinition($1) ) + { +*SqlParser_Diags << DgSqlCode(-3288) + << DgString0((*$1).toCharStar()); + delete $1; + delete $4; + YYERROR; + } + + SqlParser_CurrentParser->insertWithDefinition($1 , $$); + delete $1; + delete $4; --- End diff -- I don't think we want to delete $1 and $4 here, since the RelRoot node points to $4 and the RenameTable node points to $1. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #577: [TRAFODION-1673] support with clause
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/577#discussion_r71010585 --- Diff: core/sql/parser/sqlparser.y --- @@ -13418,6 +13507,55 @@ query_specification : select_token '[' firstn_sorted NUMERIC_LITERAL_EXACT_NO_SC if (CmpCommon::getDefault(MVQR_LOG_QUERY_DESCRIPTORS) == DF_DUMP || CmpCommon::getDefault(MVQR_LOG_QUERY_DESCRIPTORS) == DF_DUMP_MV) ((RelRoot*)$$)->setAnalyzeOnly(); + } +/* type relx */ +query_specification : with_clause select_token '[' firstn_sorted NUMERIC_LITERAL_EXACT_NO_SCALE ']' set_quantifier query_spec_body + { + if ($7) { + $$ = new (PARSERHEAP()) + RelRoot(new (PARSERHEAP()) + GroupByAgg($8 --- End diff -- I don't understand why we add a GroupByAgg node here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #577: [TRAFODION-1673] support with clause
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/577#discussion_r71010430 --- Diff: core/sql/parser/sqlparser.y --- @@ -1,14 +13396,41 @@ query_specification : select_token set_quantifier query_spec_body ColReference(new (PARSERHEAP()) ColRefName(TRUE, PARSERHEAP())) ) ); - assert($3->getOperatorType() == REL_ROOT); + assert($3->getOperatorType() == REL_ROOT); + RelRoot *root1 = (RelRoot *) $$; + RelRoot *root2 = (RelRoot *) $3; + root1->assignmentStTree() = root2->assignmentStTree(); + root2->assignmentStTree() = NULL; + } + else + $$ = $3; + + if (CmpCommon::getDefault(MVQR_LOG_QUERY_DESCRIPTORS) == DF_DUMP || + CmpCommon::getDefault(MVQR_LOG_QUERY_DESCRIPTORS) == DF_DUMP_MV) + ((RelRoot*)$$)->setAnalyzeOnly(); + +} + +/* type relx */ +query_specification :with_clause select_token set_quantifier query_spec_body + { + if ($3) { + $$ = new (PARSERHEAP()) + RelRoot(new (PARSERHEAP()) + GroupByAgg($4 --- End diff -- I don't understand why we stick a GroupByAgg node here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #593: [TRAFODION-2109] Load with log error ...
Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/593#discussion_r71007168 --- Diff: core/sql/executor/ExHbaseAccess.cpp --- @@ -2996,6 +3003,14 @@ void ExHbaseAccessTcb::handleException(NAHeap *heap, errorMsgLen = strlen("[UNKNOWN EXCEPTION]\n"); --- End diff -- Looks like errorMsg is uninitialized in this code path. Perhaps we need to add, "errorMsg = "[UNKNOWN EXCEPTION]" here? (And maybe change this line to errorMsgLen = strlen(errorMsg)?) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #594: [TRAFODION-2079]Catalog API support g...
Github user xwq commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/594#discussion_r70993070 --- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp --- @@ -4967,10 +4967,40 @@ odbc_SQLSvc_GetSQLCatalogs_sme_( "and (ob.SCHEMA_NAME = '%s' or trim(ob.SCHEMA_NAME) LIKE '%s' ESCAPE '\\') " "and (ob.OBJECT_NAME = '%s' or trim(ob.OBJECT_NAME) LIKE '%s' ESCAPE '\\') " "and (ob.OBJECT_TYPE in ('BT', 'VI')) " -"and (trim(co.COLUMN_CLASS) not in('S', 'M'));", +"and (trim(co.COLUMN_CLASS) not in('S', 'M')) " +"union " +"select " +"cast('%s' as varchar(128)) TABLE_CAT, " +"cast(trim(ob.SCHEMA_NAME) as varchar(128)) TABLE_SCHEM, " +"cast(trim(ob.OBJECT_NAME) as varchar(128)) TABLE_NAME, " +"cast(idx.is_unique as smallint) NON_UNIQUE, " +"cast('' as varchar(128)) INDEX_QUALIFIER, " +"cast(trim(ob_table.OBJECT_NAME) as varchar(128)) INDEX_NAME, " +"cast(3 as smallint) TYPE, " +"cast(0 as smallint) ORDINAL_POSITION, " +"cast('' as varchar(128)) COLUMN_NAME, " +"cast('' as char(1)) ASC_OR_DES, " --- End diff -- I will change it to null. I will add the test to ODBC test. I think I still need add some new JDBC test. I will take some days. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-trafodion pull request #594: [TRAFODION-2079]Catalog API support g...
Github user selvaganesang commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/594#discussion_r70990583 --- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp --- @@ -4967,10 +4967,40 @@ odbc_SQLSvc_GetSQLCatalogs_sme_( "and (ob.SCHEMA_NAME = '%s' or trim(ob.SCHEMA_NAME) LIKE '%s' ESCAPE '\\') " "and (ob.OBJECT_NAME = '%s' or trim(ob.OBJECT_NAME) LIKE '%s' ESCAPE '\\') " "and (ob.OBJECT_TYPE in ('BT', 'VI')) " -"and (trim(co.COLUMN_CLASS) not in('S', 'M'));", +"and (trim(co.COLUMN_CLASS) not in('S', 'M')) " +"union " +"select " +"cast('%s' as varchar(128)) TABLE_CAT, " +"cast(trim(ob.SCHEMA_NAME) as varchar(128)) TABLE_SCHEM, " +"cast(trim(ob.OBJECT_NAME) as varchar(128)) TABLE_NAME, " +"cast(idx.is_unique as smallint) NON_UNIQUE, " +"cast('' as varchar(128)) INDEX_QUALIFIER, " +"cast(trim(ob_table.OBJECT_NAME) as varchar(128)) INDEX_NAME, " +"cast(3 as smallint) TYPE, " +"cast(0 as smallint) ORDINAL_POSITION, " +"cast('' as varchar(128)) COLUMN_NAME, " +"cast('' as char(1)) ASC_OR_DES, " --- End diff -- Spec says NULL should be returned when the value is not available. Can you please change it to NULL. Attaching a formatted output of this query when the table has index would be helpful to validate the results of the query by the reviewers. Consider creating a use case with two tables one with update statistics performed and another without. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---