Skip to content

Add Materialized View support to the Iceberg Glue Catalog#11780

Merged
findepi merged 3 commits intotrinodb:masterfrom
alexjo2144:glue-iceberg-mv
Apr 13, 2022
Merged

Add Materialized View support to the Iceberg Glue Catalog#11780
findepi merged 3 commits intotrinodb:masterfrom
alexjo2144:glue-iceberg-mv

Conversation

@alexjo2144
Copy link
Copy Markdown
Member

@alexjo2144 alexjo2144 commented Apr 4, 2022

Description

Adds support for Materialized Views when using the Iceberg connector with Glue.

Is this change a fix, improvement, new feature, refactoring, or other?

New feature

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Connector, Iceberg.

How would you describe this change to a non-technical end user or system administrator?

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:

# Iceberg
* Materialized View support to the Iceberg Glue Catalog

@cla-bot cla-bot bot added the cla-signed label Apr 4, 2022
@alexjo2144 alexjo2144 requested a review from findepi April 4, 2022 20:21
@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 5, 2022

@alexjo2144 please rebase your PR (i guess it conflicted with #11766)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

schemaViewName -> materializedViewName

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't add any. Do you know if there's coverage in BaseConnectorTest? Yuya has a PR running that against Glue #11746

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For now I converted TestIcebergMaterializedViews to BaseIcebergMaterializedViewTest and added both a Hive and Glue backed implementation.

@sopel39 sopel39 removed their request for review April 5, 2022 13:05
@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 6, 2022

@alexjo2144 please squash and rebase

@alexjo2144
Copy link
Copy Markdown
Member Author

Squashed and rebased

@alexjo2144
Copy link
Copy Markdown
Member Author

@findepi can you create a Trino mirror branch to run the Glue tests on?

@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 6, 2022

@findepi can you create a Trino mirror branch to run the Glue tests on?

#11833

LOG.warn(e, "Failed to drop storage table '%s' for materialized view '%s'", storageTableName, viewName);
}
}
deleteTable(schemaName, viewName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Silly question, does it make sense to delete table that was not dropped correctly?

@findepi findepi requested a review from ebyhr April 7, 2022 12:08
@alexjo2144
Copy link
Copy Markdown
Member Author

Updated the GET_TABLE counts in TestIcebergGlueCatalogAccessOperations

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will something eventually clean these up when test is aborted in the middle (cleanup isn't invoked or fails)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@alexjo2144 alexjo2144 requested a review from findepi April 11, 2022 14:52
@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 13, 2022

( squashed and rebased )

@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 13, 2022

( applied #11780 )

@findepi
Copy link
Copy Markdown
Member

findepi commented Apr 13, 2022

Updated #11833

@findepi findepi merged commit f752c82 into trinodb:master Apr 13, 2022
@findepi findepi mentioned this pull request Apr 13, 2022
@github-actions github-actions bot added this to the 377 milestone Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants