Skip to content

Conversation

@EmmyMiao87
Copy link
Contributor

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

@EmmyMiao87 EmmyMiao87 added kind/fix Categorizes issue or PR as related to a bug. area/catalog Issues or PRs related to catalog management labels Jun 9, 2020
@chaoyli
Copy link
Contributor

chaoyli commented Jun 9, 2020

Create table will forbidden float/double

@EmmyMiao87
Copy link
Contributor Author

Create table will forbidden float/double

Already forbidden

rollupColumn.setAggregationType(null, false);
}
if (theBeginIndexOfValue == 0) {
throw new DdlException("The first column could not be float or double, use decimal instead.");
Copy link
Contributor

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.

morningman
morningman previously approved these changes Jun 16, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label Jun 16, 2020
EmmyMiao87 and others added 13 commits June 17, 2020 10:55
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: Id5236ff7229fc1c1d35df579dd3c62e699392ba5
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
Change-Id: I4d560427156855f28598ed089048006ea8d685c4
Change-Id: Iccfce893d120506667c55444a11841b91a1d322b
Change-Id: Ia88fa8cfa70661328300864054962931a8c0e225
Change-Id: I88e36a2379ae2e0659358bb5ba59d93bccfe37f1
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EmmyMiao87 EmmyMiao87 merged commit a62cebf into apache:master Jun 17, 2020
morningman added a commit that referenced this pull request Jun 22, 2020
…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
morningman pushed a commit to morningman/doris that referenced this pull request Jun 22, 2020
* 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.
morningman added a commit to morningman/doris that referenced this pull request Jun 22, 2020
…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
csun5285 pushed a commit to csun5285/doris that referenced this pull request Mar 28, 2025
…pache#3812)

File cache will only be clear when clear_cache is called if tablet meta
no longer exists in ms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/catalog Issues or PRs related to catalog management kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The be core when float column in short key

3 participants