Skip to content

feat: numeric pruning for dim_value_set segments#19704

Open
jaykanakiya wants to merge 3 commits into
apache:masterfrom
jaykanakiya:dim_value_set
Open

feat: numeric pruning for dim_value_set segments#19704
jaykanakiya wants to merge 3 commits into
apache:masterfrom
jaykanakiya:dim_value_set

Conversation

@jaykanakiya

@jaykanakiya jaykanakiya commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Follow up to #19571

Adds support for LONG equality / IN / IS NULL segment pruning for dim_value_set segments.

Release note


Key changed/added classes in this PR
  • DimensionValueSetShardSpec
  • SeekableStreamIndexTaskRunner
  • TypedValueSet

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • 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
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

this.type = type;
}

public Set<String> getValues()

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1

Reviewed 20 of 20 changed files.


This is an automated review by Codex GPT-5.6-Sol

if (dimValues == null || dimValues.isEmpty()) {
dimSet.add(null);
if (longPartitionDimensions.contains(dim)) {
dimSet.add(canonicalLongValue(row.getRaw(dim), dim));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] Disable legacy string pruning for stamped LONG dimensions

Canonicalizing raw "00001" or "+1" to "1" is correct for the new typed domain, but the dimension still passes through possibleInDomain first. A native SelectorDimFilter("code", "00001", ...) matches indexed LONG 1 through runtime numeric coercion, while its range set remains literal "00001". The range check therefore sees no overlap with stamped "1" and prunes the segment before typed pruning runs, dropping valid rows. Exclude type-stamped LONG dimensions from the legacy string/range channel, or safely canonicalize that channel, and add a regression test for noncanonical string selectors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed so that long dims now skip the string/range channel and prune only via the type-gated possibleInValueDomain.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Follow-up reviewed: stamped LONG dimensions now bypass legacy string/range pruning, with regression coverage for noncanonical selectors. No new issues found.

Reviewed 20 of 20 changed files.


This is an automated review by Codex GPT-5.6-Sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants