feat: Use merge for delta and iceberg trino catalogs#5379
Closed
feat: Use merge for delta and iceberg trino catalogs#5379
Conversation
77bd715 to
329b2f2
Compare
eakmanrq
commented
Sep 15, 2025
Comment on lines
-345
to
-354
| def test_insert_overwrite_by_time_partition_replace_where_pandas( | ||
| make_mocked_engine_adapter: t.Callable, mocker: MockerFixture, make_temp_table_name: t.Callable | ||
| ): | ||
| mocker.patch( | ||
| "sqlmesh.core.engine_adapter.mssql.MSSQLEngineAdapter.table_exists", | ||
| return_value=False, | ||
| ) | ||
|
|
||
| adapter = make_mocked_engine_adapter(MSSQLEngineAdapter) | ||
| adapter.INSERT_OVERWRITE_STRATEGY = InsertOverwriteStrategy.REPLACE_WHERE |
Collaborator
Author
There was a problem hiding this comment.
This test didn't make sense. It was changing the MSSQL engine adapter to use REPLACE_WHERE and then showing that it did nothing. It would now do something but that is expected. I think it will likely a copy/paste mistake from other tests without understanding the intent.
Collaborator
Author
|
This won't work since Trino doesn't support "WHEN NOT MATCHED BY SOURCE": trinodb/trino#25871 |
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.
Prior to this PR, Trino engine against Iceberg and Delta Lake catalogs would use DELETE+INSERT without a transaction for insert/overwrite instead of MERGE. MERGE allows the operation to be atomic which is preferred.
Also did some cleanup by deprecating
InsertOverwriteWithMergeMixinand instead rely solely onINSERT_OVERWRITE_STRATEGY. Basically before we had two ways of doing the same thing so this consolidates into a single way.