jihoonson opened a new pull request #10288:
URL: https://github.com/apache/druid/pull/10288
### Description
The segment pruning was recently introduced in #9810. This is a nice feature
to have, but could have some potential compatibility issues.
1) We need a flag to disable segment pruning just in case where some unknown
bugs exist in pruning hash-partitioned segments.
2) The hash function used to create segments at ingestion time can change
over time. I'm not sure whether or not we ever changed it. If we ever did, the
segment pruning can lead to incorrect query results for those segments
partitioned with a different hash function.
To address these issues, this PR adds a new query context, `segmentPruning`,
to allow disabling segment pruning at query time.This is enabled by default to
keep the current behavior for range-partitioned segments. This PR also adds a
new enum, `HashPartitionFunction`, which is stored in metadata store as a part
of `ShardSpec`. For hash-partitioned segments, the broker can prune segments
only when `hashPartitionFunction` is stored in `shardSpec` and `segmentPruning`
is set in query context. The hashPartitionFunction is set to null by default
unless it is specified by users explicitly.
<hr>
This PR has:
- [x] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]