diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java index 8f0ce24f13d4af4..1da2cc2fd8a51d1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java +++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java @@ -1381,6 +1381,11 @@ private void createJob(String rawSql, long dbId, OlapTable olapTable, Map oriRowStoreColumns = olapTable.getTableProperty().getCopiedRowStoreColumns(); if ((oriRowStoreColumns != null && !oriRowStoreColumns.equals(rsColumns)) || storeRowColumn != olapTable.storeRowColumn()) { + // only support mow and duplicate model + if (!(olapTable.getKeysType() == KeysType.DUP_KEYS + || olapTable.getEnableUniqueKeyMergeOnWrite())) { + throw new DdlException("`store_row_column` only support duplicate model or mow model"); + } hasRowStoreChanged = true; } } diff --git a/regression-test/suites/point_query_p0/load.groovy b/regression-test/suites/point_query_p0/load.groovy index f3c3add91c18336..8e7db326fb848bc 100644 --- a/regression-test/suites/point_query_p0/load.groovy +++ b/regression-test/suites/point_query_p0/load.groovy @@ -119,7 +119,7 @@ suite("test_load_and_schema_change_row_store", "p0") { UNIQUE KEY(`k1`) COMMENT 'OLAP' DISTRIBUTED BY HASH(`k1`) BUCKETS 10 - PROPERTIES("replication_num" = "1"); + PROPERTIES("replication_num" = "1", "enable_unique_key_merge_on_write" = "true"); """ wait_job_done.call("tbl_scalar_types_dup") @@ -162,4 +162,37 @@ suite("test_load_and_schema_change_row_store", "p0") { } qt_sql "select /*+ SET_VAR(enable_nereids_planner=true,enable_short_circuit_query_access_column_store=false)*/ k1, c_decimalv3 from tbl_scalar_types_dup_1 where k1 = -2147303679" sql "set enable_short_circuit_query_access_column_store = true" + + + sql "DROP TABLE IF EXISTS tbl_scalar_types_uk_not_mow" + sql """ + CREATE TABLE IF NOT EXISTS tbl_scalar_types_uk_not_mow ( + `k1` bigint(11) NULL, + `c_string` text NULL + ) ENGINE=OLAP + UNIQUE KEY(`k1`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`k1`) BUCKETS 10 + PROPERTIES("replication_num" = "1", "enable_unique_key_merge_on_write" = "false"); + """ + test { + sql """alter table tbl_scalar_types_uk_not_mow set ("store_row_column" = "true")""" + exception("`store_row_column` only support duplicate model or mow model") + } + + sql "DROP TABLE IF EXISTS tbl_scalar_types_agg" + sql """ + CREATE TABLE IF NOT EXISTS tbl_scalar_types_agg( + `k1` bigint(11) NULL, + `c_string` text REPLACE_IF_NOT_NULL + ) ENGINE=OLAP + AGGREGATE KEY(`k1`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`k1`) BUCKETS 10 + PROPERTIES("replication_num" = "1"); + """ + test { + sql """alter table tbl_scalar_types_agg set ("store_row_column" = "true")""" + exception("`store_row_column` only support duplicate model or mow model") + } } diff --git a/regression-test/suites/point_query_p0/test_rowstore.groovy b/regression-test/suites/point_query_p0/test_rowstore.groovy index 8d7a28415c237cb..0ef7a0e42e4e01a 100644 --- a/regression-test/suites/point_query_p0/test_rowstore.groovy +++ b/regression-test/suites/point_query_p0/test_rowstore.groovy @@ -281,7 +281,7 @@ suite("test_rowstore", "p0,nonConcurrent") { "storage_format" = "V2" ) """ - sql "select /*+ SET_VAR(enable_nereids_planner=true)*/ * from table_with_column_group where k1 = 1" + sql "select /*+ SET_VAR(enable_nereids_planner=true, enable_short_circuit_query_access_column_store=true)*/ * from table_with_column_group where k1 = 1" sql """DROP TABLE IF EXISTS rs_query""" sql "set enable_decimal256 = true"