Skip to content

[format] Drop nested filters on unprojected Parquet fields before conversion - #10379

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/parquet-nested-unprojected-filter
Open

thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/parquet-nested-unprojected-filter

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #10378

  • Java table reads lose matching rows when withReadType prunes a nested field that a filter references (s.b = 7 with s ROW<a>), without executeFilter().
  • [format] Drop filters on unprojected columns before Parquet conversion #9858 drops filters on unprojected columns but checks only top-level names; after [core][format][spark] Support nested field predicate pushdown #9423 enabled nested pushdown, s.b passes and Parquet reads it as all-null.
  • ParquetReaderFactory now also requires the whole nested path in the read type. AND keeps projected conjuncts; an OR touching a pruned path is dropped.
  • Only the Java ReadBuilder path is affected. Flink/Spark SQL keep filter fields in the read type; executeFilter() is already safe.

Tests

  • Added AppendOnlySimpleTableTest#testParquetFilterOnUnprojectedNestedField; fails on master.
  • Added ParquetReadWriteTest#testReadWithUnprojectedNestedFilter (AND, OR); both fail on master.
  • ParquetReadWriteTest 54/54 and AppendOnlySimpleTableTest 114/114 pass; checkstyle and spotless pass on paimon-format and paimon-core.

…version

ParquetReaderFactory drops conjuncts whose top-level columns are not in
the read type, but a nested field predicate (s.b) passed that check as
long as s was projected. When the read type prunes s to ROW<a>, Parquet
reads the unrequested s.b column as all-null and skips row groups that
contain matching rows. Also require the whole nested path to survive the
read type; an OR touching a pruned path is dropped as a whole.

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] Java Parquet reads drop matching rows when a filtered nested field is pruned from the read type

1 participant