forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](schema-change) Fix single column table could not rename columns (…
…apache#47275) Single column tables was not able to rename column due to light schema change check in error way.
- Loading branch information
1 parent
e1760a8
commit 1d34eae
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
regression-test/data/schema_change_p0/test_rename_single_col_tbl.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !desc -- | ||
test_rename_single_col_tbl DUP_KEYS rename_partition_col DATE datev2 No true \N true | ||
|
37 changes: 37 additions & 0 deletions
37
regression-test/suites/schema_change_p0/test_rename_single_col_tbl.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("test_rename_single_col_tbl") { | ||
def tblName = "test_rename_single_col_tbl" | ||
sql """ DROP TABLE IF EXISTS ${tblName} """ | ||
sql """ | ||
CREATE TABLE ${tblName} | ||
( | ||
col0 DATE NOT NULL, | ||
) | ||
DUPLICATE KEY(col0) | ||
DISTRIBUTED BY HASH(col0) BUCKETS 4 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
""" | ||
sql """ | ||
ALTER TABLE ${tblName} RENAME COLUMN col0 rename_partition_col | ||
""" | ||
sql """ SYNC """ | ||
qt_desc """ DESC ${tblName} ALL """ | ||
} |