Skip to content

[Bug] Range-bitmap chunk-size option above 2GB silently truncates to a negative int #9764

Description

@LuciferYang

Bug description

RangeBitmapFileIndex's Writer parses the user-facing chunk-size option (per-column: fileindex.rangebitmap.<col>.chunk-size) with (int) MemorySize.parse(...).getBytes(). Any value above Integer.MAX_VALUE — e.g. the legitimate "2g" a user might set to effectively disable chunking — silently narrows to a negative int, and the writer then crashes with an unrelated failure deep inside the first chunk creation.

The chunk size becomes an eagerly allocated per-chunk buffer (FixedLengthChunk does ByteBuffer.allocate(limitedSerializedSizeInBytes)), so values beyond int range can never work in the current design.

Expected behavior

A clear validation error naming the option and the offending value, instead of a silent truncation and a deep crash.

Steps

ALTER TABLE ... SET OPTIONS ('fileindex.rangebitmap.<col>.chunk-size'='2g') then write a data file with the range-bitmap index enabled.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions