From 181c01b9591348dd7088ed7aad3db8bb74393593 Mon Sep 17 00:00:00 2001 From: LiBinfeng <46676950+LiBinfeng-01@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:48:42 +0800 Subject: [PATCH] [Fix](Planner) fix varchar does not show real length #25171 (#26850) --- .../main/java/org/apache/doris/catalog/ScalarType.java | 2 +- .../doris/nereids/parser/LogicalPlanBuilder.java | 4 ++++ .../org/apache/doris/nereids/types/VarcharType.java | 7 ++++++- .../org/apache/doris/catalog/CreateFunctionTest.java | 10 +++++----- .../doris/planner/MaterializedViewFunctionTest.java | 4 ++-- .../java/org/apache/doris/planner/QueryPlanTest.java | 4 ++-- .../rewrite/ExtractCommonFactorsRuleFunctionTest.java | 10 +++++----- .../test_create_table_with_bloom_filter.out | 4 ++-- regression-test/data/ddl_p0/test_create_table_like.out | 4 ++-- .../external_table_p0/jdbc/test_mysql_jdbc_catalog.out | 2 +- .../external_table_p0/jdbc/test_pg_jdbc_catalog.out | 2 +- .../data/mv_p0/varchar_length/varchar_length.out | 2 +- .../data/nereids_syntax_p0/rollup/hll/hll.out | 2 +- .../rollup/hll_with_light_sc/hll_with_light_sc.out | 2 +- .../data/rollup/test_materialized_view_hll.out | 2 +- .../test_materialized_view_hll_with_light_sc.out | 2 +- .../suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy | 1 + regression-test/suites/view_p0/view_p0.groovy | 2 +- 18 files changed, 38 insertions(+), 28 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java index 21ff42c635036e7..d2994393e38cc02 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java +++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java @@ -597,7 +597,7 @@ public String toString() { return "TIMEV2(" + scale + ")"; } else if (type == PrimitiveType.VARCHAR) { if (isWildcardVarchar()) { - return "VARCHAR(*)"; + return "VARCHAR(" + MAX_VARCHAR_LENGTH + ")"; } return "VARCHAR(" + len + ")"; } else if (type == PrimitiveType.STRING) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java index eb4e5b3c1a35487..03426ef4dc8725e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java @@ -247,6 +247,7 @@ import org.apache.doris.nereids.trees.plans.logical.LogicalUnion; import org.apache.doris.nereids.trees.plans.logical.UsingJoin; import org.apache.doris.nereids.types.DataType; +import org.apache.doris.nereids.types.VarcharType; import org.apache.doris.nereids.types.coercion.CharacterType; import org.apache.doris.nereids.util.ExpressionUtils; import org.apache.doris.policy.FilterType; @@ -1119,6 +1120,9 @@ public Expression visitCast(DorisParser.CastContext ctx) { Expression cast = ParserUtils.withOrigin(ctx, () -> new Cast(getExpression(ctx.expression()), dataType, true)); if (dataType.isStringLikeType() && ((CharacterType) dataType).getLen() >= 0) { + if (dataType.isVarcharType() && ((VarcharType) dataType).isWildcardVarchar()) { + return cast; + } List args = ImmutableList.of( cast, new TinyIntLiteral((byte) 1), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java index 0408dcf3ffa1036..b2bcc594ea12c4f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java @@ -29,6 +29,7 @@ public class VarcharType extends CharacterType { public static final VarcharType SYSTEM_DEFAULT = new VarcharType(-1); + public static final int MAX_VARCHAR_LENGTH = ScalarType.MAX_VARCHAR_LENGTH; public VarcharType(int len) { super(len); @@ -66,7 +67,7 @@ public DataType defaultConcreteType() { @Override public String toSql() { if (len == -1) { - return "VARCHAR(*)"; + return "VARCHAR(" + MAX_VARCHAR_LENGTH + ")"; } return "VARCHAR(" + len + ")"; } @@ -84,4 +85,8 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(super.hashCode(), len); } + + public boolean isWildcardVarchar() { + return len == -1 || len == MAX_VARCHAR_LENGTH; + } } diff --git a/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateFunctionTest.java b/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateFunctionTest.java index 41d991b41e178b9..7c9a45febaea3f1 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateFunctionTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateFunctionTest.java @@ -114,7 +114,7 @@ public void test() throws Exception { queryStr = "select db1.id_masking(k1) from db1.tbl1"; Assert.assertTrue( - dorisAssert.query(queryStr).explainQuery().contains("concat(left(CAST(CAST(k1 AS BIGINT) AS VARCHAR(*)), 3), '****', right(CAST(CAST(k1 AS BIGINT) AS VARCHAR(*)), 4))")); + dorisAssert.query(queryStr).explainQuery().contains("concat(left(CAST(CAST(k1 AS BIGINT) AS VARCHAR(65533)), 3), '****', right(CAST(CAST(k1 AS BIGINT) AS VARCHAR(65533)), 4))")); // create alias function with cast // cast any type to decimal with specific precision and scale @@ -149,7 +149,7 @@ public void test() throws Exception { // cast any type to varchar with fixed length createFuncStr = "create alias function db1.varchar(all) with parameter(text) as " - + "cast(text as varchar(*));"; + + "cast(text as varchar(65533));"; createFunctionStmt = (CreateFunctionStmt) UtFrameUtils.parseAndAnalyzeStmt(createFuncStr, ctx); Env.getCurrentEnv().createFunction(createFunctionStmt); @@ -172,7 +172,7 @@ public void test() throws Exception { Assert.assertTrue(constExprLists.get(0).get(0) instanceof StringLiteral); queryStr = "select db1.varchar(k1, 4) from db1.tbl1;"; - Assert.assertTrue(dorisAssert.query(queryStr).explainQuery().contains("CAST(`k1` AS VARCHAR(*))")); + Assert.assertTrue(dorisAssert.query(queryStr).explainQuery().contains("CAST(`k1` AS VARCHAR(65533))")); // cast any type to char with fixed length createFuncStr = "create alias function db1.to_char(all, int) with parameter(text, length) as " @@ -235,7 +235,7 @@ public void testCreateGlobalFunction() throws Exception { queryStr = "select id_masking(k1) from db2.tbl1"; Assert.assertTrue( - dorisAssert.query(queryStr).explainQuery().contains("concat(left(CAST(CAST(k1 AS BIGINT) AS VARCHAR(*)), 3), '****', right(CAST(CAST(k1 AS BIGINT) AS VARCHAR(*)), 4))")); + dorisAssert.query(queryStr).explainQuery().contains("concat(left(CAST(CAST(k1 AS BIGINT) AS VARCHAR(65533)), 3), '****', right(CAST(CAST(k1 AS BIGINT) AS VARCHAR(65533)), 4))")); // 4. create alias function with cast // cast any type to decimal with specific precision and scale @@ -270,7 +270,7 @@ public void testCreateGlobalFunction() throws Exception { testFunctionQuery(ctx, queryStr, true); queryStr = "select varchar(k1, 4) from db2.tbl1;"; - Assert.assertTrue(dorisAssert.query(queryStr).explainQuery().contains("CAST(`k1` AS VARCHAR(*))")); + Assert.assertTrue(dorisAssert.query(queryStr).explainQuery().contains("CAST(`k1` AS VARCHAR(65533))")); // 6. cast any type to char with fixed length createFuncStr = "create global alias function db2.to_char(all, int) with parameter(text, length) as " diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/MaterializedViewFunctionTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/MaterializedViewFunctionTest.java index 0556513dcf01eb5..8a7041af8e6f012 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/planner/MaterializedViewFunctionTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/planner/MaterializedViewFunctionTest.java @@ -773,7 +773,7 @@ public void testNDVToHll() throws Exception { String createUserTagMVSql = "create materialized view " + USER_TAG_MV_NAME + " as select user_id, " + "`" + FunctionSet.HLL_UNION + "`(" + FunctionSet.HLL_HASH + "(tag_id)) from " + USER_TAG_TABLE_NAME + " group by user_id;"; dorisAssert.withMaterializedView(createUserTagMVSql); - String query = "select ndv(tag_id) from " + USER_TAG_TABLE_NAME + ";"; + String query = "select /*+ SET_VAR(enable_fallback_to_original_planner=false) */ndv(tag_id) from " + USER_TAG_TABLE_NAME + ";"; dorisAssert.query(query).explainContains(USER_TAG_MV_NAME, "hll_union_agg"); } @@ -782,7 +782,7 @@ public void testApproxCountDistinctToHll() throws Exception { String createUserTagMVSql = "create materialized view " + USER_TAG_MV_NAME + " as select user_id, " + "`" + FunctionSet.HLL_UNION + "`(" + FunctionSet.HLL_HASH + "(tag_id)) from " + USER_TAG_TABLE_NAME + " group by user_id;"; dorisAssert.withMaterializedView(createUserTagMVSql); - String query = "select approx_count_distinct(tag_id) from " + USER_TAG_TABLE_NAME + ";"; + String query = "select /*+ SET_VAR(enable_fallback_to_original_planner=false) */ approx_count_distinct(tag_id) from " + USER_TAG_TABLE_NAME + ";"; dorisAssert.query(query).explainContains(USER_TAG_MV_NAME, "hll_union_agg"); } diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java index ade78962b1f1992..02caf943c491312 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java @@ -564,11 +564,11 @@ public void testTypeCast() throws Exception { // disable cast hll/bitmap to string assertSQLPlanOrErrorMsgContains( "select cast(id2 as varchar) from test.hll_table;", - "Invalid type cast of `id2` from HLL to VARCHAR(*)" + "Invalid type cast of `id2` from HLL to VARCHAR(65533)" ); assertSQLPlanOrErrorMsgContains( "select cast(id2 as varchar) from test.bitmap_table;", - "Invalid type cast of `id2` from BITMAP to VARCHAR(*)" + "Invalid type cast of `id2` from BITMAP to VARCHAR(65533)" ); // disable implicit cast hll/bitmap to string assertSQLPlanOrErrorMsgContains( diff --git a/fe/fe-core/src/test/java/org/apache/doris/rewrite/ExtractCommonFactorsRuleFunctionTest.java b/fe/fe-core/src/test/java/org/apache/doris/rewrite/ExtractCommonFactorsRuleFunctionTest.java index a49723c2298da8e..1fcffc4fa5cd6dd 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/rewrite/ExtractCommonFactorsRuleFunctionTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/rewrite/ExtractCommonFactorsRuleFunctionTest.java @@ -273,27 +273,27 @@ public void testRewriteLikePredicate() throws Exception { // tinyint String sql = "select /*+ SET_VAR(enable_nereids_planner=false) */ * from tb3 where k1 like '%4%';"; LOG.info("EXPLAIN:{}", dorisAssert.query(sql).explainQuery()); - dorisAssert.query(sql).explainContains("CAST(`k1` AS VARCHAR(*)) LIKE '%4%'"); + dorisAssert.query(sql).explainContains("CAST(`k1` AS VARCHAR(65533)) LIKE '%4%'"); // smallint sql = "select /*+ SET_VAR(enable_nereids_planner=false) */ * from tb3 where k2 like '%4%';"; LOG.info("EXPLAIN:{}", dorisAssert.query(sql).explainQuery()); - dorisAssert.query(sql).explainContains("CAST(`k2` AS VARCHAR(*)) LIKE '%4%'"); + dorisAssert.query(sql).explainContains("CAST(`k2` AS VARCHAR(65533)) LIKE '%4%'"); // int sql = "select /*+ SET_VAR(enable_nereids_planner=false) */ * from tb3 where k3 like '%4%';"; LOG.info("EXPLAIN:{}", dorisAssert.query(sql).explainQuery()); - dorisAssert.query(sql).explainContains("CAST(`k3` AS VARCHAR(*)) LIKE '%4%'"); + dorisAssert.query(sql).explainContains("CAST(`k3` AS VARCHAR(65533)) LIKE '%4%'"); // bigint sql = "select /*+ SET_VAR(enable_nereids_planner=false) */ * from tb3 where k4 like '%4%';"; LOG.info("EXPLAIN:{}", dorisAssert.query(sql).explainQuery()); - dorisAssert.query(sql).explainContains("CAST(`k4` AS VARCHAR(*)) LIKE '%4%'"); + dorisAssert.query(sql).explainContains("CAST(`k4` AS VARCHAR(65533)) LIKE '%4%'"); // largeint sql = "select /*+ SET_VAR(enable_nereids_planner=false) */ * from tb3 where k5 like '%4%';"; LOG.info("EXPLAIN:{}", dorisAssert.query(sql).explainQuery()); - dorisAssert.query(sql).explainContains("CAST(`k5` AS VARCHAR(*)) LIKE '%4%'"); + dorisAssert.query(sql).explainContains("CAST(`k5` AS VARCHAR(65533)) LIKE '%4%'"); } @Test diff --git a/regression-test/data/bloom_filter_p0/test_create_table_with_bloom_filter.out b/regression-test/data/bloom_filter_p0/test_create_table_with_bloom_filter.out index 679ace95a8f2c8b..0409ab7fb3c0d7b 100644 --- a/regression-test/data/bloom_filter_p0/test_create_table_with_bloom_filter.out +++ b/regression-test/data/bloom_filter_p0/test_create_table_with_bloom_filter.out @@ -10,7 +10,7 @@ bigint_key BIGINT No true \N BLOOM_FILTER char_50_key CHAR(50) No true \N BLOOM_FILTER character_key VARCHAR(500) No true \N BLOOM_FILTER char_key CHAR(1) No true \N BLOOM_FILTER -character_most_key VARCHAR(*) No true \N BLOOM_FILTER +character_most_key VARCHAR(65533) No true \N BLOOM_FILTER decimal_key DECIMAL(20, 6) No true \N BLOOM_FILTER decimal_most_key DECIMAL(27, 9) No true \N BLOOM_FILTER decimal32_key DECIMAL(5, 1) No true \N BLOOM_FILTER @@ -29,7 +29,7 @@ bigint_value BIGINT No false \N SUM char_50_value CHAR(50) No false \N REPLACE character_value VARCHAR(500) No false \N REPLACE char_value CHAR(1) No false \N REPLACE -character_most_value VARCHAR(*) No false \N REPLACE +character_most_value VARCHAR(65533) No false \N REPLACE decimal_value DECIMAL(20, 6) No false \N SUM decimal_most_value DECIMAL(27, 9) No false \N SUM decimal32_value DECIMAL(5, 1) No false \N SUM diff --git a/regression-test/data/ddl_p0/test_create_table_like.out b/regression-test/data/ddl_p0/test_create_table_like.out index b1bf31fcaa589da..cad1ae0a55374db 100644 --- a/regression-test/data/ddl_p0/test_create_table_like.out +++ b/regression-test/data/ddl_p0/test_create_table_like.out @@ -1,6 +1,6 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !desc_create_table -- -decimal_test DUP_KEYS name VARCHAR(*) VARCHAR(*) Yes true \N true +decimal_test DUP_KEYS name VARCHAR(65533) VARCHAR(65533) Yes true \N true id SMALLINT SMALLINT Yes false \N NONE true timestamp0 DECIMAL DECIMALV3(9, 0) Yes false \N NONE true timestamp1 DECIMAL DECIMALV3(10, 0) Yes false \N NONE true @@ -9,7 +9,7 @@ decimal_test DUP_KEYS name VARCHAR(*) VARCHAR(*) Yes true \N true timestamp4 DECIMAL(10, 1) DECIMALV3(10, 1) Yes false \N NONE true -- !desc_create_table_like -- -decimal_test_like DUP_KEYS name VARCHAR(*) VARCHAR(*) Yes true \N true +decimal_test_like DUP_KEYS name VARCHAR(65533) VARCHAR(65533) Yes true \N true id SMALLINT SMALLINT Yes false \N NONE true timestamp0 DECIMAL DECIMALV3(9, 0) Yes false \N NONE true timestamp1 DECIMAL DECIMALV3(10, 0) Yes false \N NONE true diff --git a/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out b/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out index 3645341c9959cf1..ab9a45e02fc5e38 100644 --- a/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out +++ b/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out @@ -305,7 +305,7 @@ binary TEXT Yes false \N NONE bit TEXT Yes false \N NONE blob TEXT Yes false \N NONE boolean TINYINT Yes false \N NONE -char VARCHAR(*) Yes false \N NONE +char VARCHAR(65533) Yes false \N NONE date DATE Yes false \N NONE datetime DATETIME Yes false \N NONE decimal DECIMAL(12, 4) Yes false \N NONE diff --git a/regression-test/data/external_table_p0/jdbc/test_pg_jdbc_catalog.out b/regression-test/data/external_table_p0/jdbc/test_pg_jdbc_catalog.out index b2a944cde6a160f..5d1a91b9ce333c9 100644 --- a/regression-test/data/external_table_p0/jdbc/test_pg_jdbc_catalog.out +++ b/regression-test/data/external_table_p0/jdbc/test_pg_jdbc_catalog.out @@ -2228,7 +2228,7 @@ bit_value BOOLEAN Yes false \N NONE bitn_value TEXT Yes false \N NONE bitnv_value TEXT Yes false \N NONE box_value TEXT Yes false \N NONE -char_value VARCHAR(*) Yes true \N +char_value VARCHAR(65533) Yes true \N cidr_value TEXT Yes false \N NONE circle_value TEXT Yes false \N NONE date_value DATE Yes false \N NONE diff --git a/regression-test/data/mv_p0/varchar_length/varchar_length.out b/regression-test/data/mv_p0/varchar_length/varchar_length.out index b9cdce0431714d3..d944f69b4a3c1a2 100644 --- a/regression-test/data/mv_p0/varchar_length/varchar_length.out +++ b/regression-test/data/mv_p0/varchar_length/varchar_length.out @@ -4,5 +4,5 @@ test1 UNIQUE_KEYS vid VARCHAR(1) VARCHAR(1) No true \N true report_time INT INT No true \N true mv_test UNIQUE_KEYS mv_report_time INT INT No true \N true `report_time` - mv_vid VARCHAR(*) VARCHAR(*) No true \N REPLACE true `vid` + mv_vid VARCHAR(65533) VARCHAR(65533) No true \N REPLACE true `vid` diff --git a/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out b/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out index 4278337ac9e2d21..28ee1fc66c35b99 100644 --- a/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out +++ b/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out @@ -10,5 +10,5 @@ test_materialized_view_hll1 DUP_KEYS record_id INT INT Yes true \N true sale_amt BIGINT BIGINT Yes false \N NONE true amt_count AGG_KEYS mv_store_id INT INT Yes true \N true `store_id` - mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(*))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(*))) + mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) diff --git a/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out b/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out index 2b42ca08b4d4374..4018c44c9389c8e 100644 --- a/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out +++ b/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out @@ -7,7 +7,7 @@ test_materialized_view_hll_with_light_sc1 DUP_KEYS record_id INT INT Yes true \N sale_amt BIGINT BIGINT Yes false \N NONE true amt_count1 AGG_KEYS mv_store_id INT INT Yes true \N true `store_id` - mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(*))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(*))) + mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) -- !sql -- 1 1 diff --git a/regression-test/data/rollup/test_materialized_view_hll.out b/regression-test/data/rollup/test_materialized_view_hll.out index a2703e797c61add..9721b8612c6d768 100644 --- a/regression-test/data/rollup/test_materialized_view_hll.out +++ b/regression-test/data/rollup/test_materialized_view_hll.out @@ -7,7 +7,7 @@ test_materialized_view_hll DUP_KEYS record_id INT INT Yes true \N true sale_amt BIGINT BIGINT Yes false \N NONE true amt_count AGG_KEYS mv_store_id INT INT Yes true \N true `store_id` - mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(*))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(*))) + mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) -- !sql -- 1 1 diff --git a/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out b/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out index ef1f1aa825f8be7..bdc8e1cd81f6295 100644 --- a/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out +++ b/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out @@ -7,7 +7,7 @@ test_materialized_view_hll_with_light_sc DUP_KEYS record_id INT INT Yes true \N sale_amt BIGINT BIGINT Yes false \N NONE true amt_count1 AGG_KEYS mv_store_id INT INT Yes true \N true `store_id` - mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(*))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(*))) + mva_HLL_UNION__hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) HLL HLL No false \N HLL_UNION true hll_hash(CAST(`sale_amt` AS VARCHAR(65533))) -- !sql -- 1 1 diff --git a/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy b/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy index a4bd22bd4939477..cdd2978f071352c 100644 --- a/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy +++ b/regression-test/suites/mv_p0/ut/testNDVToHll/testNDVToHll.groovy @@ -19,6 +19,7 @@ import org.codehaus.groovy.runtime.IOGroovyMethods suite ("testNDVToHll") { sql """set enable_nereids_planner=true;""" + sql """set enable_fallback_to_original_planner=false;""" sql """ DROP TABLE IF EXISTS user_tags; """ sql """ create table user_tags ( diff --git a/regression-test/suites/view_p0/view_p0.groovy b/regression-test/suites/view_p0/view_p0.groovy index 986fa6688c63362..a1df7e07cf4d209 100644 --- a/regression-test/suites/view_p0/view_p0.groovy +++ b/regression-test/suites/view_p0/view_p0.groovy @@ -37,7 +37,7 @@ suite("view_p0") { """ qt_sql "select * from test_varchar_view;" - qt_sql "select cast( id as varchar(*)) from test_view_table;" + qt_sql "select cast( id as varchar(65533)) from test_view_table;" // array view sql """DROP TABLE IF EXISTS test_array_tbl_1"""