Skip to content

Conversation

@morningman
Copy link
Contributor

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 morningman added kind/fix Categorizes issue or PR as related to a bug. area/catalog Issues or PRs related to catalog management labels Jun 19, 2020
@morningman morningman self-assigned this Jun 19, 2020
for (Column column : schema) {
if (column.getName().equalsIgnoreCase(colName)) {
if (!column.isKey()) {
if (!column.isKey() && column.getAggregationType() != AggregateType.NONE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does it need a second check here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Historical issues...
It is OK, may be removed in future.

…java

Co-authored-by: EmmyMiao87 <522274284@qq.com>
…java

Co-authored-by: EmmyMiao87 <522274284@qq.com>
Copy link
Contributor

@EmmyMiao87 EmmyMiao87 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 21, 2020
@morningman morningman merged commit 56bb218 into apache:master Jun 22, 2020
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
suxiaogang223 pushed a commit to suxiaogang223/doris that referenced this pull request Jul 15, 2025
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Jul 21, 2025
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.

2 participants