Skip to content

Commit

Permalink
[Enhancement] Make error msg for GIN more accurate (StarRocks#44503)
Browse files Browse the repository at this point in the history
Signed-off-by: srlch <[email protected]>
  • Loading branch information
srlch authored Apr 22, 2024
1 parent 45207d8 commit 012acc9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void checkInvertedIndexValid(Column column, Map<String, String> pr
throw new SemanticException("The inverted index can only be build on DUPLICATE table.");
}
if (!validGinColumnType(column)) {
throw new SemanticException("The inverted index can only be build on column with type of scalar type.");
throw new SemanticException("The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type.");
}

String impLibKey = IMP_LIB.name().toLowerCase(Locale.ROOT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testCheckInvertedIndex() {
Assertions.assertThrows(
SemanticException.class,
() -> InvertedIndexUtil.checkInvertedIndexValid(c1, null, KeysType.DUP_KEYS),
"The inverted index can only be build on column with type of scalar type.");
"The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type.");

Column c2 = new Column("f2", Type.STRING, true);
Assertions.assertThrows(
Expand Down
8 changes: 4 additions & 4 deletions test/sql/test_inverted_index/R/test_inverted_index
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ PROPERTIES (
"compression" = "LZ4"
);
-- result:
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of scalar type..')
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type..')
-- !result
CREATE TABLE `t_gin_index_type_5` (
`id1` bigint(20) NOT NULL COMMENT "",
Expand All @@ -790,7 +790,7 @@ PROPERTIES (
"compression" = "LZ4"
);
-- result:
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of scalar type..')
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type..')
-- !result
CREATE TABLE `t_gin_index_type_6` (
`id1` bigint(20) NOT NULL COMMENT "",
Expand All @@ -806,7 +806,7 @@ PROPERTIES (
"compression" = "LZ4"
);
-- result:
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of scalar type..')
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type..')
-- !result
CREATE TABLE `t_gin_index_type_7` (
`id1` bigint(20) NOT NULL COMMENT "",
Expand All @@ -822,7 +822,7 @@ PROPERTIES (
"compression" = "LZ4"
);
-- result:
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of scalar type..')
E: (1064, 'Getting analyzing error. Detail message: The inverted index can only be build on column with type of CHAR/STRING/VARCHAR type..')
-- !result
-- name: test_clone_for_gin
set low_cardinality_optimize_v2 = false;
Expand Down

0 comments on commit 012acc9

Please sign in to comment.