fix(destination-s3-data-lake): produce lowercase column names for Glue catalog compatibility#76059
Draft
devin-ai-integration[bot] wants to merge 5 commits into
Draft
Conversation
…e catalog compatibility Add S3DataLakeTableSchemaMapper to transform column names using Transformations.toAlphanumericAndUnderscore() followed by .lowercase(), matching the pattern used by the GCS Data Lake connector. Also add transformSchemaWithMappedNames() to S3DataLakeStreamLoader to post-process the Iceberg schema with the mapped column names from the stream's table schema. Resolves airbytehq/oncall#11856 Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit e0728d7. |
Co-Authored-By: bot_apk <apk@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The S3 Data Lake connector does not produce lowercase column names when writing to the Glue catalog, which breaks downstream engines like Snowflake and Athena.
The connector was missing a custom
TableSchemaMapperimplementation and fell back toNoopTableSchemaMapper, which passes column names through unchanged. The sibling GCS Data Lake connector already has a working implementation of this pattern.Resolves https://github.com/airbytehq/oncall/issues/11856
Original issue: #76058
How
New
S3DataLakeTableSchemaMapper— ImplementsTableSchemaMapperwith@Singleton.toColumnName()callsTransformations.toAlphanumericAndUnderscore(name).lowercase()to sanitize and lowercase all column names.toFinalTableName()applies the same transformation to namespace and table name.transformSchemaWithMappedNames()inS3DataLakeStreamLoader— Post-processes the Iceberg schema produced byIcebergUtil.toIcebergSchema()to replace original column names with the mapped (lowercased) names fromstream.tableSchema.columnSchema.inputToFinalColumnNames. Airbyte metadata columns are skipped since they are already valid.Both changes follow the pattern established by
GcsDataLakeTableSchemaMapperandGcsDataLakeStreamLoader.Review guide
S3DataLakeTableSchemaMapper.kt— New file. Core fix lives intoColumnName()(line 41). Review thetoColumnType()mappings — these were copied from the GCS connector (BigLake/Parquet types) and should be verified for S3/Glue correctness.S3DataLakeStreamLoader.kt— Lines 46–89. ThetransformSchemaWithMappedNames()method and the changedincomingSchemainitialization.S3DataLakeTableSchemaMapperTest.kt— Unit tests for the mapper.metadata.yaml— Version bump to 0.3.47.docs/integrations/destinations/s3-data-lake.md— Changelog entry.User Impact
Column names written to the Glue catalog will now be lowercase and sanitized (special characters replaced with underscores). This fixes compatibility with Snowflake, Athena, and other engines that require lowercase Glue identifiers.
For existing tables with mixed-case column names: the schema evolution logic in
IcebergTableSynchronizerwill see the lowercased names as new columns. Reviewers should verify the behavior here — it may require a full refresh for affected streams.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/4328e94738f64f5880a3d21a37916762