[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");