-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Destination Snowflake: break down ensureSchemaMatches #69117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: edgao/schema_evolution_test/cdk
Are you sure you want to change the base?
Destination Snowflake: break down ensureSchemaMatches #69117
Conversation
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
|
|
Note Detected that there are differences in the Gradle dependencies. |
745f4ca to
8e02044
Compare
22fd34e to
28cf33f
Compare
e8a9d6a to
8f8d2b0
Compare
28cf33f to
2969c0d
Compare
| @@ -1,3 +1,3 @@ | |||
| testExecutionConcurrency=-1 | |||
| cdkVersion=0.1.62 | |||
| cdkVersion=local | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I assume you don't want to commit this change
| ) | ||
| } | ||
|
|
||
| override fun diff(actualSchemaInfo: Unit, expectedSchemaInfo: Unit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the parameters marked as Unit? Is this to get around some generic issue with Kotlin and what we have type-wise in Snowflake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort of. it's more of a hack to support certain destinations that need to pass around more info than just column+type - #69090 (comment)
What
branched from #69090
How
There are a few major hacks here:
getColumnsFromStreamactually parses out the "NOT NULL", becauseSnowflakeColumnUtils.columnsAndTypesreturns strings likeNUMBER(38,0) NOT NULL. Probably would be nicer to have columnsAndTypes return the new ColumnType struct directly, instead of destination-snowflake's bespokeColumnAndType- but that would be a lot of code churn right nowColumnDefinition, b/c it wasn't actually used anywhere. But now ColumnDefinition is identical to ColumnAndType (which, again, we probably should delete entirely)...SqlGenerator.alterTablemanually filters out nullable -> non-nullable changes, b/c destination-snowflake actually tries to respect field nullability, but this alteration feels likely to cause problems. I could be convinced to just do the blind alter though.TODO unit tests are probably completely broken
Can this PR be safely reverted and rolled back?