Skip to content
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

Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented May 8, 2023

Handle case when StorageDescriptor is missing in a materialized view table object stored in Glue.

@grantatspothero 's #17276 with reduced scope

Fixes: #17274

// 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= */");
Copy link
Member Author

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 .

@github-actions github-actions bot added hive Hive connector tests:hive labels May 8, 2023
grantatspothero and others added 2 commits May 9, 2023 11:00
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.
@findepi findepi force-pushed the findepi/handle-missing-mv-storagedescriptor-in-glue-57ac88 branch from 6f382fc to 20eb224 Compare May 9, 2023 09:29
@github-actions github-actions bot added the iceberg Iceberg connector label May 9, 2023
findepi added 2 commits May 9, 2023 12:57
This follows the guards we have for accessing Table.getTableType.

This obsoletes `convertParameters` method, so it got removed.
@findepi findepi force-pushed the findepi/handle-missing-mv-storagedescriptor-in-glue-57ac88 branch from 20eb224 to caec2f6 Compare May 9, 2023 10:57
@@ -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());
Copy link
Member Author

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).

@findepi
Copy link
Member Author

findepi commented May 9, 2023

test (plugin/trino-bigquery) rate limiting

Error:  Failures: 
Error:    TestBigQueryAvroConnectorTest>BaseConnectorTest.testCommentColumn:3687->AbstractTestQueryFramework.assertUpdate:395->AbstractTestQueryFramework.assertUpdate:400 » QueryFailed Exceeded rate limits: too many table update operations for this table. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas
Error:    TestBigQueryAvroConnectorTest>BaseConnectorTest.testVarcharCastToDateInPredicate:577 » QueryFailed An internal error occurred and the request could not be completed. This is usually caused by a transient issue. Retrying the job with back-off as described in the BigQuery SLA should solve the problem: https://cloud.google.com/bigquery/sla. If the error continues to occur please contact support at https://cloud.google.com/support.

test (plugin/trino-hive) #17412

test (plugin/trino-iceberg, minio-and-avro) #11140 (comment)

@findepi
Copy link
Member Author

findepi commented May 10, 2023

CI #11140 (comment)

@findepi findepi merged commit 71e2a87 into master May 10, 2023
@findepi findepi deleted the findepi/handle-missing-mv-storagedescriptor-in-glue-57ac88 branch May 10, 2023 07:39
@github-actions github-actions bot added this to the 417 milestone May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

information_schema.tables failure when Iceberg materialized view lacks storage descriptor in glue metastore
3 participants