-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Forbidden float column in short key #3812
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
|
Create table will forbidden float/double |
fe/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
Outdated
Show resolved
Hide resolved
Already forbidden |
fe/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
Outdated
Show resolved
Hide resolved
| rollupColumn.setAggregationType(null, false); | ||
| } | ||
| if (theBeginIndexOfValue == 0) { | ||
| throw new DdlException("The first column could not be float or double, use decimal instead."); |
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.
use decimal instead can be removed. Because user has no choice.
fe/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
Outdated
Show resolved
Hide resolved
morningman
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
When the user does not specify the key column, doris will automatically supplement the key column. However, doris does not support float or double as the key column, so when adding the key column, doris should avoid setting those column as the key column. The CreateMaterailizedView, AddRollup and CreateDuplicateTable need to forbidden float column in short key. If the float column is directly encountered during the supplement process, the subsequent columns are all value columns. If the first column is float or double, Doris will throw the exception. Fixed apache#3811 Change-Id: Ib66d9355acefcd8f281906bcb7b4dd684319ff08
…iewStmt.java Co-authored-by: Mingyu Chen <morningman.cmy@gmail.com>
Change-Id: Ie1320d9af56083633c7634c1c3df485f3994da31
Change-Id: Ib4c4791847d522fa312efff4016787c9caeab785
For duplicate table without order by columns, the order by columns are same as short key columns. If the order by columns have been designated, the count of short key columns must be <= the count of order by columns. The short key columns must be less then 3 columns and less then 36 bytes. Also the float and double could not be the short key column. At the same time, doirs must be at least one short key column. So the type of first column could not be float or double. If the varchar is the short key column, it can only be the least one short key column. Change-Id: I46ec2c78e87d73c3f3aeeb815b9acc6dcfe280e0
Change-Id: Ia4d2a9bfb1b4321dc3ed8e2dd243d9a4fd2dbf69
Change-Id: I1d13600a39d59cf93feb42df85c1089ca1029615
Change-Id: Id647f940b81ebfc27e18ef83e5275af7177bf926
morningman
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
…le (#3916) The following statement will throw error: ``` create table test.tbl2 (k1 int, k2 int, k3 float) duplicate key(k1) partition by range(k2) (partition p1 values less than("10")) distributed by hash(k3) buckets 1 properties('replication_num' = '1'); ``` Error: `Only key column can be partition column` But in duplicate key table, columns can be partition or distribution column even if they are not in duplicate keys. This bug is introduced by #3812
* Forbidden float column in short key When the user does not specify the short key column, doris will automatically supplement the short key column. However, doris does not support float or double as the short key column, so when adding the short key column, doris should avoid setting those column as the key column. The short key columns must be less then 3 columns and less then 36 bytes. The CreateMaterailizedView, AddRollup and CreateDuplicateTable need to forbidden float column in short key. If the float column is directly encountered during the supplement process, the subsequent columns are all value columns. Also the float and double could not be the short key column. At the same time, Doris must be at least one short key column. So the type of first column could not be float or double. If the varchar is the short key column, it can only be the least one short key column. Fixed apache#3811 For duplicate table without order by columns, the order by columns are same as short key columns. If the order by columns have been designated, the count of short key columns must be <= the count of order by columns.
…le (apache#3916) The following statement will throw error: ``` create table test.tbl2 (k1 int, k2 int, k3 float) duplicate key(k1) partition by range(k2) (partition p1 values less than("10")) distributed by hash(k3) buckets 1 properties('replication_num' = '1'); ``` Error: `Only key column can be partition column` But in duplicate key table, columns can be partition or distribution column even if they are not in duplicate keys. This bug is introduced by apache#3812
…pache#3812) File cache will only be clear when clear_cache is called if tablet meta no longer exists in ms.
When the user does not specify the key column, doris will automatically supplement the key column.
However, doris does not support float or double as the key column, so when adding the key column, doris should avoid setting those column as the key column.
The CreateMaterailizedView, AddRollup and CreateDuplicateTable need to forbidden float column in short key.
If the float column is directly encountered during the supplement process, the subsequent columns are all value columns.
If the first column is float or double, Doris will throw the exception.
Fixed #3811
Change-Id: Ib66d9355acefcd8f281906bcb7b4dd684319ff08