-
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
Handle missing MV StorageDescriptor in Glue #17383
Handle missing MV StorageDescriptor in Glue #17383
Conversation
// Not a view TODO getView should return empty | ||
assertThatThrownBy(() -> metadata.getView(session, table)) | ||
.isInstanceOf(TrinoException.class) | ||
.hasMessage("View data missing prefix: /* Presto Materialized View: eyJvcmlnaW5hbFNxbCI6IlNFTEVDVCAxIiwiY29sdW1ucyI6W3sibmFtZSI6ImEiLCJ0eXBlIjoiaW50ZWdlciJ9XX0= */"); |
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.
Will be fixed by #17276 .
Handle case when `StorageDescriptor` is missing in a materialized view table object stored in Glue.
The `convertParameters` converts parameters from Glue model to Trino model (basically null checks). It should not be called on parameters coming from Trino model.
6f382fc
to
20eb224
Compare
This follows the guards we have for accessing Table.getTableType. This obsoletes `convertParameters` method, so it got removed.
20eb224
to
caec2f6
Compare
@@ -164,7 +164,8 @@ public static boolean isTrinoMaterializedView(String tableType, Map<String, Stri | |||
public static boolean canDecodeView(Table table) | |||
{ | |||
// we can decode Hive or Presto view | |||
return table.getTableType().equals(VIRTUAL_VIEW.name()); | |||
return table.getTableType().equals(VIRTUAL_VIEW.name()) && | |||
!isTrinoMaterializedView(table.getTableType(), table.getParameters()); |
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 was proposed in #15221 but back then we couldn't test it. Now we can thanks to the test added by Grant.
canDecodeView
should be removed (#17276 (comment)), leaving this to a follow-up (#17276).
test (plugin/trino-bigquery) rate limiting
test (plugin/trino-hive) #17412 test (plugin/trino-iceberg, minio-and-avro) #11140 (comment) |
Handle case when
StorageDescriptor
is missing in a materialized view table object stored in Glue.@grantatspothero 's #17276 with reduced scope
Fixes: #17274