Skip to content

Commit f99d908

Browse files
committed
[refactor](ddl) Rename the state-type compatibility setting
### What problem does this PR solve? Issue Number: close apache#65865 Related PR: apache#66963 Problem Summary: Use the enable_ naming convention for the temporary FE setting that permits state-type columns in non-aggregate tables. Rename the configuration declaration, validation diagnostic, unit-test references, regression settings, and shared regression lock names consistently. Keep the default restriction, dynamic master-only scope, and internal-table exemptions unchanged. ### Release note The temporary compatibility setting is named enable_non_aggregate_table_state_types and remains disabled by default. ### Check List (For Author) - Test: Unit Test - run-fe-ut.sh: 52 focused tests passed in CreateTableTest, ColumnDefinitionTest, InternalSchemaAlterTest, MTMVPlanUtilTest, and CreateTableWithBloomFilterIndexTest#testCreateTableWithHllBloomFilterIndex - Checkstyle passed for fe-common and fe-core; git diff --check passed - Live SQL regression and full product packaging not run locally - Behavior changed: Yes. Rename the new configuration; its semantics are unchanged. - Does this need documentation: No. This is a naming adjustment to the unreleased temporary configuration introduced by this PR.
1 parent 17b98f1 commit f99d908

17 files changed

Lines changed: 37 additions & 37 deletions

File tree

‎fe/fe-common/src/main/java/org/apache/doris/common/Config.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ public class Config extends ConfigBase {
18601860
@ConfField(mutable = true, masterOnly = true, description = "Temporary compatibility switch that allows HLL, "
18611861
+ "QUANTILE_STATE, and AGG_STATE columns in non-aggregate key tables. Disabled by default. This switch "
18621862
+ "is intended only for migration and will be removed after the compatibility transition period.")
1863-
public static boolean allow_non_aggregate_table_state_types = false;
1863+
public static boolean enable_non_aggregate_table_state_types = false;
18641864

18651865
/*---------------------- JOB CONFIG START------------------------*/
18661866
/**

‎fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/ColumnDefinition.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,10 @@ private void validateInternal(boolean isOlap, Set<String> keysSet, Set<String> c
426426
type.validateDataType();
427427
type = updateCharacterTypeLength(type);
428428
if (!isSystemGeneratedTable && isOlap && keysType != KeysType.AGG_KEYS && isAggregateTableOnlyType()
429-
&& !Config.allow_non_aggregate_table_state_types) {
429+
&& !Config.enable_non_aggregate_table_state_types) {
430430
throw new AnalysisException(String.format(
431431
"%s type is only supported in aggregate key tables, column: %s. "
432-
+ "Set FE config 'allow_non_aggregate_table_state_types' to true to temporarily allow it",
432+
+ "Set FE config 'enable_non_aggregate_table_state_types' to true to temporarily allow it",
433433
type.toSql(), name));
434434
}
435435
if (type.isArrayType()) {

‎fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ protected void runBeforeAll() throws Exception {
5454

5555
@Test
5656
public void testInternalQueryStateDoesNotExemptUserTable() {
57-
boolean originalAllowStateTypes = Config.allow_non_aggregate_table_state_types;
57+
boolean originalAllowStateTypes = Config.enable_non_aggregate_table_state_types;
5858
boolean originalInternal = connectContext.getState().isInternal();
5959
boolean originalEnableAggState = connectContext.getSessionVariable().enableAggState;
60-
Config.allow_non_aggregate_table_state_types = false;
60+
Config.enable_non_aggregate_table_state_types = false;
6161
connectContext.getSessionVariable().enableAggState = true;
6262
// An ordinary SHOW can leave the internal-query flag set on a user connection.
6363
connectContext.getState().setInternal(true);
@@ -74,7 +74,7 @@ public void testInternalQueryStateDoesNotExemptUserTable() {
7474
}
7575
}
7676
} finally {
77-
Config.allow_non_aggregate_table_state_types = originalAllowStateTypes;
77+
Config.enable_non_aggregate_table_state_types = originalAllowStateTypes;
7878
connectContext.getState().setInternal(originalInternal);
7979
connectContext.getSessionVariable().enableAggState = originalEnableAggState;
8080
}

‎fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableWithBloomFilterIndexTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ public void testCreateTableWithJsonBloomFilterIndex() {
447447

448448
@Test
449449
public void testCreateTableWithHllBloomFilterIndex() {
450-
boolean originalValue = Config.allow_non_aggregate_table_state_types;
451-
Config.allow_non_aggregate_table_state_types = true;
450+
boolean originalValue = Config.enable_non_aggregate_table_state_types;
451+
Config.enable_non_aggregate_table_state_types = true;
452452
try {
453453
ExceptionChecker.expectThrowsWithMsg(DdlException.class,
454454
" HLL is not supported in bloom filter index. invalid column: k1",
@@ -463,7 +463,7 @@ public void testCreateTableWithHllBloomFilterIndex() {
463463
+ "\"replication_num\" = \"1\"\n"
464464
+ ");"));
465465
} finally {
466-
Config.allow_non_aggregate_table_state_types = originalValue;
466+
Config.enable_non_aggregate_table_state_types = originalValue;
467467
}
468468
}
469469

‎fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/info/ColumnDefinitionTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public class ColumnDefinitionTest {
4141

4242
@BeforeEach
4343
public void setUp() {
44-
Config.allow_non_aggregate_table_state_types = false;
44+
Config.enable_non_aggregate_table_state_types = false;
4545
}
4646

4747
@AfterEach
4848
public void tearDown() {
49-
Config.allow_non_aggregate_table_state_types = false;
49+
Config.enable_non_aggregate_table_state_types = false;
5050
}
5151

5252
@Test
@@ -86,7 +86,7 @@ public void testStateTypesRequireAggregateKeyTableByDefault() {
8686

8787
@Test
8888
public void testTemporaryConfigAllowsStateTypesInNonAggregateTable() {
89-
Config.allow_non_aggregate_table_state_types = true;
89+
Config.enable_non_aggregate_table_state_types = true;
9090

9191
for (KeysType keysType : ImmutableList.of(KeysType.DUP_KEYS, KeysType.UNIQUE_KEYS)) {
9292
for (DataType type : aggregateTableOnlyTypes()) {

‎regression-test/suites/correctness_p0/test_default_hll.groovy‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// under the License.
1717

1818
suite("test_default_hll") {
19-
withGlobalLock("allow_non_aggregate_table_state_types") {
20-
setFeConfigTemporary([allow_non_aggregate_table_state_types: true]) {
19+
withGlobalLock("enable_non_aggregate_table_state_types") {
20+
setFeConfigTemporary([enable_non_aggregate_table_state_types: true]) {
2121
def tableName = "test_default_hll"
2222

2323
sql """ DROP TABLE IF EXISTS ${tableName} """

‎regression-test/suites/data_model_p0/duplicate/storage/test_duplicate_hll.groovy‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// under the License.
1717

1818
suite("test_duplicate_table_hll") {
19-
withGlobalLock("allow_non_aggregate_table_state_types") {
20-
setFeConfigTemporary([allow_non_aggregate_table_state_types: true]) {
19+
withGlobalLock("enable_non_aggregate_table_state_types") {
20+
setFeConfigTemporary([enable_non_aggregate_table_state_types: true]) {
2121

2222
sql "sync;"
2323

‎regression-test/suites/data_model_p0/duplicate/storage/test_duplicate_quantile_state.groovy‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// under the License.
1717

1818
suite("test_duplicate_table_quantile_state") {
19-
withGlobalLock("allow_non_aggregate_table_state_types") {
20-
setFeConfigTemporary([allow_non_aggregate_table_state_types: true]) {
19+
withGlobalLock("enable_non_aggregate_table_state_types") {
20+
setFeConfigTemporary([enable_non_aggregate_table_state_types: true]) {
2121

2222
sql "sync;"
2323

‎regression-test/suites/data_model_p0/test_state_types_only_in_aggregate_table.groovy‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
suite("test_state_types_only_in_aggregate_table") {
1919
context.reconnectToMasterFe()
20-
withGlobalLock("allow_non_aggregate_table_state_types") {
21-
setFeConfigTemporary([allow_non_aggregate_table_state_types: false]) {
20+
withGlobalLock("enable_non_aggregate_table_state_types") {
21+
setFeConfigTemporary([enable_non_aggregate_table_state_types: false]) {
2222
sql "set enable_agg_state=true"
2323
// SHOW executes an internal query, but must not exempt subsequent user DDL.
2424
sql "show table status"
@@ -96,7 +96,7 @@ suite("test_state_types_only_in_aggregate_table") {
9696
properties("replication_num" = "1")
9797
"""
9898

99-
setFeConfigTemporary([allow_non_aggregate_table_state_types: true]) {
99+
setFeConfigTemporary([enable_non_aggregate_table_state_types: true]) {
100100
sql "drop table if exists state_type_compatibility_dup"
101101
sql """
102102
create table state_type_compatibility_dup (

‎regression-test/suites/data_model_p0/unique/test_unique_hll.groovy‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// under the License.
1717

1818
suite("test_unique_table_hll") {
19-
withGlobalLock("allow_non_aggregate_table_state_types") {
20-
setFeConfigTemporary([allow_non_aggregate_table_state_types: true]) {
19+
withGlobalLock("enable_non_aggregate_table_state_types") {
20+
setFeConfigTemporary([enable_non_aggregate_table_state_types: true]) {
2121

2222
for (def enable_mow : [true, false]) {
2323
sql "sync;"

0 commit comments

Comments
 (0)