Skip to content

Iceberg test improvements around time travel#13823

Merged
findepi merged 5 commits intotrinodb:masterfrom
findepi:findepi/prevent-iceberg-table-procedures-on-a-snapshot-7358e5
Aug 25, 2022
Merged

Iceberg test improvements around time travel#13823
findepi merged 5 commits intotrinodb:masterfrom
findepi:findepi/prevent-iceberg-table-procedures-on-a-snapshot-7358e5

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Aug 24, 2022

Extracted from #13636 where they were added thanks to @alexjo2144 's #13636 (comment)

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Aug 24, 2022
@cla-bot cla-bot bot added the cla-signed label Aug 24, 2022
@findepi findepi mentioned this pull request Aug 24, 2022
Currently, the way how the system tables are implemented makes it
impossible for `getTableHandleForExecute` to be executed on a non-DATA
table, so it's just a sanity check.
@findepi findepi force-pushed the findepi/prevent-iceberg-table-procedures-on-a-snapshot-7358e5 branch from cc1e2e9 to 26a59e1 Compare August 24, 2022 10:06
Comment on lines 4497 to 4498
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.

nit: How about assertQueryFails to ensure TrinoException?

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.

assertThatThrownBy(() -> query(...)) is a pattern we use very widely.
if we want to deprecate it in favor of assertQueryFails, we should have a discussion about this first.

Comment on lines 4499 to 4500
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.

nit: No change requested. assertQuery looks better for simple query assertion.

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.

agree. i think i perhaps did this more for consistency reasons.

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.

I know it is not in the scope of this PR but I find this error message missleading for this particular case.
This connector actually supports table procedures just not on the system tables.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding io.trino.connector.system.SystemTablesMetadata#getTableHandleForExecute with a more meaningful exception message would be a solution.

@@ -5117,13 +5117,13 @@ public void testModifyingOldSnapshotIsNotPossible()
assertUpdate(format("INSERT INTO %s VALUES 4,5,6", tableName), 3);
assertQuery(sessionWithLegacySyntaxSupport, format("SELECT * FROM \"%s@%d\"", tableName, oldSnapshotId), "VALUES 1,2,3");
assertThatThrownBy(() -> query(sessionWithLegacySyntaxSupport, format("INSERT INTO \"%s@%d\" VALUES 7,8,9", tableName, oldSnapshotId)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: There are a few more ." occurrences in the exception messages within IcebergMetadata

This could lead to unexpected state.
@findepi findepi force-pushed the findepi/prevent-iceberg-table-procedures-on-a-snapshot-7358e5 branch from 26a59e1 to defbf87 Compare August 24, 2022 18:58
@findepi findepi merged commit b487c74 into trinodb:master Aug 25, 2022
@findepi findepi deleted the findepi/prevent-iceberg-table-procedures-on-a-snapshot-7358e5 branch August 25, 2022 07:44
@github-actions github-actions bot added this to the 394 milestone Aug 25, 2022
@alexjo2144
Copy link
Copy Markdown
Member

I'm guessing ALTER TABLE ... EXECUTE ... FOR VERSION AS OF ... doesn't even parse?

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Aug 26, 2022

@alexjo2144 correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

5 participants