-
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
Support views in iceberg connector #2703
Conversation
Please add a test in |
presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
@alexey-fin Please see why few checks fail. |
@alexey-fin Any update on the PR? It will be good to enable view support in the iceberg connector. |
Sorry, @vrozov, will get back to it as soon as i can |
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.
Overall looks good. When updating, please squash the commits so that we have two commits titled
- Extract commit view functions to HiveUtil
- Add support for views to Iceberg
@@ -1710,24 +1685,11 @@ public void dropView(ConnectorSession session, SchemaTableName viewName) | |||
@Override | |||
public Optional<ConnectorViewDefinition> getView(ConnectorSession session, SchemaTableName viewName) | |||
{ | |||
return metastore.getTable(new HiveIdentity(session), viewName.getSchemaName(), viewName.getTableName()) | |||
HiveIdentity identity = new HiveIdentity(session); |
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.
This can stay inlined in the getTable
call
.setParameters(properties) | ||
.setViewOriginalText(Optional.of(encodeViewData(definition))) | ||
.setViewExpandedText(Optional.of("/* Presto View */")); | ||
Table table = HiveUtil.buildViewTable(definition, viewName, owner, session.getQueryId(), prestoVersion); |
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.
Static import buildViewTable
.build(); | ||
String owner = session.getUser(); | ||
|
||
Table table = HiveUtil.buildViewTable(definition, viewName, owner, session.getQueryId(), prestoVersion); |
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.
Static import buildViewTable
Note that we still need tests in |
@alexey-fin Are you still interested in this? Would you like someone else to take this over? |
Superseded by #8540 |
CREATE/GET/DROP VIEW
I copied functions from HiveMetadata, adjusting for not having SemiTransactionalHiveMetastore