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

   Closes #15392
   
   ## Summary
   
   - With a name mapping configured, `RecordConverter.lookupStructField` 
ignored `iceberg.tables.schema-case-insensitive`: fields differing only in case 
failed to match, and schema evolution then created duplicate columns.
   - The `nameMapping == null` branch already handles this via 
`schema.caseInsensitiveField`; the name-mapping path did not.
   - Fix: normalize the name map keys on both `put` (`createStructNameMap`) and 
`get` (`lookupStructField`) to lower case with `Locale.ROOT` when 
case-insensitive.
   - Revives the approach from the stale-closed #15393 (credit to @annurahar).
   
   ## Testing done
   
   - Added `TestRecordConverter#testNameMappingWithDifferentCaseAlias`, 
parameterized over case-insensitive true/false: an exact-case alias always 
matches; a different-case input matches only when case-insensitive.
   - Regression: with the test in place but the fix reverted, the 
`caseInsensitive = true` case fails (expected 200, got null); with the fix it 
passes.
   - `./gradlew :iceberg-kafka-connect:iceberg-kafka-connect:check` passed; 
`TestRecordConverter` runs 51 tests, 0 failures.
   - Module is not a REVAPI target, so no revapi run.
   
   ---
   **AI Disclosure**
   - Model: Claude Opus 4.8
   - Platform/Tool: Claude Code
   - Human Oversight: human reviewed before submission
   - Prompt Summary: Implement the case-insensitive name-mapping lookup fix in 
RecordConverter, add a regression test, and verify via the module check task.
   


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