Skip to content

feat(file-index): support additional types and validate decimal scale - #271

Open
zjw1111 wants to merge 4 commits into
apache:mainfrom
zjw1111:codex/file-index-extra-types
Open

feat(file-index): support additional types and validate decimal scale#271
zjw1111 wants to merge 4 commits into
apache:mainfrom
zjw1111:codex/file-index-extra-types

Conversation

@zjw1111

@zjw1111 zjw1111 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Linked issue: #173

Extend file-index read/write support while keeping serialized data compatible with Java Paimon, and prevent silent DECIMAL index misfiltering at table entry points:

  • Support FLOAT and DOUBLE in bitmap indexes.
  • Support DECIMAL in BSI indexes.
  • Support STRING, DECIMAL, and TIMESTAMP in range-bitmap indexes.
  • Add a range-bitmap type adapter for logical-to-storage type and literal conversion.
  • Add variable-length dictionary chunks for string keys and avoid eagerly reading chunk bodies.
  • Cover canonical and payload NaNs, signed zero, infinities, and Java-generated bitmap bytes.
  • Reject DECIMAL predicate literals whose scale differs from the schema in TableScan and TableRead creation.
  • Allow different DECIMAL precision metadata when the value fits the field precision, and reject values that do not fit.
  • Document that direct FileIndexReader and GlobalIndexReader Visit* calls must use the indexed field scale.
  • Add regression coverage showing that mathematically equivalent DECIMAL literals with a different scale produce incorrect results in BSI, range-bitmap, and BTree readers.

Tests

  • pre-commit run --files
  • git diff --check upstream/main...HEAD
  • Compiled the original file-index translation units with the repository Debug flags, including -Werror and ASan.
  • BitmapIndexTest.* (14 tests)
  • BitSliceIndexBitmapIndexReaderTest.:ChunkedDictionaryTest.:RangeBitmapFileIndexTest.:RangeBitmapTypeAdapterTest. (55 tests)
  • SizeLimitAndCardinality/* (70 tests)
  • PredicateValidatorTest.* (3 tests)
  • BitSliceIndexBitmapIndexReaderTest.TestDecimalType and RangeBitmapFileIndexTest.TestWriteAndReadStringDecimalAndTimestamp (2 focused DECIMAL scale tests)
  • Compression/BTreeGlobalIndexIntegrationTest.WriteAndReadDecimalCompactData/* (3 compression variants)

API and Format

No public API signatures are changed. TableScan and TableRead now reject DECIMAL predicate literals with a scale different from the schema, or a value that does not fit the field precision. Direct index-reader APIs retain their existing behavior and now document the same-scale requirement.

The bitmap, BSI, and range-bitmap formats are extended to the additional logical types without changing their format versions. Floating-point bitmap keys are verified against Java-generated V1/V2 bytes.

Documentation

Add public FileIndexReader and GlobalIndexReader notes requiring DECIMAL literals passed to Visit* to use the indexed field scale.

Generative AI tooling

Generated-by: OpenAI Codex (GPT-5).

@zjw1111 zjw1111 changed the title feat(file-index): support additional data types feat(file-index): support additional types and validate decimal scale Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant