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

[iceberg][fix] obtain FileIO from the absolute warehouse path instead of relative table path #5051

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

LsomeYeah
Copy link
Contributor

Purpose

Linked issue: close #xxx

Path path =
        new Path(
                String.format(
                        "%s/%s/metadata",
                        icebergIdentifier.getDatabaseName(),
                        icebergIdentifier.getTableName()));
try {
    fileIO = FileIO.get(path, CatalogContext.create(icebergOptions));
} catch (IOException e) {
    throw new RuntimeException(e);
}

If obtain FileIO with the code below, it'll always get LocalFileIO because path.toUri().getScheme() == null will always be true. So we should use absolute warehouse path to get FileIO.

Tests

IcebergMigrateHadoopMetadataTest#testGetIcebergMetadataWithCustomFileIO

API and Format

Documentation

@wwj6591812
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit 53daec3 into apache:master Feb 12, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants