Handle missing StorageDescriptor in Hive Glue materialized views#17276
Handle missing StorageDescriptor in Hive Glue materialized views#17276grantatspothero wants to merge 3 commits intotrinodb:masterfrom
Conversation
plugin/trino-hive/src/main/java/io/trino/plugin/hive/ViewReaderUtil.java
Outdated
Show resolved
Hide resolved
a018848 to
309e8f7
Compare
...o-hive/src/main/java/io/trino/plugin/hive/metastore/glue/converter/GlueToTrinoConverter.java
Outdated
Show resolved
Hide resolved
...n/trino-hive/src/test/java/io/trino/plugin/hive/metastore/glue/TestGlueToTrinoConverter.java
Outdated
Show resolved
Hide resolved
0ebce8b to
26948f5
Compare
26948f5 to
9e5876f
Compare
9e5876f to
10867ab
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/ViewReaderUtil.java
Outdated
Show resolved
Hide resolved
...berg/src/main/java/io/trino/plugin/iceberg/catalog/hms/AbstractMetastoreTableOperations.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/trino/plugin/deltalake/metastore/HiveMetastoreBackedDeltaLakeMetastore.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/ViewReaderUtil.java
Outdated
Show resolved
Hide resolved
127fb6c to
17f2300
Compare
There was a problem hiding this comment.
isHiveOrPrestoView(mv) // returns false
isPrestoView(mv) // returns true
however, per it's name, isHiveOrPrestoView should be superset of isPrestoView, right?
There was a problem hiding this comment.
Makes sense from a consistency standpoint.
Removed isHiveOrPrestoView and the behavior can be replicated with isViewOrMaterializedView(view) && !isTrinoMaterializedView(view).
I think this makes sense from an API standpoint. I do not think a method like isView should exist because it is unclear if view refers to materialized or not.
|
This PR this good in a way it approaches to untangle technical debt around |
isViewOrMaterializedView and isTrinoMaterializedView
17f2300 to
78b9dc8
Compare
|
Almost there! Fixed final comment and added one rename commit for Please take another look. |
16f5623 to
a43a1ba
Compare
renamed for consistency with the rest of the isView methods
a43a1ba to
e8a44d1
Compare
| import static io.trino.plugin.deltalake.DeltaLakeMetadata.PATH_PROPERTY; | ||
| import static io.trino.plugin.hive.TableType.MANAGED_TABLE; | ||
| import static io.trino.plugin.hive.ViewReaderUtil.isHiveOrPrestoView; | ||
| import static io.trino.plugin.hive.ViewReaderUtil.isViewOrMaterializedView; |
There was a problem hiding this comment.
Remove isHiveOrPrestoView and replace usages with
This ^ is the commit title. Looks truncated. See https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#format-git-commit-messages
| public static boolean isTrinoMaterializedView(Map<String, String> tableParameters) | ||
| { | ||
| return isPrestoView(tableParameters) && tableParameters.get(TABLE_COMMENT).equalsIgnoreCase(ICEBERG_MATERIALIZED_VIEW_COMMENT); | ||
| return isTrinoView(tableParameters) && tableParameters.get(TABLE_COMMENT).equalsIgnoreCase(ICEBERG_MATERIALIZED_VIEW_COMMENT); |
There was a problem hiding this comment.
is it obvious that isTrinoView can be true also for materialized view?
to me, a materialized view is a separate type, not a subclass of view. especially given that it has separate handling in ConnectorMetadata
that's perhaps why you introduced isViewOrMaterializedView method -- you didn't call it isView, as would be sufficient if materialized views were always treated as a subcategory of views
| if (isIcebergTable(tableParameters) || (sd == null && isDeltaLakeTable(tableParameters))) { | ||
| if (isIcebergTable(tableParameters) || | ||
| (sd == null && isDeltaLakeTable(tableParameters)) || | ||
| (sd == null && isTrinoMaterializedView(firstNonNull(glueTable.getParameters(), Map.of())))) { |
There was a problem hiding this comment.
you already have tableParameters
(will address this in #17383)
|
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
|
👋 @grantatspothero @findepi - this PR has become inactive. If you're still interested in working on it, please let us know. We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks. |
|
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
|
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
|
Feels like this should be reopened and continued.. wdyt @grantatspothero ? |
Description
Fixes: #17274
Additional context and related issues
Related PR that fixed some of the issues with null storage descriptors with glue, but did not handle materialized views: https://github.com/trinodb/trino/pull/11092/files
Release notes
( ) This is not user-visible or 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: