Skip to content

Remove createDictionary from ColumnIndexCreationInfo#18101

Merged
Jackie-Jiang merged 1 commit intoapache:masterfrom
Jackie-Jiang:remove-create-dictionary-from-column-index-creation-info
Apr 6, 2026
Merged

Remove createDictionary from ColumnIndexCreationInfo#18101
Jackie-Jiang merged 1 commit intoapache:masterfrom
Jackie-Jiang:remove-create-dictionary-from-column-index-creation-info

Conversation

@Jackie-Jiang
Copy link
Copy Markdown
Contributor

Description

ColumnIndexCreationInfo had a createDictionary boolean field that was redundant and incorrectly used:

  • In SegmentIndexCreationDriverImpl, it was set as dictionaryIndexConfig.isDisabled()inverted logic: isDisabled() returns true when the dictionary is disabled, so createDictionary would be true when dictionary is disabled and false when enabled.
  • Whether to create a dictionary is determined by DictionaryIndexConfig, not by this stats/creation-info data class, so the field serves no purpose.

Changes

  • Remove _createDictionary field, isCreateDictionary() accessor, and the createDictionary constructor parameter from ColumnIndexCreationInfo; keep old 5-arg constructor as @Deprecated for backward compatibility
  • Remove the buggy createDictionary = dictionaryIndexConfig.isDisabled() assignment in SegmentIndexCreationDriverImpl
  • Remove deprecated shouldUseVarLengthDictionary(String, Set, DataType, ColumnStatistics) pass-through in SegmentIndexCreationDriverImpl and DictionaryIndexType
  • Update all callers (ForwardIndexHandler, BaseDefaultColumnHandler, ColumnMetadataTest) to use the new constructor

Test Plan

  • Existing unit tests in ColumnMetadataTest updated and pass
  • No behavior change — the createDictionary field was not used to make any runtime decisions in the code paths examined

🤖 Generated with Claude Code

The createDictionary field in ColumnIndexCreationInfo was redundant
because dictionary creation is determined by DictionaryIndexConfig, not
by the stats/creation-info data class. It was also incorrectly set in
SegmentIndexCreationDriverImpl as dictionaryIndexConfig.isDisabled()
(inverted logic).

- Remove createDictionary field and primary constructor parameter from
  ColumnIndexCreationInfo; keep old constructor as @deprecated
- Remove isCreateDictionary() accessor
- Remove deprecated shouldUseVarLengthDictionary pass-through in
  SegmentIndexCreationDriverImpl and DictionaryIndexType
- Update all callers to use the new constructor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Jackie-Jiang Jackie-Jiang added the cleanup Code cleanup or removal of dead code label Apr 4, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.82%. Comparing base (15b0de3) to head (bfb8350).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...loader/defaultcolumn/BaseDefaultColumnHandler.java 45.45% 6 Missing ⚠️
...t/segment/spi/creator/ColumnIndexCreationInfo.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18101      +/-   ##
============================================
- Coverage     63.85%   63.82%   -0.03%     
  Complexity     1573     1573              
============================================
  Files          3167     3167              
  Lines        192099   192089      -10     
  Branches      29604    29604              
============================================
- Hits         122657   122604      -53     
- Misses        59788    59819      +31     
- Partials       9654     9666      +12     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.79% <40.00%> (-0.03%) ⬇️
java-21 63.80% <40.00%> (-0.01%) ⬇️
temurin 63.82% <40.00%> (-0.03%) ⬇️
unittests 63.82% <40.00%> (-0.03%) ⬇️
unittests1 56.01% <6.66%> (-0.03%) ⬇️
unittests2 34.28% <40.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jackie-Jiang Jackie-Jiang merged commit 67281de into apache:master Apr 6, 2026
45 of 48 checks passed
@Jackie-Jiang Jackie-Jiang deleted the remove-create-dictionary-from-column-index-creation-info branch April 6, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup or removal of dead code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants