Skip to content

[HUDI-6828] Fix wrong partitionToReplaceIds when insertOverwrite empty data into partitions#9811

Merged
danny0405 merged 2 commits intoapache:masterfrom
beyond1920:insertOverwriteEmptyData1
Oct 9, 2023
Merged

[HUDI-6828] Fix wrong partitionToReplaceIds when insertOverwrite empty data into partitions#9811
danny0405 merged 2 commits intoapache:masterfrom
beyond1920:insertOverwriteEmptyData1

Conversation

@beyond1920
Copy link
Contributor

@beyond1920 beyond1920 commented Sep 30, 2023

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

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@bvaradar bvaradar self-assigned this Oct 4, 2023
@bvaradar bvaradar added the type:bug Bug reports and fixes label Oct 4, 2023
@beyond1920
Copy link
Contributor Author

@danny0405 Thanks for review. I've updated the PR.

@hudi-bot
Copy link
Collaborator

hudi-bot commented Oct 7, 2023

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 merged commit 66879cd into apache:master Oct 9, 2023
nsivabalan pushed a commit that referenced this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug reports and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants