spark
spark copied to clipboard
[SPARK-46714][SQL] Overwrite a partition with custom location
What changes were proposed in this pull request?
Sometimes we use more than one filesystems for data warehouse, for example one for hot/warm data and another for cold data, with different storages to save total cost. But it seems after spark convert table writing into data source writing, it is not working as expected.
Before this patch, when overwrite a partition with custom location:
- if the partition location is on same filesystem with its table, the partition location remain the same.
- else, spark will throw an exception
java.lang.IllegalArgumentException: Wrong FS:After this patch, the behavior will align with Hive: the overwritten partition will be recreated under table location.
Why are the changes needed?
- to align behavior with Hive
- support existing partitions on a separate filesystem from table location.
Does this PR introduce any user-facing change?
Yes. Before this patch, when overwrite a partition with custom location:
- if the partition location is on same filesystem with its table, the partition location remain the same.
- else, spark will throw an exception
java.io.IOException: Wrong FS ...After this patch, the behavior will align with Hive: the overwritten partition will be recreated under table location.
How was this patch tested?
Added a unit test case.
Was this patch authored or co-authored using generative AI tooling?
No.
cc @cloud-fan FYI
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
@LuciferYang can you please reopen this pull request?
@adrian-wang done
@cloud-fan Can you help review this pull request?
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!