[HUDI-6828] Fix wrong partitionToReplaceIds when insertOverwrite empty data into partitions#9811
Merged
danny0405 merged 2 commits intoapache:masterfrom Oct 9, 2023
Merged
Conversation
…y data into partitions
danny0405
reviewed
Oct 2, 2023
.../main/java/org/apache/hudi/table/action/commit/SparkInsertOverwriteCommitActionExecutor.java
Show resolved
Hide resolved
danny0405
reviewed
Oct 2, 2023
...di-spark/src/main/scala/org/apache/spark/sql/hudi/command/InsertIntoHoodieTableCommand.scala
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@danny0405 Thanks for review. I've updated the PR. |
Collaborator
danny0405
approved these changes
Oct 9, 2023
nsivabalan
pushed a commit
that referenced
this pull request
Nov 21, 2023
…y data into partitions (#9811)
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Logs
After Insert overwrite into a non-empty partition/table with empty datasets, the subsequent query results are incorrect
For example, current dataset of partition dt=2021-07-17 is
| id | name | dt |
| 1 | 'a' | '2021-07-17' |
Using the following SQL to overwrite partition dt=2021-07-17
insert overwrite table targetT partition(dt='2021-07-17') select id, name, price from sourceT where dt=2021-07-17 and product='test'If the input dataset is empty. We expect after insert overwrite, the partition of dt=2021-07-17 is empty.
However, the query result is still the old data.
This pr aims to fix this bug.
Impact
NA
Risk level (write none, low medium or high below)
NA
Documentation Update
NA
Contributor's checklist