You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Support BUCKET(id, ...) query hint to scan specific buckets of an olap table #66077
I had searched in the issues and found no similar issues.
Description
Doris already supports a TABLET(id, ...) hint to restrict a scan to specific tablets, e.g. SELECT * FROM tbl TABLET(10086). This is useful for debugging and targeted scans, but it requires the user to first look up raw tablet ids (via SHOW TABLETS), and those ids change across schema changes and differ per partition.
It would be convenient to target buckets by their ordinal instead. Bucket k is stable and meaningful (it is the bucket that the distribution-key hash maps to), so BUCKET(0, 2) lets a user scan the buckets holding specific keys without any tablet-id lookup.
Proposal: add a BUCKET(<int>, ...) table hint that mirrors TABLET(...) at bucket-ordinal granularity:
A bucket id k resolves to the k-th tablet of each selected partition (partition.getBaseIndex().getTablets().get(k)) and reuses the existing manually-specified-tablet scan path. BUCKET and TABLET are mutually exclusive.
Use case
Debugging and targeted scans of specific buckets without having to look up raw tablet ids first.
Activity
[feature](nereids) support BUCKET(id,...) hint to scan specific bucke…