From 2dff89a77ad56c4e6e8e8d9486c2159a9e2b4fb6 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Mon, 28 Aug 2023 17:04:01 +0800 Subject: [PATCH] [Log](Alter) Print table's state when `checkNormalStateForAlter()` failed (#23358) --- .../src/main/java/org/apache/doris/catalog/OlapTable.java | 3 ++- .../suites/schema_change/test_alter_table_status.groovy | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java index 1f6c693360..4f153f6eb1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java @@ -1548,7 +1548,8 @@ public class OlapTable extends Table { public void checkNormalStateForAlter() throws DdlException { if (state != OlapTableState.NORMAL) { - throw new DdlException("Table[" + name + "]'s state is not NORMAL. Do not allow doing ALTER ops"); + throw new DdlException("Table[" + name + "]'s state(" + state.toString() + + ") is not NORMAL. Do not allow doing ALTER ops"); } } diff --git a/regression-test/suites/schema_change/test_alter_table_status.groovy b/regression-test/suites/schema_change/test_alter_table_status.groovy index 0fda21f33f..16e5cbcea4 100644 --- a/regression-test/suites/schema_change/test_alter_table_status.groovy +++ b/regression-test/suites/schema_change/test_alter_table_status.groovy @@ -35,7 +35,7 @@ suite("test_alter_table_status") { // try alter table comment test { sql """ ALTER TABLE ${tbName1} MODIFY COMMENT 'test'; """ - exception "Table[${tbName1}]'s state is not NORMAL. Do not allow doing ALTER ops" + exception "Table[alter_table_status]'s state(ROLLUP) is not NORMAL. Do not allow doing ALTER ops" } // set table state to NORMAL