From acaa6c90ac8efa713320a3700c3819eed58aefd6 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 17 May 2018 07:06:28 +0000 Subject: [PATCH 1/8] comment on hbase --- core/sql/bin/SqlciErrors.txt | 1 + core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt index 8146be4013..f235d2bc51 100644 --- a/core/sql/bin/SqlciErrors.txt +++ b/core/sql/bin/SqlciErrors.txt @@ -3954,3 +3954,4 @@ $3~String1. 30048 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Fast Load failed. Number of error rows($0~Int0) inserted into the exception table exceeded the max allowed($1~Int1). 30049 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Fast Load succeeded. Number of error rows inserted into the exception table is $0~Int0 30050 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Memory required by input rowset buffer is $0~Int0 MB, exceeding specified limit of $1~Int1. Row length is $2~Int2 bytes and rowset has a maximum of $3~Int3 elements. +30051 ZZZZZ 99999 BEGINNER MAJOR DBADMIN You can not set comment to HBASE table. diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index cc4b00e843..196c8e4ec9 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -338,6 +338,14 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, textType = COM_COLUMN_COMMENT_TEXT; subID = commentOnNode->getColNum(); } + + // HBASE native table comment + if (strncasecmp(catalogNamePart.data(), "HBASE", 5) == 0) + { + *CmpCommon::diags() << DgSqlCode(-30051); + processReturn(); + return; + } /* Not using function updateTextTable(), because can not insert Chinese properly by function updateTextTable(). * For storing COMMENT in TEXT table is a temp solution, so updating TEXT table directly here. From 443a43b225bdbdc22b21cd70d0761cd159ef29c6 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 24 May 2018 08:33:03 +0000 Subject: [PATCH 2/8] [TRAFODION-3084] cannot set comment on native hbase table. --- core/sql/bin/SqlciErrors.txt | 2 +- core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt index f235d2bc51..ba9b169ebe 100644 --- a/core/sql/bin/SqlciErrors.txt +++ b/core/sql/bin/SqlciErrors.txt @@ -515,6 +515,7 @@ 1718 ZZZZZ 99999 BEGINNER MINOR DBADMIN --- unused --- 1719 ZZZZZ 99999 BEGINNER MINOR DBADMIN Access Type '$0~string0' is not supported. 1720 ZZZZZ 99999 BEGINNER MINOR DBADMIN Isolation Level '$0~string0' is not supported. +1722 ZZZZZ 99999 BEGINNER MINOR DBADMIN cannot set comment on '$0~string0' if the target table is native hbase table. 1999 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU --- Last Catalog Manager error --- 2000 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Error messages for compiler main, IPC, and DEFAULTS table; assertions for optimizer. 2001 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Error or warning $0~Int0 occurred while opening or reading from DEFAULTS table $1~TableName. Using $2~String0 values. @@ -3954,4 +3955,3 @@ $3~String1. 30048 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Fast Load failed. Number of error rows($0~Int0) inserted into the exception table exceeded the max allowed($1~Int1). 30049 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Fast Load succeeded. Number of error rows inserted into the exception table is $0~Int0 30050 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Memory required by input rowset buffer is $0~Int0 MB, exceeding specified limit of $1~Int1. Row length is $2~Int2 bytes and rowset has a maximum of $3~Int3 elements. -30051 ZZZZZ 99999 BEGINNER MAJOR DBADMIN You can not set comment to HBASE table. diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index 196c8e4ec9..43879320ac 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -338,14 +338,14 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, textType = COM_COLUMN_COMMENT_TEXT; subID = commentOnNode->getColNum(); } - - // HBASE native table comment - if (strncasecmp(catalogNamePart.data(), "HBASE", 5) == 0) + + if (str_cmp(toUpper(catalogNamePart.data()), "HBASE", 5) == 0) { - *CmpCommon::diags() << DgSqlCode(-30051); - processReturn(); - return; - } + CmpCommon::diags()->clear(); + *CmpCommon::diags() << DgSqlCode(-1722); + processReturn(); + return; + } /* Not using function updateTextTable(), because can not insert Chinese properly by function updateTextTable(). * For storing COMMENT in TEXT table is a temp solution, so updating TEXT table directly here. From 8b920005de12c26df8f6ada12dc6f1f27e2143e5 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 24 May 2018 08:39:47 +0000 Subject: [PATCH 3/8] [TRAFODION-3084] cannot set comment on native hbase table. --- core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index 43879320ac..fcce6c4e80 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -338,7 +338,8 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, textType = COM_COLUMN_COMMENT_TEXT; subID = commentOnNode->getColNum(); } - + + // cannot set comment on hbase native table if (str_cmp(toUpper(catalogNamePart.data()), "HBASE", 5) == 0) { CmpCommon::diags()->clear(); From 2b921c9f1ee746832eb3d5c4d6ea9baef9f9e804 Mon Sep 17 00:00:00 2001 From: gdgy Date: Fri, 25 May 2018 02:05:38 +0000 Subject: [PATCH 4/8] cannot set comment on native HBASE table --- core/sql/bin/SqlciErrors.txt | 2 +- core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt index ba9b169ebe..9e13a7ebc0 100644 --- a/core/sql/bin/SqlciErrors.txt +++ b/core/sql/bin/SqlciErrors.txt @@ -515,7 +515,7 @@ 1718 ZZZZZ 99999 BEGINNER MINOR DBADMIN --- unused --- 1719 ZZZZZ 99999 BEGINNER MINOR DBADMIN Access Type '$0~string0' is not supported. 1720 ZZZZZ 99999 BEGINNER MINOR DBADMIN Isolation Level '$0~string0' is not supported. -1722 ZZZZZ 99999 BEGINNER MINOR DBADMIN cannot set comment on '$0~string0' if the target table is native hbase table. +1722 ZZZZZ 99999 BEGINNER MINOR DBADMIN cannot set comment on native HBASE table. 1999 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU --- Last Catalog Manager error --- 2000 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Error messages for compiler main, IPC, and DEFAULTS table; assertions for optimizer. 2001 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Error or warning $0~Int0 occurred while opening or reading from DEFAULTS table $1~TableName. Using $2~String0 values. diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index fcce6c4e80..1041a234e7 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -339,11 +339,11 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, subID = commentOnNode->getColNum(); } - // cannot set comment on hbase native table - if (str_cmp(toUpper(catalogNamePart.data()), "HBASE", 5) == 0) - { - CmpCommon::diags()->clear(); - *CmpCommon::diags() << DgSqlCode(-1722); + // cannot set comment on HBASE native table + if (str_cmp(toUpper(catalogNamePart.data()), HBASE_SYSTEM_CATALOG, 5) == 0) + { + CmpCommon::diags()->clear(); + *CmpCommon::diags() << DgSqlCode(-1722); processReturn(); return; } From 645a4e31e36a3801590edb99a517e3dc56151aa0 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 31 May 2018 01:13:46 +0000 Subject: [PATCH 5/8] first judge the catalog is HBASE --- core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index 1041a234e7..4ba2130980 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -293,7 +293,18 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, Int32 objectOwnerID = ROOT_USER_ID; Int32 schemaOwnerID = ROOT_USER_ID; Int64 objectFlags = 0; + + + // cannot set comment on HBASE native table + if (str_cmp(toUpper(catalogNamePart.data()), HBASE_SYSTEM_CATALOG, strlen(HBASE_SYSTEM_CATALOG)) == 0) + { + CmpCommon::diags()->clear(); + *CmpCommon::diags() << DgSqlCode(-1722); + processReturn(); + return; + } + // Verify that the requester has COMMENT privilege. //get UID of object objUID = getObjectInfo(&cliInterface, catalogNamePart.data(), schemaNamePart.data(), objNamePart.data(), @@ -339,15 +350,6 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, subID = commentOnNode->getColNum(); } - // cannot set comment on HBASE native table - if (str_cmp(toUpper(catalogNamePart.data()), HBASE_SYSTEM_CATALOG, 5) == 0) - { - CmpCommon::diags()->clear(); - *CmpCommon::diags() << DgSqlCode(-1722); - processReturn(); - return; - } - /* Not using function updateTextTable(), because can not insert Chinese properly by function updateTextTable(). * For storing COMMENT in TEXT table is a temp solution, so updating TEXT table directly here. * Will change this implementation until next upgrade of MD. From ff8b68a4648ee3376788c1c7db7c2430bff7b208 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 31 May 2018 01:31:03 +0000 Subject: [PATCH 6/8] modify error words state --- core/sql/bin/SqlciErrors.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt index 9e13a7ebc0..a91e8bfaf5 100644 --- a/core/sql/bin/SqlciErrors.txt +++ b/core/sql/bin/SqlciErrors.txt @@ -515,7 +515,7 @@ 1718 ZZZZZ 99999 BEGINNER MINOR DBADMIN --- unused --- 1719 ZZZZZ 99999 BEGINNER MINOR DBADMIN Access Type '$0~string0' is not supported. 1720 ZZZZZ 99999 BEGINNER MINOR DBADMIN Isolation Level '$0~string0' is not supported. -1722 ZZZZZ 99999 BEGINNER MINOR DBADMIN cannot set comment on native HBASE table. +1722 ZZZZZ 99999 BEGINNER MINOR DBADMIN Cannot set comment on native HBASE table. 1999 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU --- Last Catalog Manager error --- 2000 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Error messages for compiler main, IPC, and DEFAULTS table; assertions for optimizer. 2001 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Error or warning $0~Int0 occurred while opening or reading from DEFAULTS table $1~TableName. Using $2~String0 values. From b29561af6dafdce1c69efcd9c34299df1c358a94 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 31 May 2018 01:39:50 +0000 Subject: [PATCH 7/8] adjust code format --- core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp index 4ba2130980..e0c7834e6c 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp @@ -294,7 +294,6 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, Int32 schemaOwnerID = ROOT_USER_ID; Int64 objectFlags = 0; - // cannot set comment on HBASE native table if (str_cmp(toUpper(catalogNamePart.data()), HBASE_SYSTEM_CATALOG, strlen(HBASE_SYSTEM_CATALOG)) == 0) { @@ -349,7 +348,6 @@ void CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn *commentOnNode, textType = COM_COLUMN_COMMENT_TEXT; subID = commentOnNode->getColNum(); } - /* Not using function updateTextTable(), because can not insert Chinese properly by function updateTextTable(). * For storing COMMENT in TEXT table is a temp solution, so updating TEXT table directly here. * Will change this implementation until next upgrade of MD. From a8abb389feeef66ec937994fc68e2ed8aa5a3c40 Mon Sep 17 00:00:00 2001 From: gdgy Date: Thu, 31 May 2018 02:01:45 +0000 Subject: [PATCH 8/8] modify error code enum_file --- core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h index b58189efa0..7442246f2b 100644 --- a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h +++ b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h @@ -434,7 +434,7 @@ enum CatErrorCode { CAT_FIRST_ERROR = 1000 // unused = 1599 // unused = 1600 // unused = 1601 - + , CAN_NOT_SET_COMMENT_ON_NATIVE_HBASE_TABLE = 1722 // Method validation failures , CAT_CLASS_NOT_FOUND = 11205 , CAT_CLASS_DEFINITION_NOT_FOUND = 11206