Skip to content
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

[fix](planner) separate table's isPartitioned() method #27515 #28163 #28351

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

morningman
Copy link
Contributor

…is a partitioned table (apache#27515)

The old logic used to determine whether it was a partition table based on the number of buckets, but if I had a partition table with only one partition and the number of buckets in that partition was 1, it would be mistakenly recognized as a non partition table.

```
Table[test_load_doris_to_hive_2] is not partitioned
```
@github-actions github-actions bot added area/nereids area/planner Issues or PRs related to the query planner labels Dec 13, 2023
@morningman
Copy link
Contributor Author

run buildall

This PR apache#27515 change the logic if Table's `isPartitioned()` method.
But this method has 2 usages:

1. To check whether a table is range or list partitioned, for some DML operation such as Alter, Export.

    For this case, it should return true if the table is range or list partitioned. even if it has only
    one partition and one buckets.

2. To check whether the data is distributed (either by partitions or by buckets), for query planner.

    For this case, it should return true if table has more than one bucket. Even if this table is not
    range or list partitioned, if it has more than one bucket, it should return true.

So we should separate this method into 2, for different usages.
Otherwise, it may cause some unreasonable plan shape
@morningman
Copy link
Contributor Author

run buildall

@morningman morningman merged commit 6a26cdf into apache:branch-2.0 Dec 13, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nereids area/planner Issues or PRs related to the query planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants