Skip to content

Conversation

@alexjo2144
Copy link
Member

Description

Fixes: #20837

As well as some other edge cases which can happen if a CREATE MATERIALIZED VIEW operation fails.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Iceberg
* Fix dropping materialized views which were created before 433 when using a Hive catalog.
* Improve storage table cleanup when creating a materialized view fails.

Copy link
Member

Choose a reason for hiding this comment

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

sorry if this is a silly question but why dropping storage table when update failed? I understand doing it when create failed, but for update im not so sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

So the case here is when you do a CREATE OR REPLACE MV and there is a MV with that name already. In that case we create a new storage table. If the update fails, the new storage table is cleaned up here because it is not referenced by the MV.

There is something missing here though, when you do a replace the old storage table is not cleaned up on a successful operation. Should do that here.

Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

LGTM but mind @homar 's comment

@alexjo2144 alexjo2144 force-pushed the ajo/mv-storage-cleanup branch from 77a242e to 305f995 Compare March 4, 2024 18:47
@alexjo2144
Copy link
Member Author

@findepi can you kick off a test with secrets?

@alexjo2144 alexjo2144 force-pushed the ajo/mv-storage-cleanup branch 2 times, most recently from ec4eeb3 to cb07273 Compare March 4, 2024 19:46
@ebyhr
Copy link
Member

ebyhr commented Mar 4, 2024

/test-with-secrets sha=cb0727336de48b9c28841c7aaf2f34fda99d8c38

@github-actions
Copy link

github-actions bot commented Mar 4, 2024

The CI workflow run with tests that require additional secrets has been started: https://github.com/trinodb/trino/actions/runs/8147198341

@alexjo2144 alexjo2144 force-pushed the ajo/mv-storage-cleanup branch from cb07273 to 9f93352 Compare March 18, 2024 19:20
@alexjo2144
Copy link
Member Author

Rebased but I think this should be good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed iceberg Iceberg connector

Development

Successfully merging this pull request may close these issues.

Dropping a MATERIALIZED VIEW fails in the latest versions.

4 participants