nssalian opened a new pull request, #16585: URL: https://github.com/apache/iceberg/pull/16585
Closes [#16567](https://github.com/apache/iceberg/issues/16567) ### Rationale for this change Spark writes to Iceberg tables with shredded VARIANT columns crash with `NoSuchElementException` during `DataWriter.close()` when the variant `value` sub-column has no usable parquet `Statistics`. Matches the iceberg-go [#932](https://github.com/apache/iceberg-go/pull/932) approach for variant sub-columns lacking stats. ### What changes are included in this PR? `MetricsVariantVisitor.value()` returns empty bounds when `valueResult` is empty, instead of calling `Iterables.getOnlyElement` on it. ### Are these changes tested? Yes. `testShreddedValueColumnWithEmptyStats` writes a shredded variant with parquet stats disabled. Fails with the issue's exact stack trace without the fix; passes with it. ### Are there any user-facing changes? No. Crash becomes graceful drop of bounds for the affected variant column. -- 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]
