Commit 5f38636
[SPARK-51281][SQL] DataFrameWriterV2 should respect the path option
### What changes were proposed in this pull request?
Unlike `DataFrameWriter.saveAsTable` where we explicitly get the "path" option and treat it as table location, `DataFrameWriterV2` doesn't do it and treats the "path" option as a normal option which doesn't have any real impact.
This PR fixes it, and adds a legacy config to restore the old behavior.
### Why are the changes needed?
bug fix
### Does this PR introduce _any_ user-facing change?
Yes, now `DataFrameWriterV2` can correctly write data to the specified path for file source tables.
### How was this patch tested?
new test
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #50040 from cloud-fan/prop.
Lead-authored-by: Wenchen Fan <cloud0fan@gmail.com>
Co-authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>1 parent 69bd57c commit 5f38636
File tree
183 files changed
+4672
-2211
lines changed- assembly
- common/utils/src/main/resources/error
- connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2
- core/src
- main/scala/org/apache/spark
- api/python
- deploy
- test/scala/org/apache/spark
- deploy
- client
- master
- storage
- util
- dev
- deps
- sparktestsupport
- docs
- launcher/src/main/java/org/apache/spark/launcher
- licenses-binary
- mllib/src/test/scala/org/apache/spark/mllib/regression
- project
- python
- docs/source
- development
- getting_started
- migration_guide
- packaging/client
- pyspark
- logger
- tests
- ml
- tests
- connect
- torch/tests
- pandas
- sql
- connect
- client
- proto
- pandas
- streaming
- tests
- arrow
- connect
- pandas
- pandas
- worker
- testing
- sql
- api/src/test/scala/org/apache/spark/sql
- catalyst/src
- main/scala/org/apache/spark/sql
- catalyst
- analysis
- resolver
- optimizer
- parser
- plans/logical
- util
- execution
- arrow
- datasources/v2
- internal
- test/scala/org/apache/spark/sql
- catalyst
- analysis
- encoders
- expressions
- optimizer
- parser
- plans
- util
- connector/catalog
- types
- connect
- client/jvm/src/test/scala/org/apache/spark/sql/connect
- client
- test
- common/src/main
- protobuf/spark/connect
- scala/org/apache/spark/sql/connect
- client
- server/src
- main/scala/org/apache/spark/sql/connect
- config
- execution
- ml
- planner
- service
- test/scala/org/apache/spark/sql/connect/service
- core
- benchmarks
- src
- main/scala/org/apache/spark/sql
- catalyst/analysis
- classic
- execution
- command
- datasources
- v2
- python
- streaming
- streaming
- state
- jdbc
- scripting
- test
- resources/sql-tests
- analyzer-results
- inputs
- results
- scala/org/apache/spark/sql
- analysis/resolver
- collation
- connector
- execution
- benchmark
- datasources
- text
- v2/state
- python
- streaming
- sources
- state
- jdbc
- scripting
- streaming
- test
- hive/src/test/scala/org/apache/spark/sql/hive
- execution
- orc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
183 files changed
+4672
-2211
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3493 | 3493 | | |
3494 | 3494 | | |
3495 | 3495 | | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
3496 | 3501 | | |
3497 | 3502 | | |
3498 | 3503 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | | - | |
810 | | - | |
811 | 809 | | |
812 | 810 | | |
813 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
725 | 728 | | |
726 | 729 | | |
727 | 730 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| 710 | + | |
710 | 711 | | |
711 | 712 | | |
712 | 713 | | |
| |||
742 | 743 | | |
743 | 744 | | |
744 | 745 | | |
745 | | - | |
746 | | - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
747 | 753 | | |
748 | 754 | | |
749 | 755 | | |
| |||
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
258 | | - | |
| 257 | + | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
| |||
643 | 642 | | |
644 | 643 | | |
645 | 644 | | |
646 | | - | |
647 | | - | |
| 645 | + | |
648 | 646 | | |
649 | 647 | | |
650 | 648 | | |
651 | | - | |
652 | | - | |
653 | | - | |
| 649 | + | |
654 | 650 | | |
655 | 651 | | |
656 | 652 | | |
| |||
767 | 763 | | |
768 | 764 | | |
769 | 765 | | |
770 | | - | |
771 | | - | |
| 766 | + | |
772 | 767 | | |
773 | 768 | | |
774 | 769 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
| 256 | + | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
Lines changed: 4 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1911 | 1911 | | |
1912 | 1912 | | |
1913 | 1913 | | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | 1914 | | |
1923 | 1915 | | |
1924 | 1916 | | |
| |||
1932 | 1924 | | |
1933 | 1925 | | |
1934 | 1926 | | |
1935 | | - | |
1936 | | - | |
1937 | 1927 | | |
1938 | 1928 | | |
1939 | 1929 | | |
| |||
1946 | 1936 | | |
1947 | 1937 | | |
1948 | 1938 | | |
1949 | | - | |
| 1939 | + | |
1950 | 1940 | | |
1951 | 1941 | | |
1952 | 1942 | | |
1953 | | - | |
1954 | | - | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | 1943 | | |
1960 | 1944 | | |
1961 | 1945 | | |
1962 | 1946 | | |
1963 | 1947 | | |
1964 | 1948 | | |
1965 | 1949 | | |
1966 | | - | |
| 1950 | + | |
1967 | 1951 | | |
1968 | 1952 | | |
1969 | 1953 | | |
| |||
1982 | 1966 | | |
1983 | 1967 | | |
1984 | 1968 | | |
1985 | | - | |
| 1969 | + | |
1986 | 1970 | | |
1987 | 1971 | | |
1988 | 1972 | | |
| |||
2005 | 1989 | | |
2006 | 1990 | | |
2007 | 1991 | | |
2008 | | - | |
| 1992 | + | |
2009 | 1993 | | |
2010 | 1994 | | |
2011 | 1995 | | |
| |||
2033 | 2017 | | |
2034 | 2018 | | |
2035 | 2019 | | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
2040 | 2020 | | |
2041 | 2021 | | |
2042 | 2022 | | |
| |||
2052 | 2032 | | |
2053 | 2033 | | |
2054 | 2034 | | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | 2035 | | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
1460 | 1461 | | |
1461 | 1462 | | |
1462 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
1463 | 1473 | | |
1464 | 1474 | | |
1465 | 1475 | | |
| |||
0 commit comments