Skip to content

fix: Populate record_count for parquet source files - #929

Open
zhang-arvin wants to merge 1 commit into
apache:mainfrom
zhang-arvin:fix/926-parquet-record-count
Open

fix: Populate record_count for parquet source files#929
zhang-arvin wants to merge 1 commit into
apache:mainfrom
zhang-arvin:fix/926-parquet-record-count

Conversation

@zhang-arvin

Copy link
Copy Markdown
Contributor

Fixes #926

What changes were proposed in this pull request?

ParquetConversionSource never populated recordCount on the InternalDataFiles it creates (both the full-sync and incremental paths), leaving it at the primitive default of 0. Both targets serialize that faithfully, so every registered file showed record_count = 0 and engines answering aggregates from metadata (Spark's optimized count(*), Iceberg's .files, Delta's numRecords) returned 0 rows for non-empty tables.

How was this patch tested?

  • ./mvnw -pl xtable-core -am -DskipTests compile
  • Existing ITParquetConversionSource suite covers the conversion paths (local run pending CI).

Fixes apache#926: InternalDataFile construction in ParquetConversionSource never
set recordCount, so targets registered every file with record_count = 0 and
optimized count(*) returned 0 on non-empty tables.

Sum BlockMetaData.getRowCount() from the parquet footer and set it on both
full-sync and incremental-sync file construction paths.
@the-other-tim-brown

Copy link
Copy Markdown
Contributor

@zhang-arvin can you add or update some existing tests to ensure we don't regress in the future?

@zhang-arvin zhang-arvin changed the title [Bug] Populate record_count for parquet source files fix: Populate record_count for parquet source files Sep 10, 2026
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.

Parquet source: record_count is never populated, so optimized count(*) returns 0 on non-empty tables

2 participants