Add Materialized View support to the Iceberg Glue Catalog#11780
Add Materialized View support to the Iceberg Glue Catalog#11780findepi merged 3 commits intotrinodb:masterfrom
Conversation
|
@alexjo2144 please rebase your PR (i guess it conflicted with #11766) |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
schemaViewName -> materializedViewName
There was a problem hiding this comment.
I think I'd rather rename this to have consistency with what it's called in ConnectorMetadata, viewName. https://github.com/trinodb/trino/blob/master/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java#L1247
If we want to use materializedViewName instead we can do from there down.
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Smoke tests are testing only cases around CREATE, SELECT, SHOW CREATE and DROP.
We should be testing CREATE OR REPLACE, listing of MVs and RENAME as well with Glue. Is that already covered by other tests ?
There was a problem hiding this comment.
I didn't add any. Do you know if there's coverage in BaseConnectorTest? Yuya has a PR running that against Glue #11746
There was a problem hiding this comment.
We have coverage for listing and RENAME of MVs in BaseConnectorTest, but CREATE OR REPLACE doesn't seem to be covered there. Maybe we can move or copy TestIcebergMaterializedViews#testReplace to BaseConnectorTest if that is going to be run with Glue in future.
There was a problem hiding this comment.
For now I converted TestIcebergMaterializedViews to BaseIcebergMaterializedViewTest and added both a Hive and Glue backed implementation.
274bba4 to
9c34392
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/ViewReaderUtil.java
Outdated
Show resolved
Hide resolved
9c34392 to
ea48fc3
Compare
|
@alexjo2144 please squash and rebase |
ea48fc3 to
982b7d1
Compare
|
Squashed and rebased |
|
@findepi can you create a Trino mirror branch to run the Glue tests on? |
982b7d1 to
7adb70e
Compare
| LOG.warn(e, "Failed to drop storage table '%s' for materialized view '%s'", storageTableName, viewName); | ||
| } | ||
| } | ||
| deleteTable(schemaName, viewName); |
There was a problem hiding this comment.
Silly question, does it make sense to delete table that was not dropped correctly?
7adb70e to
5b4ea33
Compare
|
Updated the |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java
Outdated
Show resolved
Hide resolved
...c/test/java/io/trino/plugin/iceberg/catalog/glue/TestIcebergGlueCatalogAccessOperations.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Will something eventually clean these up when test is aborted in the middle (cleanup isn't invoked or fails)?
There was a problem hiding this comment.
I was going to put up a PR for cleanup across all these tests. I was thinking of adding a iceberg_integration_test_schema flag or something like that in the Glue schema properties to be able to filter them easily
...st/java/io/trino/plugin/iceberg/catalog/glue/TestIcebergGlueCatalogMaterializedViewTest.java
Outdated
Show resolved
Hide resolved
...st/java/io/trino/plugin/iceberg/catalog/glue/TestIcebergGlueCatalogMaterializedViewTest.java
Outdated
Show resolved
Hide resolved
...st/java/io/trino/plugin/iceberg/catalog/glue/TestIcebergGlueCatalogMaterializedViewTest.java
Outdated
Show resolved
Hide resolved
`viewName` matches the parameter name used in ConnectorMetadata.
40175f4 to
a3f00ad
Compare
|
( squashed and rebased ) |
a3f00ad to
45b697a
Compare
|
( applied #11780 ) |
|
Updated #11833 |
Description
Adds support for Materialized Views when using the Iceberg connector with Glue.
New feature
Connector, Iceberg.
Related issues, pull requests, and links
Documentation
Materialized Views are already described in the Iceberg documentation.
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: