Skip to content

AWS: do not list non-iceberg table in Glue#2267

Merged
rdblue merged 2 commits into
apache:masterfrom
jackye1995:glue-list-table-filter
Mar 4, 2021
Merged

AWS: do not list non-iceberg table in Glue#2267
rdblue merged 2 commits into
apache:masterfrom
jackye1995:glue-list-table-filter

Conversation

@jackye1995

Copy link
Copy Markdown
Contributor

People might store non-Iceberg table in the same Glue database, and listTables should list non-Iceberg tables.

@github-actions github-actions Bot added the AWS label Feb 24, 2021
Table.builder().databaseName("db1").name("t2").build()
Table.builder().databaseName("db1").name("t1").parameters(
ImmutableMap.of(
BaseMetastoreTableOperations.TABLE_TYPE_PROP, BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE

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.

I think we should also test the case where the namespace is non-empty, but there is no Iceberg table.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great catch, dropping namespace with non-empty non-Iceberg table is interesting, in theory Iceberg should not care about it, but in practice we should probably not delete the namespace. So I updated the logic to check for iceberg or non-iceberg tables, and throw exception with different message for different cases. I have updated both the unit test and also the integration test.

@rdblue

rdblue commented Feb 24, 2021

Copy link
Copy Markdown
Contributor

Looks like a correct implementation. I think this needs a test for the non-empty drop behavior so that we know what happens there, but otherwise I think this is good. Thanks, @jackye1995.

@yyanyy yyanyy left a comment

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.

LGTM, wondering if we want to mention in AWS documentation page that iceberg table has to contain this table type property to be considered as iceberg table, in case there are other implementations to this.

.build());

if (response.hasTableList() && !response.tableList().isEmpty()) {
Table table = response.tableList().get(0);

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.

Probably not really need to differentiate the two, but I don't think it's worth blocking the PR.

@rdblue rdblue added this to the Java 0.11.1 Release milestone Mar 4, 2021
@rdblue rdblue merged commit ef6de31 into apache:master Mar 4, 2021
@rdblue

rdblue commented Mar 4, 2021

Copy link
Copy Markdown
Contributor

Looks good, I'll merge. Thanks @jackye1995!

coolderli pushed a commit to coolderli/iceberg that referenced this pull request Apr 26, 2021
stevenzwu pushed a commit to stevenzwu/iceberg that referenced this pull request Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants