diff --git a/be/src/exec/tablet_info.cpp b/be/src/exec/tablet_info.cpp index 2bec0113ace22e..af065f332a00e4 100644 --- a/be/src/exec/tablet_info.cpp +++ b/be/src/exec/tablet_info.cpp @@ -75,8 +75,6 @@ bool VOlapTablePartKeyComparator::operator()(const BlockRowWithIndicator lhs, bool l_use_new = std::get<2>(lhs); bool r_use_new = std::get<2>(rhs); - VLOG_TRACE << '\n' << l_block->dump_data() << '\n' << r_block->dump_data(); - if (l_row == -1) { return false; } else if (r_row == -1) { @@ -95,6 +93,7 @@ bool VOlapTablePartKeyComparator::operator()(const BlockRowWithIndicator lhs, DCHECK(_slot_locs.size() == _param_locs.size()) << _slot_locs.size() << ' ' << _param_locs.size(); + //TODO: use template to accelerate this for older compiler. const std::vector* l_index = l_use_new ? &_param_locs : &_slot_locs; const std::vector* r_index = r_use_new ? &_param_locs : &_slot_locs; diff --git a/be/src/vec/sink/vrow_distribution.cpp b/be/src/vec/sink/vrow_distribution.cpp index 052194a15a0e01..9ddee3b8f0b57f 100644 --- a/be/src/vec/sink/vrow_distribution.cpp +++ b/be/src/vec/sink/vrow_distribution.cpp @@ -29,7 +29,6 @@ #include "runtime/runtime_state.h" #include "util/doris_metrics.h" #include "util/thrift_rpc_helper.h" -#include "vec/columns/column.h" #include "vec/columns/column_const.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_vector.h" @@ -332,10 +331,7 @@ Status VRowDistribution::generate_rows_distribution( for (int i = 0; i < func_size; ++i) { int result_idx = -1; RETURN_IF_ERROR(part_funcs[i]->execute(part_ctxs[i].get(), block.get(), &result_idx)); - - VLOG_DEBUG << "Partition-calculated block:" << block->dump_data(0, 1); - DCHECK(result_idx != -1); - + VLOG_DEBUG << "Partition-calculated block:" << block->dump_data(); partition_cols_idx.push_back(result_idx); } diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup index ee0f81951477dc..9795118139258d 100644 --- a/fe/fe-core/src/main/cup/sql_parser.cup +++ b/fe/fe-core/src/main/cup/sql_parser.cup @@ -3166,15 +3166,15 @@ opt_partition ::= RESULT = new ListPartitionDesc(columns, list); :} /* expr range partition */ - | KW_AUTO KW_PARTITION KW_BY KW_RANGE LPAREN function_call_expr:fnExpr RPAREN + | KW_AUTO KW_PARTITION KW_BY KW_RANGE function_call_expr:fnExpr LPAREN opt_all_partition_desc_list:list RPAREN {: ArrayList exprs = new ArrayList(); exprs.add(fnExpr); RESULT = RangePartitionDesc.createRangePartitionDesc(exprs, list); :} - | KW_AUTO KW_PARTITION KW_BY KW_RANGE LPAREN function_name:functionName LPAREN expr_list:l COMMA - KW_INTERVAL expr:v ident:u RPAREN RPAREN LPAREN opt_all_partition_desc_list:list RPAREN + | KW_AUTO KW_PARTITION KW_BY KW_RANGE function_name:functionName LPAREN expr_list:l COMMA + KW_INTERVAL expr:v ident:u RPAREN LPAREN opt_all_partition_desc_list:list RPAREN {: Expr fnExpr = FunctionCallExpr.functionWithIntervalConvert(functionName.getFunction().toLowerCase(), l.get(0), v, u); ArrayList exprs = new ArrayList(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ListPartitionDesc.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ListPartitionDesc.java index 90f9c054624f0d..bf94b227d83a8e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ListPartitionDesc.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ListPartitionDesc.java @@ -56,7 +56,7 @@ public ListPartitionDesc(ArrayList exprs, List partitionColNames, public static ListPartitionDesc createListPartitionDesc(ArrayList exprs, List allPartitionDescs) throws AnalysisException { - List colNames = getColNamesFromExpr(exprs, true, true); + List colNames = getColNamesFromExpr(exprs, true); return new ListPartitionDesc(exprs, colNames, allPartitionDescs); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java index eb1bc7af747f9c..39569d0b3e5263 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java @@ -102,9 +102,7 @@ public List getPartitionColNames() { // 1. partition by list (column) : now support one slotRef // 2. partition by range(column/function(column)) : support slotRef and some // special function eg: date_trunc, date_floor/ceil - // not only for auto partition. maybe we should check for project partitiion also - public static List getColNamesFromExpr(ArrayList exprs, boolean isListPartition, - boolean isAutoPartition) + public static List getColNamesFromExpr(ArrayList exprs, boolean isListPartition) throws AnalysisException { List colNames = new ArrayList<>(); for (Expr expr : exprs) { @@ -130,7 +128,7 @@ public static List getColNamesFromExpr(ArrayList exprs, boolean is + expr.toSql()); } } else if (expr instanceof SlotRef) { - if (isAutoPartition && !colNames.isEmpty() && !isListPartition) { + if (!colNames.isEmpty() && !isListPartition) { throw new AnalysisException( "auto create partition only support one slotRef in expr of RANGE partition. " + expr.toSql()); @@ -210,9 +208,6 @@ public void analyze(List columnDefs, Map otherPropert throw new AnalysisException( "The partition column must be NOT NULL with allow_partition_column_nullable OFF"); } - if (this instanceof RangePartitionDesc && isAutoCreatePartitions && columnDef.isAllowNull()) { - throw new AnalysisException("AUTO RANGE PARTITION doesn't support NULL column"); - } if (this instanceof RangePartitionDesc && partitionExprs != null) { if (partitionExprs.get(0) instanceof FunctionCallExpr) { if (!columnDef.getType().isDateType()) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/RangePartitionDesc.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/RangePartitionDesc.java index 176322766bfca4..57d696c37a5601 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/RangePartitionDesc.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/RangePartitionDesc.java @@ -51,10 +51,9 @@ public RangePartitionDesc(ArrayList exprs, List partitionColNames, this.isAutoCreatePartitions = true; } - // for parse auto partition public static RangePartitionDesc createRangePartitionDesc(ArrayList exprs, List allPartitionDescs) throws AnalysisException { - List colNames = getColNamesFromExpr(exprs, false, true); + List colNames = getColNamesFromExpr(exprs, false); return new RangePartitionDesc(exprs, colNames, allPartitionDescs); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java index 2bd2f21478bcd5..4e306a246c7a38 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java @@ -2085,7 +2085,8 @@ private void createOlapTable(Database db, CreateTableStmt stmt) throws UserExcep PartitionInfo partitionInfo = null; Map partitionNameToId = Maps.newHashMap(); if (partitionDesc != null) { - for (SinglePartitionDesc desc : partitionDesc.getSinglePartitionDescs()) { + PartitionDesc partDesc = partitionDesc; + for (SinglePartitionDesc desc : partDesc.getSinglePartitionDescs()) { long partitionId = idGeneratorBuffer.getNextId(); partitionNameToId.put(desc.getPartitionName(), partitionId); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/PartitionTableInfo.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/PartitionTableInfo.java index c16d5a57024a52..33223a39eccf3f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/PartitionTableInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/PartitionTableInfo.java @@ -143,9 +143,6 @@ private void validatePartitionColumn(ColumnDefinition column, ConnectContext ctx throw new AnalysisException( "The partition column must be NOT NULL with allow_partition_column_nullable OFF"); } - if (isAutoPartition && partitionType.equalsIgnoreCase(PartitionType.RANGE.name()) && column.isNullable()) { - throw new AnalysisException("AUTO RANGE PARTITION doesn't support NULL column"); - } } /** @@ -241,17 +238,19 @@ public PartitionDesc convertToPartitionDesc(boolean isExternal) { } try { - ArrayList exprs = convertToLegacyAutoPartitionExprs(partitionList); - // here we have already extracted partitionColumns if (partitionType.equals(PartitionType.RANGE.name())) { if (isAutoPartition) { - partitionDesc = new RangePartitionDesc(exprs, partitionColumns, partitionDescs); + partitionDesc = new RangePartitionDesc( + convertToLegacyAutoPartitionExprs(partitionList), + partitionColumns, partitionDescs); } else { partitionDesc = new RangePartitionDesc(partitionColumns, partitionDescs); } } else { if (isAutoPartition) { - partitionDesc = new ListPartitionDesc(exprs, partitionColumns, partitionDescs); + partitionDesc = new ListPartitionDesc( + convertToLegacyAutoPartitionExprs(partitionList), + partitionColumns, partitionDescs); } else { partitionDesc = new ListPartitionDesc(partitionColumns, partitionDescs); } @@ -290,20 +289,4 @@ private static List convertToLegacyArguments(List children) { } }).collect(Collectors.toList()); } - - /** - * Get column names and put in partitionColumns - */ - public void extractPartitionColumns() throws AnalysisException { - if (partitionList == null) { - return; - } - ArrayList exprs = convertToLegacyAutoPartitionExprs(partitionList); - try { - partitionColumns = PartitionDesc.getColNamesFromExpr(exprs, - partitionType.equalsIgnoreCase(PartitionType.LIST.name()), isAutoPartition); - } catch (Exception e) { - throw new AnalysisException(e.getMessage(), e.getCause()); - } - } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java index 33ec21ed66a6f5..b67d1db27c3373 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java @@ -90,7 +90,7 @@ public class CreateTableInfo { private String clusterName = null; private List clusterKeysColumnNames = null; private List clusterKeysColumnIds = null; - private PartitionTableInfo partitionTableInfo; // get when validate + private PartitionTableInfo partitionTableInfo; /** * constructor for create table @@ -427,7 +427,6 @@ public void validate(ConnectContext ctx) { }); // validate partition - partitionTableInfo.extractPartitionColumns(); partitionTableInfo.validatePartitionInfo(columnMap, properties, ctx, isEnableMergeOnWrite, isExternal); // validate distribution descriptor diff --git a/fe/fe-core/src/test/java/org/apache/doris/analysis/RangePartitionPruneTest.java b/fe/fe-core/src/test/java/org/apache/doris/analysis/RangePartitionPruneTest.java index 4cd7f8d204937d..bdeda2489084ce 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/analysis/RangePartitionPruneTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/analysis/RangePartitionPruneTest.java @@ -108,7 +108,7 @@ protected void runBeforeAll() throws Exception { + " event_day DATETIME NOT NULL\n" + ")\n" + "DUPLICATE KEY(event_day)\n" - + "AUTO PARTITION BY range (date_trunc(event_day, \"day\")) (\n" + + "AUTO PARTITION BY range date_trunc(event_day, \"day\") (\n" + "\tPARTITION `p20230807` values [(20230807 ), (20230808 )),\n" + "\tPARTITION `p20020106` values [(20020106 ), (20020107 ))\n" + ")\n" diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java index 51fed43770806c..8416bd396b04fc 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java @@ -194,7 +194,7 @@ protected void runBeforeAll() throws Exception { + " ) ENGINE=OLAP\n" + " DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey )\n" + " COMMENT 'OLAP'\n" - + " AUTO PARTITION BY range (date_trunc(`l_shipdate`, 'day')) ()\n" + + " AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') ()\n" + " DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 3\n" + " PROPERTIES (\n" + " \"replication_num\" = \"1\"\n" diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/CreateTableCommandTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/CreateTableCommandTest.java index 8276f7fabb6996..b90d8ded6fd861 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/CreateTableCommandTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/CreateTableCommandTest.java @@ -724,7 +724,7 @@ public void testCreateTablePartitionForExternalCatalog() { + "distributed by hash (id) properties (\"a\"=\"b\")"); } catch (Exception e) { Assertions.assertEquals( - "errCode = 2, detailMessage = auto create partition only support slotRef in list partitions. func1(`id2`, '1')", + "internal catalog does not support functions in 'LIST' partition", e.getMessage()); } diff --git a/fe/fe-core/src/test/java/org/apache/doris/service/FrontendServiceImplTest.java b/fe/fe-core/src/test/java/org/apache/doris/service/FrontendServiceImplTest.java index 1306a2bff88a3b..318926167c95c9 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/service/FrontendServiceImplTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/service/FrontendServiceImplTest.java @@ -99,7 +99,7 @@ public void testCreatePartitionRange() throws Exception { + " city_code VARCHAR(100)\n" + ")\n" + "DUPLICATE KEY(event_day, site_id, city_code)\n" - + "AUTO PARTITION BY range (date_trunc( event_day,'day')) (\n" + + "AUTO PARTITION BY range date_trunc( event_day,'day') (\n" + "\n" + ")\n" + "DISTRIBUTED BY HASH(event_day, site_id) BUCKETS 2\n" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_1.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_1.groovy index 50689b2733d385..3a60f5e90e4159 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_1.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_1.groovy @@ -43,7 +43,7 @@ suite("partition_mv_rewrite_dimension_1") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -73,7 +73,7 @@ suite("partition_mv_rewrite_dimension_1") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_3.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_3.groovy index 047779caa450f2..3a9d25b3f401a9 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_3.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_3.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_3") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_3") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_4.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_4.groovy index 85679ac99acd78..180cf9b9095565 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_4.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_4.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_4") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_4") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_5.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_5.groovy index 3efd9da11ea190..6e6bb4bccdf503 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_5.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_5.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_5") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_5") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy index efa219bf7dcbab..59977c705033bf 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_6") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_6") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy index 496345eaa43f31..82f3c0b0de8719 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_inner_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_inner_join.groovy index 58d550b45bab62..74046d9b3e4504 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_inner_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_inner_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_2") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_2") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_anti_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_anti_join.groovy index 8eed21914af56a..13c6bc9c82c319 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_anti_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_anti_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_left_anti_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_left_anti_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_join.groovy index 89a867013da47f..cc3591c6f44417 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_1") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_1") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_semi_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_semi_join.groovy index 9b0abb43554bf1..e018aab7d799b5 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_semi_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_left_semi_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_left_semi_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_left_semi_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_anti_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_anti_join.groovy index 41701d9cc8c98a..b6b576b1926ac9 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_anti_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_anti_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_right_anti_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_right_anti_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_join.groovy index fb200034a995f1..996ca5ae78b24f 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_right_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_right_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_semi_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_semi_join.groovy index fa2e0ace0f0a84..39b9497610693c 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_semi_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_right_semi_join.groovy @@ -44,7 +44,7 @@ suite("partition_mv_rewrite_dimension_2_right_semi_join") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -74,7 +74,7 @@ suite("partition_mv_rewrite_dimension_2_right_semi_join") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension_2_join_agg/dimension_2_join_agg.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension_2_join_agg/dimension_2_join_agg.groovy index 3e083af5ab2dc9..055861fd344b7d 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension_2_join_agg/dimension_2_join_agg.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension_2_join_agg/dimension_2_join_agg.groovy @@ -43,7 +43,7 @@ suite("dimension_2_join_agg_replenish") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -73,7 +73,7 @@ suite("dimension_2_join_agg_replenish") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension_equal/filter_equal_or_notequal.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension_equal/filter_equal_or_notequal.groovy index b8fc1a347cb3f0..1800a91b84b59d 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension_equal/filter_equal_or_notequal.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension_equal/filter_equal_or_notequal.groovy @@ -41,7 +41,7 @@ suite("filter_equal_or_notequal_case") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -71,7 +71,7 @@ suite("filter_equal_or_notequal_case") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/cross_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/cross_join_range_date_increment_create.groovy index 1cd76faef729a1..56d8069b124d29 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/cross_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/cross_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("cross_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("cross_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/full_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/full_join_range_date_increment_create.groovy index 26a2c0bb567e08..7c9f6e4d58b3db 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/full_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/full_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("full_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("full_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/inner_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/inner_join_range_date_increment_create.groovy index c1de9c7f09e00e..31b4d8ba9b3729 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/inner_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/inner_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("inner_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("inner_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_anti_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_anti_join_range_date_increment_create.groovy index 436b574e7b93d0..0dbbe3abb57c96 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_anti_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_anti_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("left_anti_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("left_anti_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_join_range_date_increment_create.groovy index a42a2e9637219c..a8eacdc4a695d4 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("left_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("left_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_semi_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_semi_join_range_date_increment_create.groovy index 01dc2eda881f2f..a78ad12b3fff2e 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/left_semi_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/left_semi_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("left_semi_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("left_semi_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_anti_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_anti_join_range_date_increment_create.groovy index c82579adbfcfa5..7e9e00a6cdc57c 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_anti_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_anti_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("right_anti_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("right_anti_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_join_range_date_increment_create.groovy index 54f0d446d03399..9c00f72a39df12 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("right_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("right_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_semi_join_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_semi_join_range_date_increment_create.groovy index 77d09fadbe91a0..cfc176f54711d9 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/right_semi_join_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/right_semi_join_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("right_semi_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("right_semi_join_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/increment_create/self_conn_range_date_increment_create.groovy b/regression-test/suites/nereids_rules_p0/mv/increment_create/self_conn_range_date_increment_create.groovy index 8537198f54adf0..23ca627e7ed5c6 100644 --- a/regression-test/suites/nereids_rules_p0/mv/increment_create/self_conn_range_date_increment_create.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/increment_create/self_conn_range_date_increment_create.groovy @@ -40,7 +40,7 @@ suite("self_conn_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -70,7 +70,7 @@ suite("self_conn_range_date_increment_create") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/nereids_rules_p0/mv/negative/negative_test.groovy b/regression-test/suites/nereids_rules_p0/mv/negative/negative_test.groovy index d9c61b989e147c..672adc769fc428 100644 --- a/regression-test/suites/nereids_rules_p0/mv/negative/negative_test.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/negative/negative_test.groovy @@ -43,7 +43,7 @@ suite("negative_partition_mv_rewrite") { ) ENGINE=OLAP DUPLICATE KEY(`o_orderkey`, `o_custkey`) COMMENT 'OLAP' - auto partition by range (date_trunc(`o_orderdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`o_orderdate`, 'day') () DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" @@ -73,7 +73,7 @@ suite("negative_partition_mv_rewrite") { ) ENGINE=OLAP DUPLICATE KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey ) COMMENT 'OLAP' - auto partition by range (date_trunc(`l_shipdate`, 'day')) () + AUTO PARTITION BY range date_trunc(`l_shipdate`, 'day') () DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy index 41a243501fb758..951f656f55fdc0 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy @@ -116,7 +116,7 @@ suite("test_auto_partition_behavior") { ) ENGINE=OLAP AGGREGATE KEY(`k0`) COMMENT 'OLAP' - auto partition by range (date_trunc(`k0`, 'year')) + AUTO PARTITION BY RANGE date_trunc(`k0`, 'year') ( ) DISTRIBUTED BY HASH(`k0`) BUCKETS 10 @@ -257,7 +257,7 @@ suite("test_auto_partition_behavior") { k1 DATETIME NOT NULL, col1 int ) - auto partition by range (date_trunc(`k1`, 'year')) () + auto PARTITION BY RANGE date_trunc(`k1`, 'year') () DISTRIBUTED BY HASH(k1) PROPERTIES ( @@ -282,7 +282,7 @@ suite("test_auto_partition_behavior") { k1 DATETIME NOT NULL, col1 int ) - auto partition by range (date_trunc(`k1`, 'year')) () + auto PARTITION BY RANGE date_trunc(`k1`, 'year') () DISTRIBUTED BY HASH(k1) PROPERTIES ( @@ -327,7 +327,7 @@ suite("test_auto_partition_behavior") { k0 datetime(6) NOT null, k1 datetime(6) NOT null ) - auto partition by range (date_trunc(k0, k1, 'hour')) + auto partition by range date_trunc(k0, k1, 'hour') ( ) DISTRIBUTED BY HASH(`k0`) BUCKETS 2 @@ -350,7 +350,7 @@ suite("test_auto_partition_behavior") { DISTRIBUTED BY HASH(`k0`) BUCKETS 2 properties("replication_num" = "1"); """ - exception "auto create partition only support one slotRef in function expr" + exception "partition expr date_trunc is illegal!" } // test displacement of partition function test{ diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_load.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_load.groovy index 6f20a6c33e7a06..81b440e0f80f51 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_load.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_load.groovy @@ -26,7 +26,7 @@ suite("test_auto_partition_load") { ) ENGINE=OLAP DUPLICATE KEY(`k1`) COMMENT 'OLAP' - auto partition by range (date_trunc(`k2`, 'year')) + AUTO PARTITION BY RANGE date_trunc(`k2`, 'year') ( ) DISTRIBUTED BY HASH(`k1`) BUCKETS 16 diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy index cf11ceacba9ccf..33574990bc0199 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy @@ -24,7 +24,7 @@ suite("test_auto_range_partition") { ) ENGINE=OLAP DUPLICATE KEY(`TIME_STAMP`) COMMENT 'OLAP' - auto partition by range (date_trunc(`TIME_STAMP`, 'day')) + AUTO PARTITION BY RANGE date_trunc(`TIME_STAMP`, 'day') ( ) DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10 @@ -39,14 +39,15 @@ suite("test_auto_range_partition") { qt_select01 """ select * from ${tblName1} WHERE TIME_STAMP = '2022-12-15' order by TIME_STAMP """ qt_select02 """ select * from ${tblName1} WHERE TIME_STAMP > '2022-12-15' order by TIME_STAMP """ - sql "drop table if exists range_table_date" + def tblDate = "range_table_date" + sql "drop table if exists ${tblDate}" sql """ - CREATE TABLE `range_table_date` ( + CREATE TABLE `${tblDate}` ( `TIME_STAMP` datev2 NOT NULL COMMENT '采集日期' ) ENGINE=OLAP DUPLICATE KEY(`TIME_STAMP`) COMMENT 'OLAP' - auto partition by range (date_trunc(`TIME_STAMP`, 'month')) + AUTO PARTITION BY RANGE date_trunc(`TIME_STAMP`, 'month') ( ) DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10 @@ -54,12 +55,12 @@ suite("test_auto_range_partition") { "replication_allocation" = "tag.location.default: 1" ); """ - sql """ insert into range_table_date values ('2022-11-14'), ('2022-12-15'), ('2022-12-16'), ('2022-12-17'), ('2022-05-18'), ('2022-12-19'), ('2022-12-20') """ - sql """ insert into range_table_date values ('2122-12-14'), ('2122-12-15'), ('2122-12-16'), ('2122-12-17'), ('2122-09-18'), ('2122-12-19'), ('2122-12-20') """ + sql """ insert into ${tblDate} values ('2022-11-14'), ('2022-12-15'), ('2022-12-16'), ('2022-12-17'), ('2022-05-18'), ('2022-12-19'), ('2022-12-20') """ + sql """ insert into ${tblDate} values ('2122-12-14'), ('2122-12-15'), ('2122-12-16'), ('2122-12-17'), ('2122-09-18'), ('2122-12-19'), ('2122-12-20') """ - qt_date1 """ select * from range_table_date order by TIME_STAMP """ - qt_date2 """ select * from range_table_date WHERE TIME_STAMP = '2022-12-15' order by TIME_STAMP """ - qt_date3 """ select * from range_table_date WHERE TIME_STAMP > '2022-12-15' order by TIME_STAMP """ + qt_date1 """ select * from ${tblDate} order by TIME_STAMP """ + qt_date2 """ select * from ${tblDate} WHERE TIME_STAMP = '2022-12-15' order by TIME_STAMP """ + qt_date3 """ select * from ${tblDate} WHERE TIME_STAMP > '2022-12-15' order by TIME_STAMP """ def tblName2 = "range_table2" sql "drop table if exists ${tblName2}" @@ -69,7 +70,7 @@ suite("test_auto_range_partition") { ) ENGINE=OLAP DUPLICATE KEY(`TIME_STAMP`) COMMENT 'OLAP' - auto partition by range (date_trunc(`TIME_STAMP`, 'day')) + AUTO PARTITION BY RANGE date_trunc(`TIME_STAMP`, 'day') ( ) DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10 diff --git a/regression-test/suites/partition_p1/auto_partition/ddl/concurrent.sql b/regression-test/suites/partition_p1/auto_partition/ddl/concurrent.sql index 1e2ebf7b597162..cb7694654e1f6b 100644 --- a/regression-test/suites/partition_p1/auto_partition/ddl/concurrent.sql +++ b/regression-test/suites/partition_p1/auto_partition/ddl/concurrent.sql @@ -10,7 +10,7 @@ CREATE TABLE `concurrent`( `col9` decimal(9, 3), `col10` char(128) ) duplicate KEY(`col1`) -auto partition by range (date_trunc(`col1`, 'day')) +AUTO PARTITION BY range date_trunc(`col1`, 'day') ( ) DISTRIBUTED BY HASH(`col1`) BUCKETS 10 diff --git a/regression-test/suites/partition_p1/auto_partition/ddl/stress_destination.sql b/regression-test/suites/partition_p1/auto_partition/ddl/stress_destination.sql index 275d65f79cb697..f1dbb790987a8d 100644 --- a/regression-test/suites/partition_p1/auto_partition/ddl/stress_destination.sql +++ b/regression-test/suites/partition_p1/auto_partition/ddl/stress_destination.sql @@ -13,7 +13,7 @@ CREATE TABLE `stress_destination` ( `order_num` INT NULL ) ENGINE=OLAP UNIQUE KEY(`create_date`, `parent_org_id`, `org_id`) -auto partition by range (date_trunc(`create_date`,'day')) () +AUTO PARTITION BY RANGE date_trunc(`create_date`,'day')() DISTRIBUTED BY HASH(`create_date`, `org_id`) BUCKETS AUTO PROPERTIES ( "replication_allocation" = "tag.location.default: 1" diff --git a/regression-test/suites/partition_p2/auto_partition/ddl/small_data_high_concurrrent_load.sql b/regression-test/suites/partition_p2/auto_partition/ddl/small_data_high_concurrrent_load.sql index c3f7895dfa1738..a85d7ce6c68f7b 100644 --- a/regression-test/suites/partition_p2/auto_partition/ddl/small_data_high_concurrrent_load.sql +++ b/regression-test/suites/partition_p2/auto_partition/ddl/small_data_high_concurrrent_load.sql @@ -4,7 +4,7 @@ CREATE TABLE `small_data_high_concurrent_load_range`( `col3` decimal(9, 3), `col4` date ) duplicate KEY(`col1`) -auto partition by range (date_trunc(`col1`, 'day')) +AUTO PARTITION BY range date_trunc(`col1`, 'day') ( ) DISTRIBUTED BY HASH(`col1`) BUCKETS 10 diff --git a/regression-test/suites/partition_p2/auto_partition/ddl/stream_load_range_test_table.sql b/regression-test/suites/partition_p2/auto_partition/ddl/stream_load_range_test_table.sql index 481006919458f6..f64b1a65a50324 100644 --- a/regression-test/suites/partition_p2/auto_partition/ddl/stream_load_range_test_table.sql +++ b/regression-test/suites/partition_p2/auto_partition/ddl/stream_load_range_test_table.sql @@ -40,7 +40,7 @@ CREATE TABLE `stream_load_range_test_table`( `col39` decimal(9, 3), `col40` char(128) ) UNIQUE KEY(`col1`) -auto partition by range (date_trunc(`col1`, 'day')) +AUTO PARTITION BY range date_trunc(`col1`, 'day') ( ) DISTRIBUTED BY HASH(`col1`) BUCKETS 10