Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Aug 9, 2023
1 parent 5144ed0 commit f8af846
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,8 @@ private void checkDeleteV2(OlapTable table, List<Partition> partitions,
table.getKeysType(), columnName, column.isSequenceColumn(), column.isKey());
if (!column.isKey()) {
if (table.getKeysType() == KeysType.AGG_KEYS) {
throw new DdlException("delete predicate on value column only supports Unique table"
+ "Table[" + table.getName() + "] is Aggregate table.");
} else if (table.getKeysType() == KeysType.UNIQUE_KEYS
&& table.getSequenceMapCol().equals(columnName)) {
throw new DdlException("delete predicate on value column only supports Unique table and the column"
+ "must not be the sequence column. Column[" + columnName + "] is sequence column.");
throw new DdlException("delete predicate on value column only supports Unique table and"
+ "Duplicate table" + "Table[" + table.getName() + "] is Aggregate table.");
}
}

Expand Down
22 changes: 0 additions & 22 deletions regression-test/suites/delete_p0/test_delete_on_value.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,4 @@ suite("test_delete_on_value") {
sql "delete from ${tableName} where y=4;"
exception "delete predicate on value column only supports Unique table"
}


def tableName3 = "test_delete_on_value3"
sql """ DROP TABLE IF EXISTS ${tableName3} """
sql """ CREATE TABLE ${tableName3} (
`x` BIGINT NOT NULL,
`y` BIGINT NULL,
`z` BIGINT NULL)
ENGINE=OLAP
UNIQUE KEY(`x`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`x`) BUCKETS 4
PROPERTIES (
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true",
"function_column.sequence_col" = 'y'
);"""
sql """ insert into ${tableName3} values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5); """
test {
sql "delete from ${tableName3} where y=4;"
exception "delete predicate on value column only supports Unique table and the column must not be the sequence column"
}
}

0 comments on commit f8af846

Please sign in to comment.