You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "annurahar (via GitHub)" <gi...@apache.org> on 2026/02/21 10:58:58 UTC

[I] Kafka Connect: `iceberg.tables.schema-case-insensitive` config is ignored when name mapping is present [iceberg]

annurahar opened a new issue, #15392:
URL: https://github.com/apache/iceberg/issues/15392

   ### Apache Iceberg version
   
   1.10.1 (latest release)
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   When using Kafka Connect with both:
   1. Name mapping configured via `schema.name-mapping.default` table property
   2. Case-insensitive schema matching enabled via `iceberg.tables.schema-case-insensitive=true`
   
   The case-insensitive setting is ignored during field lookup. This causes records with field names that differ only in case (e.g., `"II"` vs `"ii"`) to fail to match the existing column.
   
   ## Root Cause
   In `RecordConverter.java`, the `lookupStructField` and `createStructNameMap` methods do not apply case-insensitive logic when name mapping is present:
   
   **Current behavior in `lookupStructField`:**
   ```java
   if (nameMapping == null) {
     return config.schemaCaseInsensitive()
         ? schema.caseInsensitiveField(fieldName)
         : schema.field(fieldName);
   }
   
   // Case sensitivity is NOT applied here when nameMapping is present
   return structNameMap
       .computeIfAbsent(structFieldId, notUsed -> createStructNameMap(schema))
       .get(fieldName);  // Uses original fieldName without lowercasing
   ```
   
   **Current behavior in `createStructNameMap`:**
   ```java
   if (mappedField != null && !mappedField.names().isEmpty()) {
     mappedField.names().forEach(name -> map.put(name, col));  // No case handling
   } else {
     map.put(col.name(), col);  // No case handling
   }
   ```
   
   ## Expected behavior
   When `iceberg.tables.schema-case-insensitive=true` is configured, field lookups should be case-insensitive regardless of whether name mapping is present or not.
   
   ## Steps to reproduce
   1. Create an Iceberg table with a name mapping that has an alias with different case (e.g., alias `"II"` for column `"ii"`)
   2. Configure Kafka Connect with `iceberg.tables.schema-case-insensitive=true`
   3. Send a record with the field name in lowercase (e.g., `{"ii": 123}`)
   4. **Expected**: Field should be matched to existing column and written to the table
   5. **Actual**: Field is not matched to existing column
   
   ## Impact
   During schema evolution, the unmatched field is treated as a new field, causing a duplicate column to be added to the table (e.g., both `"II"` and `"ii"` columns exist). This results in:
   - Unintended schema changes with redundant columns
   - Data written to wrong columns
   - Table schema corruption over time
   
   ## Suggested Fix
   Modify `lookupStructField` and `createStructNameMap` to apply case-insensitive logic when name mapping is present.
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


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


Re: [I] Kafka Connect: `iceberg.tables.schema-case-insensitive` config is ignored when name mapping is present [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #15392:
URL: https://github.com/apache/iceberg/issues/15392#issuecomment-5363596556

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


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


Re: [I] Kafka Connect: `iceberg.tables.schema-case-insensitive` config is ignored when name mapping is present [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #15392: Kafka Connect: `iceberg.tables.schema-case-insensitive` config is ignored when name mapping is present
URL: https://github.com/apache/iceberg/issues/15392


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


Re: [I] Kafka Connect: `iceberg.tables.schema-case-insensitive` config is ignored when name mapping is present [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #15392:
URL: https://github.com/apache/iceberg/issues/15392#issuecomment-5533884519

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


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