Skip to content

[vortex] Read the primary-key format's physical _SEQUENCE_NUMBER column (#8876) - #8877

Open
jordepic wants to merge 1 commit into
apache:masterfrom
jordepic:fix-vortex-kv-sequence-column
Open

[vortex] Read the primary-key format's physical _SEQUENCE_NUMBER column (#8876)#8877
jordepic wants to merge 1 commit into
apache:masterfrom
jordepic:fix-vortex-kv-sequence-column

Conversation

@jordepic

Copy link
Copy Markdown
Contributor

Purpose

Fixes #8876.

The vortex reader classified any projected field named _SEQUENCE_NUMBER or _ROW_ID as a row-tracking field to synthesize, mapping its projection index to -1. _SEQUENCE_NUMBER doubles as the primary-key file format's physical sequence column, so every vortex read of a primary-key table crashed with ArrayIndexOutOfBoundsException at the first key-value deserialization. Reserve synthesis for fields the file does not store physically: when the data schema carries the field (by id or name), map it to its physical column like any other.

Verified beyond the unit test with an external end-to-end setup: primary-key tables in vortex format under deletion-vector mode, written by paimon-rust and lookup-compacted by this repo's writer, round-trip cleanly with this fix (they crash without it).

Tests

VortexRecordsReaderTest#testPhysicalSequenceColumnIsReadNotSynthesized; the two existing schema-handling tests updated for the added data-schema parameter.

API and Format

No changes.

Documentation

No changes.

…mn (apache#8876)

The vortex reader classified any projected field named _SEQUENCE_NUMBER or
_ROW_ID as a row-tracking field to synthesize, mapping its projection index
to -1. But _SEQUENCE_NUMBER doubles as the primary-key file format's
physical sequence column, so every vortex read of a primary-key table
crashed with ArrayIndexOutOfBoundsException on the first key-value
deserialization. Reserve synthesis for fields the file does not store
physically: when the data schema carries the field (by id or name), map it
to its physical column like any other.
@jordepic

Copy link
Copy Markdown
Contributor Author

cc @JingsongLi — companion find to #8874, from the same cross-implementation state-backend testing: vortex primary-key reads crash on the physical sequence column being reserved for row-tracking synthesis.

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.

[Bug] Vortex reader crashes on every primary-key table read: _SEQUENCE_NUMBER mapped for row-tracking synthesis

1 participant