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

Nessie: Fix testcase failures #7320

Merged
merged 2 commits into from
Apr 11, 2023
Merged

Conversation

ajantha-bhat
Copy link
Member

#6789 was merged recently and the PR didn't rebase before merging as there was no conflict.

But there was another PR that got merged #7146 which enforces the namespace creation. Hence the new tests failed.

Apologies for breaking the master build!

@ajantha-bhat
Copy link
Member Author

cc: @Fokko, @nastra

@@ -98,12 +98,12 @@ public void testLoadNamespaceMetadata() {

@Test
public void testListTables() {
catalog.createTable(TableIdentifier.parse("foo.tbl1"), schema);
createTable(catalog, TableIdentifier.parse("foo.tbl1"), schema);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just call catalog.createNamespace(Namespace.of("foo"), Collections.emptyMap()); at the beginning of these methods?

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggestion will work but I am following the style from other testcases in Nessie introduced in #7146

Copy link
Contributor

Choose a reason for hiding this comment

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

The concern I have is that creating the namespace for each catalog instance might actually hide a bug. That's why I think it's better to create the namespace once before the test starts

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed that creating namespace from another catalog part and still following the same style of other testcases. If still required to manually create a namespace, I can do that. But I don't think necessary.

Assertions.assertThat(catalog.listTables(Namespace.of("foo")))
.containsExactlyInAnyOrder(TableIdentifier.parse("foo.tbl1"));

// another client creates a table with the same nessie server
anotherCatalog.createTable(TableIdentifier.parse("foo.tbl2"), schema);
createTable(anotherCatalog, TableIdentifier.parse("foo.tbl2"), schema);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's necessary to potentially create the namespace again here. Just calling catalog.createNamespace(Namespace.of("foo"), Collections.emptyMap()); at the beginning of the method should be enough.

Same applies for the other test methods in this class that fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, creating again from a different client is not required as namespace already exist. I removed it.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this so quickly @ajantha-bhat

@ajantha-bhat
Copy link
Member Author

PR is ready for merging.

@stevenzwu stevenzwu merged commit fc6bd1e into apache:master Apr 11, 2023
@Fokko
Copy link
Contributor

Fokko commented Apr 11, 2023

Thanks @stevenzwu for merging :)

@stevenzwu
Copy link
Contributor

merge this to fix the master branch build failure. thanks @ajantha-bhat for the fix and @nastra @Fokko @dimas-b for the review

ericlgoodman pushed a commit to ericlgoodman/iceberg that referenced this pull request Apr 12, 2023
manisin pushed a commit to Snowflake-Labs/iceberg that referenced this pull request May 9, 2023
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.

5 participants