-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Data: Handle case where partition location is missing for TableMigrationUtil
#12212
base: main
Are you sure you want to change the base?
Data: Handle case where partition location is missing for TableMigrationUtil
#12212
Conversation
TableMigrationUtil
TableMigrationUtil
5b7ff64
to
658010c
Compare
@jshmchenxi Thanks for the fix. Can you add a test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good although I agree we need a test to check that this is working as expected.
36e2b7b
to
f3c2e11
Compare
@manuzhang @RussellSpitzer Thanks for the suggestion! I've added test cases to cover this change. |
60ef66a
to
23a1b11
Compare
data/src/test/java/org/apache/iceberg/data/TestTableMigrationUtil.java
Outdated
Show resolved
Hide resolved
data/src/test/java/org/apache/iceberg/data/TestTableMigrationUtil.java
Outdated
Show resolved
Hide resolved
data/src/test/java/org/apache/iceberg/data/TestTableMigrationUtil.java
Outdated
Show resolved
Hide resolved
data/src/test/java/org/apache/iceberg/data/TestTableMigrationUtil.java
Outdated
Show resolved
Hide resolved
data/src/test/java/org/apache/iceberg/data/TestTableMigrationUtil.java
Outdated
Show resolved
Hide resolved
23a1b11
to
6b96233
Compare
@jshmchenxi Can we add an end-to-end test in |
6b96233
to
2aacf49
Compare
@manuzhang I've added the end-to-end test. Please take a look. |
Kindly ping @manuzhang @RussellSpitzer @stevenzwu |
Arrays.stream( | ||
fs.exists(partitionDir) | ||
? fs.listStatus(partitionDir, HIDDEN_PATH_FILTER) | ||
: new FileStatus[] {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we log something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I've added log here.
2aacf49
to
5e58ba9
Compare
5e58ba9
to
e0c9f62
Compare
When we use the
SnapshotTableSparkAction
to create an Iceberg table based on a Hive table, and the Hive table contains some partition of which the partition location is missing from the file system, the Spark procedure would fail with the following exception:This PR adds support for such case and treats the partition location as an empty directory.