Skip to content

[mosaic] Resolve row-group filter fields by name - #10729

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/mosaic-format-table-filter-by-name
Open

thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/mosaic-format-table-filter-by-name

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #10727

  • MosaicRecordsReader now remaps filters by name against the file row type with PredicateRemapper; a conjunct that cannot be resolved is dropped, which only relaxes row-group pruning.
  • Format Table reads pass filters indexed against the full row type, so with non-empty mosaic.stats-columns and a partition column before the filtered column, row groups were wrongly skipped (no rows) or the read hit ArrayIndexOutOfBoundsException. Defaults are unaffected.
  • Parity: Parquet, ORC and Vortex resolve by name; the Python mosaic reader re-indexes by name.
  • Remapping in core FormatReadBuilder instead would miss the PK key-value layout (MergeFileSplitRead notes formats resolve by name).

Tests

  • Added FormatTableMosaicReadTest#testFilterOnDataColumnAfterPartitionColumn (a = 1, b = 101, a >= 105) and #testFilterOnColumnWithoutStatsAfterPartitionColumn. Before the fix: no rows / ArrayIndexOutOfBoundsException / no pruning.
  • mvn -pl paimon-mosaic clean install: 160 tests, 0 failures.

Format Table reads pass filters indexed against the full table row type
together with a data row type that excludes partition columns.
MosaicRecordsReader evaluated row-group stats by field index, so a
partition column declared before the filtered column made the filter
read another column's stats: matching row groups were skipped or the
read failed with ArrayIndexOutOfBoundsException when
mosaic.stats-columns was set. Remap filters by name against the file
row type, as Parquet and ORC already do.

Generated-by: Claude Code
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] Mosaic Format Table filter reads wrong row-group stats when a partition column precedes the filtered column

1 participant