You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "amogh-jahagirdar (via GitHub)" <gi...@apache.org> on 2025/09/15 18:09:42 UTC

Re: [PR] Core,Spark: fix broken metadata table when a column named 'partition' is also the partition key [iceberg]

amogh-jahagirdar commented on code in PR #14072:
URL: https://github.com/apache/iceberg/pull/14072#discussion_r2349755806


##########
api/src/main/java/org/apache/iceberg/PartitionSpec.java:
##########
@@ -400,6 +400,12 @@ Builder checkConflicts(boolean check) {
     private void checkAndAddPartitionName(String name, Integer sourceColumnId) {
       Types.NestedField schemaField =
           this.caseSensitive ? schema.findField(name) : schema.caseInsensitiveFindField(name);
+      // corner case: extra partition column in metadata table and whose field id is extremely large
+      if (null != schemaField
+          && schemaField.name().equals("partition")
+          && schemaField.fieldId() > 2000) {

Review Comment:
   Yeah I'd need to double check what's exactly breaking but all this resolution should be based on ids anyways and the partition metadata field ID would be different



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org