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

Avoid redundant metastore calls for non-system Iceberg tables #8689

Conversation

findepi
Copy link
Member

@findepi findepi commented Jul 28, 2021

When table name doesn't look like a system table, we can exit early.

For #8675

When table name doesn't look like a system table, we can exit early.
@findepi findepi force-pushed the findepi/avoid-redundant-metastore-calls-for-non-system-iceberg-tables-21678d branch from 894ebd4 to bbe7fd4 Compare July 28, 2021 07:56
@findepi findepi requested review from hashhar, homar, electrum and phd3 July 28, 2021 07:56
@@ -83,7 +83,7 @@ public void testCreateTable()
ImmutableMultiset.builder()
.add(CREATE_TABLE)
.add(GET_DATABASE)
.addCopies(GET_TABLE, 2)
.add(GET_TABLE)
Copy link
Member

@homar homar Jul 28, 2021

Choose a reason for hiding this comment

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

In another PR i was suggested to use only addCopies and replace add with addCopies(...,1).
I see you did the opposite here ;) For me add is fine but just leaving this comment here to be consistent

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it was about consistency of neighbouring lines.

i do hope we will bring those counts to 1 (if by nothing else, then with some metastore cache)
and then we will have add(element) consistently.

I do not know whether it that other PR count of 1 is the expected value, so maybe there is a difference.

@@ -303,6 +303,9 @@ public IcebergTableHandle getTableHandle(ConnectorSession session, SchemaTableNa
private Optional<SystemTable> getRawSystemTable(ConnectorSession session, SchemaTableName tableName)
{
IcebergTableName name = IcebergTableName.from(tableName.getTableName());
if (name.getTableType() == DATA) {
return Optional.empty();
Copy link
Member

Choose a reason for hiding this comment

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

We can also remove the metastore call below if we translate the not found exception into empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, will handle in a follow up, since this also requires more test coverage (#8690)

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in #8692

@findepi
Copy link
Member Author

findepi commented Jul 28, 2021

CI #8691 , #8345

@findepi findepi merged commit d29fcd9 into trinodb:master Jul 28, 2021
@findepi findepi deleted the findepi/avoid-redundant-metastore-calls-for-non-system-iceberg-tables-21678d branch July 28, 2021 10:25
@findepi findepi mentioned this pull request Jul 28, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants