-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement](DDL) check illegal partition exprs #40158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 38007 ms |
TPC-DS: Total hot run time: 193095 ms |
ClickBench: Total hot run time: 31.87 s |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
HappenLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
before:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
Query OK, 0 rows affected (0.14 sec)
```
now:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = Non-auto partition table not support partition expr!
```
before:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
Query OK, 0 rows affected (0.14 sec)
```
now:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = Non-auto partition table not support partition expr!
```
before:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
Query OK, 0 rows affected (0.14 sec)
```
now:
```sql
mysql> CREATE TABLE not_auto_expr (
-> `TIME_STAMP` date NOT NULL
-> )
-> partition by range (date_trunc(`TIME_STAMP`, 'day'))()
-> DISTRIBUTED BY HASH(`TIME_STAMP`) BUCKETS 10
-> PROPERTIES (
-> "replication_allocation" = "tag.location.default: 1"
-> );
ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = Non-auto partition table not support partition expr!
```
Proposed changes
Issue Number: close #xxx
before:
now: