-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Reject table create request with time type in complex type (…
…backport #54601) (#54701) Co-authored-by: zhangqiang <[email protected]>
- Loading branch information
1 parent
ff4ef72
commit 71ce361
Showing
4 changed files
with
150 additions
and
6 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
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
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,57 @@ | ||
-- name: test_create_table_with_time | ||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time TIME not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
E: (1064, 'Getting analyzing error. Detail message: Type:TIME of column:time does not support.') | ||
-- !result | ||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time array<TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
E: (1064, 'Getting analyzing error. Detail message: Type:ARRAY<TIME> of column:time does not support.') | ||
-- !result | ||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time map<bigint, TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
E: (1064, 'Getting analyzing error. Detail message: Type:MAP<BIGINT,TIME> of column:time does not support.') | ||
-- !result | ||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time struct<c1 bigint, c2 TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
E: (1064, 'Getting analyzing error. Detail message: Type:struct<c1 bigint(20), c2 TIME> of column:time does not support.') | ||
-- !result |
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,49 @@ | ||
-- name: test_create_table_with_time | ||
|
||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time TIME not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
|
||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time array<TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
|
||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time map<bigint, TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
|
||
CREATE TABLE dup_test ( | ||
id bigint, | ||
city varchar(100) not null, | ||
time struct<c1 bigint, c2 TIME> not null | ||
) | ||
DUPLICATE KEY(id) | ||
PARTITION BY (city) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); |