bobmerevel opened a new pull request, #16846:
URL: https://github.com/apache/iceberg/pull/16846

   ## What changes are proposed in this pull request?
   
   This PR adds a fail-fast validation in `BaseSparkAction.newStaticTable()` to 
ensure that `TableMetadata.metadataFileLocation()` is not null before 
constructing a `BaseTable`.
   
   Currently, if the metadata file location is null, the Spark action proceeds 
further into execution and eventually fails with a `NullPointerException`, 
making the actual root cause difficult to diagnose.
   
   The new validation makes this precondition explicit and produces a more 
meaningful error message.
   
   ## Why are the changes needed?
   
   This improves diagnostics for invalid `TableMetadata` instances and prevents 
failures from surfacing much later during Spark job execution.
   
   The intent is not to support invalid catalog implementations, but to fail 
earlier with a clearer message when the required precondition is violated.
   
   ## Does this PR introduce any user-facing change?
   
   No.
   
   ## How was this patch tested?
   
   Added a unit test covering the case where `metadataFileLocation()` is null 
and verified that `newStaticTable()` fails with an explicit exception.
   
   ## AI assistance disclosure:
   I used AI assistance while drafting the PR description and exploring 
possible test implementations. The final implementation and testing were 
reviewed and verified manually.
   
   Closes #16838


-- 
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]

Reply via email to