Skip to content

Flink: Fix DynamicIcebergSink writing NULLs for case-mismatched columns - #18066

Open
mithun-sudo wants to merge 3 commits into
apache:mainfrom
mithun-sudo:flink-dynamic-sink-case-insensitive-converter
Open

Flink: Fix DynamicIcebergSink writing NULLs for case-mismatched columns#18066
mithun-sudo wants to merge 3 commits into
apache:mainfrom
mithun-sudo:flink-dynamic-sink-case-insensitive-converter

Conversation

@mithun-sudo

Copy link
Copy Markdown

Summary

  • DynamicIcebergSink with caseSensitive(false) can write NULL for columns whose names differ only by case.
  • CompareSchemasVisitor matches names case-insensitively and returns DATA_CONVERSION_NEEDED, but DataConverter used RowType.getFieldIndex (exact match), so the source field looked missing.
  • Thread caseSensitive into DataConverter and look up fields with equalsIgnoreCase when matching is case-insensitive.

Test plan

  • TestRowDataConverter case-insensitive remap (values kept, missing optional field is null)
  • TestDynamicIcebergSink.testCaseInsensitiveDataConversionDropsValues
  • ./gradlew :iceberg-flink:iceberg-flink-2.3:test -DflinkVersions=2.3 --tests org.apache.iceberg.flink.sink.dynamic.TestRowDataConverter --tests org.apache.iceberg.flink.sink.dynamic.TestDynamicIcebergSink.testCaseInsensitiveDataConversionDropsValues

@github-actions github-actions Bot added the flink label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant