-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6378] allow to delete twice for an empty table #8967
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
base: master
Are you sure you want to change the base?
Conversation
|
@KnightChess |
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java
Outdated
Show resolved
Hide resolved
...ark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestDeleteFromTable.scala
Outdated
Show resolved
Hide resolved
| throw new HoodieIOException("Latest commit does not have any schema in commit metadata"); | ||
| } | ||
| } else { | ||
| String schemaStr = new TableSchemaResolver(metaClient).getTableAvroSchema().toString(); |
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.
The whole method can be replaced by the new logic with try-catch block:
String schemaStr = new TableSchemaResolver(metaClient).getTableAvroSchema().toString();
config.setSchema(schemaStr);
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.
address it.
|
LGTM. @lvyanquan could you check the test failures? |
|
@hudi-bot run azure |
Change Logs
delete operation will use schema of lastInstant.
Howerver, if last commit is deletion on an empty table, schema will be
""string, if we throw exception now, we could not execute idempotent deletion.Add a test for this situation.
relevant pr #5610
Impact
fix bug for deletion from an empty table.
Risk level (write none, low medium or high below)
low
Contributor's checklist