Skip to content

IcebergInputSource : Add option to toggle case sensitivity while reading columns from iceberg catalog#16496

Merged
a2l007 merged 4 commits intoapache:masterfrom
a2l007:caseconfig
May 31, 2024
Merged

IcebergInputSource : Add option to toggle case sensitivity while reading columns from iceberg catalog#16496
a2l007 merged 4 commits intoapache:masterfrom
a2l007:caseconfig

Conversation

@a2l007
Copy link
Copy Markdown
Contributor

@a2l007 a2l007 commented May 23, 2024

Description

The column names defined in the iceberg catalog schema may not have the same case as those column names defined in the data files itself. Since the Iceberg table scan context enables case sensitivity by default, this can break filter calls during the scan operation if the column name cases don't match.
This PR adds config: caseSensitive to the Iceberg catalog spec of IcebergInputSource that toggles the case sensitivity. Setting this to false fixes the scenario described above.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

if (snapshotTime != null) {
tableScan = tableScan.asOfTime(snapshotTime.getMillis());
}
//Default case sensitivity is true for Iceberg TableScanContext
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Default case sensitivity is true for Iceberg TableScanContext
// Default case sensitivity is true for Iceberg TableScanContext

}
//Default case sensitivity is true for Iceberg TableScanContext
if (!isCaseSensitive()) {
tableScan = tableScan.caseSensitive(isCaseSensitive());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of relying on the upstream default value of true, we can always set this unconditionally: tableScan = tableScan.caseSensitive(isCaseSensitive())

@a2l007
Copy link
Copy Markdown
Contributor Author

a2l007 commented May 31, 2024

Thank you for the review @abhishekrb19 @asdf2014

@a2l007 a2l007 merged commit b53d757 into apache:master May 31, 2024
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
basapuram-kumar pushed a commit to acceldata-io/druid that referenced this pull request Jun 19, 2025
…ing columns from iceberg catalog (apache#16496)

* Toggle case sensitivity while reading columns from iceberg

* Fix tests

* Drop case check and set unconditionally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants