hariuserx opened a new pull request, #12886:
URL: https://github.com/apache/iceberg/pull/12886
Currently when performing add_files procedure through Apache Spark, we treat
null partitions as `"null"` (String literal). This causes a
`NumberFormatException` when adding null partitions when the partition column
type is not a string.
```
Caused by: java.lang.NumberFormatException: For input string: "null"
at
java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:668)
at java.base/java.lang.Integer.valueOf(Integer.java:999)
at
org.apache.iceberg.types.Conversions.fromPartitionString(Conversions.java:51)
at org.apache.iceberg.DataFiles.fillFromValues(DataFiles.java:106)
```
When the partition column type is a string, we incorrectly add the data
files to `"null"` (String literal) partition.
<img width="517" alt="Screenshot 2025-04-23 at 5 59 15 PM"
src="https://github.com/user-attachments/assets/e68de0f8-b5d5-4a9b-bd9b-43aa95531807"
/>
**Testing:**
1. Added two new tests which will fail without this change.
2. Ran all tests in `TestAddFilesProcedure.java`
--
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]