Skip to content

[1046] Read the column stats of a list of primitives under its list element name - #1051

Draft
yihua wants to merge 1 commit into
apache:mainfrom
yihua:xt-1046-list-column-stats
Draft

yihua wants to merge 1 commit into
apache:mainfrom
yihua:xt-1046-list-column-stats

Conversation

@yihua

@yihua yihua commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Important Read

Closes #1046, part of #722.

What is the purpose of the pull request

A Hudi table with a list of primitives no longer fails its first sync with a NullPointerException. Hudi's column stats reader names a list element <list>.list.element in either list layout, so the extractor now asks for that name, and skips a range whose column maps to no field.

Brief change log

  • HudiFileStatsExtractor uses list.element for every list element.
  • TestHudiFileStatsExtractor checks the stats of the list element in both list layouts, besides the columns next to the list.

Known limitations:

  • Element stats of a list of primitives were looked up under <list>.array in metadata table column stats before; an old metadata table that stored that name loses those stats.

Verify this pull request

This change added tests and can be verified as follows:

  • TestHudiFileStatsExtractor writes a struct holding an int, a list of ints and a map in Parquet's two-level and three-level list layouts, and checks the row count, the stats of the columns next to the list and the stats of the list element.
  • Run locally on JDK 11: 598 xtable-core unit tests pass (3 skipped), the xtable-core Iceberg ITs pass, and the Iceberg table format's 26 unit tests and 46 ITs pass (1 skipped).

…lement name

A Hudi table with a list of primitives failed its first publish with a
NullPointerException while the column stats of a base file were read from
its footer. Hudi's column stats reader names every list element
<list>.list.element, whichever list layout the file uses. The extractor
asked for the element as <list>.array and renamed it to list.element only
when a nested field followed, so the key of a list of primitives matched
none of the ranges that came back, and the range was converted with a null
field.

The key now uses list.element for every list element, whether the element
is a leaf or a struct. A range whose column name maps to no field is
skipped, so a name the extractor does not know costs the stats of that
column and not the publish.

A new test writes a struct that holds an int, a list of ints and a map
with Parquet's two-level and three-level list layouts, and checks the row
count, the stats of the columns next to the list and the stats of the list
element.

This branch has not been deployed

No deployments
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.

Hudi source: NullPointerException reading the column stats of a list of primitives

1 participant