-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove Iceberg materialized view storage tables from metastores #18853
Conversation
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.
(skimming)
plugin/trino-hive/src/main/java/io/trino/plugin/hive/ViewReaderUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java
Outdated
Show resolved
Hide resolved
...eberg/src/main/java/io/trino/plugin/iceberg/IcebergMaterializedViewAdditionalProperties.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTableName.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/MaterializedViewTableOperations.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/MaterializedViewTableOperations.java
Outdated
Show resolved
Hide resolved
...no-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java
Show resolved
Hide resolved
...o-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java
Show resolved
Hide resolved
988550d
to
f984097
Compare
@findepi comments applied, PTAL when you get a chance. |
A test with secrets would also be great |
/test-with-secrets sha=f9840979650b7774cbe5383eb8c31e9e4aba8a58 |
The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/6143712396 |
failure looks related |
Indeed |
ed9a0b0
to
b441b7f
Compare
/test-with-secrets sha=b441b7fc458c58754ab0b8607dd488a537325f7d |
The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/6175817369 |
Failure on the run with secrets was in the databricks delta lake suite, unrelated. |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableType.java
Outdated
Show resolved
Hide resolved
...iceberg/src/main/java/io/trino/plugin/iceberg/catalog/file/FileMetastoreTableOperations.java
Show resolved
Hide resolved
...no-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java
Show resolved
Hide resolved
...o-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractTrinoCatalog.java
Outdated
Show resolved
Hide resolved
...rino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergMetastoreAccessOperations.java
Show resolved
Hide resolved
return hideMaterializedViewStorageTableEnabled; | ||
} | ||
|
||
@Config("iceberg.materialized-views.hide-storage-tables") |
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.
Please add a test using iceberg.materialized-views.hide-storage-tables=false
.
We need to ensure that Trino can still read/refresh this kind of materialized views.
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.
talked offline that this can be a follow-up.
b441b7f
to
5364952
Compare
(rebased) |
110cf6e
to
8030954
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractTrinoCatalog.java
Outdated
Show resolved
Hide resolved
69c5447
to
9759483
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractTrinoCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Show resolved
Hide resolved
@@ -6701,30 +6701,6 @@ public void testSnapshotSummariesHaveTrinoQueryIdFormatV2() | |||
"WHEN MATCHED THEN UPDATE SET b = t.b * 50", tableName, sourceTableName))); | |||
} | |||
|
|||
@Test | |||
public void testMaterializedViewSnapshotSummariesHaveTrinoQueryId() |
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 this change?
01f0c4f
to
28892f7
Compare
/test-with-secrets sha=28892f73b45825172bf0fa552a832753466a602e |
The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/6801273645 |
The FILE_FORMAT_PROPERTY table property has a default value, so no need for explicit default in the code.
The helper method always returns a value
28892f7
to
1457de6
Compare
Storage tables clutter the namespace, and do not need a separate metastore entry. The pointer to the current metadata file is instead stored in the materialized view properties. This applies only to newly created materialized views, existing ones are not effected.
1457de6
to
5293ddb
Compare
Modified the release notes entry and added. |
Hi @alexjo2144, Now, system.metadata.materiazed_views is saying the storage table name is view_name$materialized_view_storage and spark ends with error: |
Hey @wobrycki With the new behavior, no you won't be able to do that. I didn't think reading MV storage tables from Spark would be something anyone was doing. How do you figure out which storage table belongs to each MV? Or do you just list tables and then call a procedure like For now, you can return to the previous behavior by setting On the other hand, if it's file compaction ( |
Description
Storage tables clutter the namespace, and do not need a separate metastore entry. The pointer to the current metadata file is instead stored in the materialized view properties.
This applies only to newly created materialized views, existing ones are not effected.
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: