[fix](catalog) all properties should be checked when create unpartitioned table (#18149)

all properties should be checked when create unpartitioned table like partitioned table.



Signed-off-by: nextdreamblue <zxw520blue1@163.com>
This commit is contained in:
xueweizhang
2023-04-04 08:53:45 +08:00
committed by GitHub
parent 8b85c55117
commit 798d2e5160
7 changed files with 13 additions and 6 deletions

View File

@ -2175,6 +2175,10 @@ public class InternalCatalog implements CatalogIf<Database> {
// create partition
try {
if (partitionInfo.getType() == PartitionType.UNPARTITIONED) {
if (storagePolicy.equals("") && properties != null && !properties.isEmpty()) {
// here, all properties should be checked
throw new DdlException("Unknown properties: " + properties);
}
// this is a 1-level partitioned table
// use table name as partition name
DistributionInfo partitionDistributionInfo = distributionDesc.toDistributionInfo(baseSchema);

View File

@ -243,6 +243,11 @@ public class CreateTableTest {
@Test
public void testAbnormal() throws DdlException, ConfigException {
ExceptionChecker.expectThrowsWithMsg(DdlException.class,
"Unknown properties: {aa=bb}",
() -> createTable("create table test.atbl1\n" + "(k1 int, k2 float)\n" + "duplicate key(k1)\n"
+ "distributed by hash(k1) buckets 1\n" + "properties('replication_num' = '1','aa'='bb'); "));
ExceptionChecker.expectThrowsWithMsg(DdlException.class,
"Floating point type should not be used in distribution column",
() -> createTable("create table test.atbl1\n" + "(k1 int, k2 float)\n" + "duplicate key(k1)\n"

View File

@ -2031,7 +2031,6 @@ public class QueryPlanTest extends TestWithFeService {
+ "PROPERTIES (\n"
+ "\"replication_num\" = \"1\",\n"
+ "\"in_memory\" = \"false\",\n"
+ "\"business_key_column_name\" = \"\",\n"
+ "\"storage_medium\" = \"HDD\",\n"
+ "\"storage_format\" = \"V2\"\n"
+ ");\n");

View File

@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS delete_sign_test_mow (
UNIQUE KEY(uid)
DISTRIBUTED BY HASH(uid) BUCKETS 3
PROPERTIES (
"unique_key_merge_on_write" = "true",
"enable_unique_key_merge_on_write" = "true",
"replication_num" = "1"
);

View File

@ -86,7 +86,7 @@ suite("regression_test_dynamic_table", "dynamic_table"){
)
UNIQUE KEY(`id`)
DISTRIBUTED BY HASH(`id`) BUCKETS 5
properties("replication_num" = "1", "enable_merge_on_write" = "true");
properties("replication_num" = "1", "enable_unique_key_merge_on_write" = "true");
"""
//stream load src_json

View File

@ -41,8 +41,7 @@ suite("test_array_index"){
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES(
"replication_allocation" = "tag.location.default: 1",
"persistent"="false"
"replication_allocation" = "tag.location.default: 1"
);
"""

View File

@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS delete_sign_test_mow (
UNIQUE KEY(uid)
DISTRIBUTED BY HASH(uid) BUCKETS 3
PROPERTIES (
"unique_key_merge_on_write" = "true",
"enable_unique_key_merge_on_write" = "true",
"replication_num" = "1"
);