Baymine opened a new issue, #66077: URL: https://github.com/apache/doris/issues/66077
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/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: ```sql SELECT * FROM tbl [PARTITION(...)] BUCKET(0, 2) alias; ``` 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. ### Related issues _No response_ ### Are you willing to submit PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
