AP24110011695 commented on issue #4396: URL: https://github.com/apache/iceberg-python/issues/4396#issuecomment-7226882525
Verified on pyarrow 26.0.1 (Windows, Python 3.12) why the `add_files` / `parquet_file_to_data_file` path can't be fixed the way the write path was: the public parquet metadata API exposes no NaN count at all. - `ColumnChunkMetaData.statistics` (`pyarrow._parquet.Statistics`) offers only `min`, `max`, `null_count`, `distinct_count`, `num_values` — no `nan_count`/`has_nan_count` attribute, matching the original report. - Additionally, pyarrow's own writer excludes NaNs from the footer min/max: a column written as `[1.0, nan, null, nan]` reads back `min=1.0, max=1.0, null_count=1` — so the NaNs are unrecoverable from the metadata alone, not just unexposed. So the write-path fix (#4401, computing counts from the arrow table) is the only source of NaN counts available today, and the import path stays dependent on option B (pyarrow surfacing the thrift `nan_count`). Nested-field counting on the write path — the other follow-up Fokko left in https://github.com/apache/iceberg-python/pull/4401 — is covered by #4131. Leaving this issue open as the tracker for the `add_files` path until that lands upstream. AI disclosure: this verification was performed with AI assistance; the probe is a 4-line `pq.write_table` + `read_metadata` check against the installed pyarrow, reproducible on any version ≥ 20. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
