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

WIP: Test Upcoming Iceberg and Nessie version bump #20308

Closed
wants to merge 1 commit into from

Conversation

ajantha-bhat
Copy link
Member

@ajantha-bhat ajantha-bhat commented Jan 9, 2024

Description

  • Testing with Iceberg 1.5.0 and Nessie 0.77.1
  • Remove deprecated usage

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jan 9, 2024
@ajantha-bhat ajantha-bhat changed the title WIP: Test Upcoming Iceberg and Nessie version WIP: Test Upcoming Iceberg and Nessie version bump Jan 9, 2024
@github-actions github-actions bot added the iceberg Iceberg connector label Jan 9, 2024
@ajantha-bhat ajantha-bhat marked this pull request as draft January 9, 2024 10:20
@ajantha-bhat ajantha-bhat force-pushed the bump branch 2 times, most recently from 39f614a to bc1337a Compare January 9, 2024 16:15
@amogh-jahagirdar
Copy link
Contributor

I've raised a PR to your branch to address the REST Catalog test failures after the upgrade: ajantha-bhat#1

@@ -186,14 +186,6 @@ public void testDropTableWithMissingManifestListFile()
.hasMessageContaining("Table location should not exist");
}

@Test
@Override
public void testDropTableWithMissingDataFile()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test was failing expectedly after the upgrade because we made the change to remove Puffin files as part of https://github.com/apache/iceberg/pull/9305/files . We used to expect this test to fail in this override because Puffin files would linger after the "DROP" and we have an assertion that validates that all files are removed so the test would fail. Now, this override is no longer needed, we expect the base testDropTableWithMissingDataFile to pass. So we can just remove the test override and rely on the base.


public final class RestCatalogTestUtils
{
private RestCatalogTestUtils() {}

static class TestingJdbcCatalog
Copy link
Contributor

Choose a reason for hiding this comment

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

This is needed since the upgraded 1.5 RestSessionCatalog will check if a view exists when performing a replace. This effectively means the underlying catalog being used must implement ViewCatalog otherwise the loadView call will fail since the response cannot be parsed.
To fix this, I'm implementing a TestingJdbcCatalog which implements ViewCatalog. We'll need this anyways in the REST View Catalog implementation PR. #19818

Copy link
Member

Choose a reason for hiding this comment

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

does it mean JdbcCatalog no longer can be used to back the REST catalog? or does it mean that JdbcCatalog no longer supports views?

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar Feb 6, 2024

Choose a reason for hiding this comment

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

JDBC Catalog didn't support views originally, which is why this change was required. However, we are aiming for JDBC View Catalog support in the 1.5 release in which case the changes between line 50-100 can go away, and this PR will be simpler. Here's the PR

pom.xml Outdated
Comment on lines 2130 to 2272
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>apache.snapshots</id>
<name>Apache Development Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
</repository>
</repositories>
Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar Jan 31, 2024

Choose a reason for hiding this comment

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

We should remove this once 1.5 is actually released (just commenting so we don't forget :) ).

@@ -126,7 +128,11 @@ protected void commitToExistingTable(TableMetadata base, TableMetadata metadata)
{
verify(version.orElseThrow() >= 0, "commitToExistingTable called on a new table");
try {
nessieClient.commitTable(base, metadata, writeNewMetadata(metadata, version.getAsInt() + 1), table, toKey(new SchemaTableName(database, this.tableName)));
if (table == null) {
table = nessieClient.table(toIdentifier(new SchemaTableName(database, tableName)));
Copy link
Member

Choose a reason for hiding this comment

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

can this be a newer version of the table than one we loaded base from?
in fact, why table can be null for commitToExistingTable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me check.

Copy link
Member Author

@ajantha-bhat ajantha-bhat Feb 19, 2024

Choose a reason for hiding this comment

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

in fact, why table can be null for commitToExistingTable

Good question. I found that it was null before this PR also. So, maybe some integration not done properly (from the beginning). I will take a look and handle it separately. I don't want to bloat this PR scope.

Plus I don't know why it is null for only replace table case. I need some time to understand the integration and to fix it.


public final class RestCatalogTestUtils
{
private RestCatalogTestUtils() {}

static class TestingJdbcCatalog
Copy link
Member

Choose a reason for hiding this comment

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

does it mean JdbcCatalog no longer can be used to back the REST catalog? or does it mean that JdbcCatalog no longer supports views?

@findepi findepi requested a review from electrum February 3, 2024 16:22
@@ -344,14 +364,14 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.2.1</version>
<version>5.3</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<version>5.3</version>
<version>5.3.1</version>

@ajantha-bhat ajantha-bhat force-pushed the bump branch 2 times, most recently from 196f8d9 to ee6e020 Compare February 19, 2024 13:15
@amogh-jahagirdar
Copy link
Contributor

amogh-jahagirdar commented Feb 19, 2024

@ajantha-bhat it looks like TestIcebergVendingRestCatalogConnectorSmokeTest.testDropTableWithMissingDataFile is failing, TestIcebergVendingRestCatalogConnectorSmokeTest was a recently added test class which I think just copy/pasted of TestIcebergTrinoRestCatalogConnectorSmokeTest.java.

We can simply remove that test override and use the original test in the base class, see my explanation for TestIcebergTrinoRestCatalogConnectorSmokTest here.

@@ -309,14 +309,6 @@ public void testDropTableWithMissingManifestListFile()
.hasMessageContaining("Table location should not exist");
}

@Test
@Override
public void testDropTableWithMissingDataFile()
Copy link
Contributor

Choose a reason for hiding this comment

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

this can only be removed once IcebergRestCatalogBackendContainer uses iceberg-rest with the fix from apache/iceberg#9305

Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to remove this later when the iceberg-rest image has been released to use Iceberg 1.5.0. Then we can update the images used in IcebergRestCatalogBackendContainer / EnvSinglenodeSparkIcebergRest

@ajantha-bhat
Copy link
Member Author

Not sure why it cannot find V0_CREATE_CATALOG_SQL, locally the build passed with 1152

Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:testCompile (default-testCompile) on project trino-iceberg: Compilation failure
Error:  /home/runner/work/trino/trino/plugin/trino-iceberg/src/test/java/org/apache/iceberg/jdbc/TestingTrinoIcebergJdbcUtil.java:[19,63] cannot find symbol
Error:    symbol:   variable V0_CREATE_CATALOG_SQL
Error:    location: class org.apache.iceberg.jdbc.JdbcUtil
Error:  -> [Help 1]

- Testing with Iceberg 1.5.0 RC0 and Nessie 0.77.1
- Remove deprecated usage
- InputFile.length is being called since apache/iceberg#9592
- Handle JDBC catalog test failures
@amogh-jahagirdar
Copy link
Contributor

I was also able to build locally with these changes, is it possible that when CI was run there was some sort of artifact caching at play and it didn't get the latest artifact or something? Could we try re-triggering CI?

@nastra
Copy link
Contributor

nastra commented Feb 22, 2024

I was also able to build locally with these changes, is it possible that when CI was run there was some sort of artifact caching at play and it didn't get the latest artifact or something? Could we try re-triggering CI?

The changes moved to #20795 due to some caching issue with the RC repo(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

4 participants