Commit c8159c7
[SPARK-29197][SQL] Remove saveModeForDSV2 from DataFrameWriter
### What changes were proposed in this pull request?
It is very confusing that the default save mode is different between the internal implementation of a Data source. The reason that we had to have saveModeForDSV2 was that there was no easy way to check the existence of a Table in DataSource v2. Now, we have catalogs for that. Therefore we should be able to remove the different save modes. We also have a plan forward for `save`, where we can't really check the existence of a table, and therefore create one. That will come in a future PR.
### Why are the changes needed?
Because it is confusing that the internal implementation of a data source (which is generally non-obvious to users) decides which default save mode is used within Spark.
### Does this PR introduce any user-facing change?
It changes the default save mode for V2 Tables in the DataFrameWriter APIs
### How was this patch tested?
Existing tests
Closes #25876 from brkyvz/removeSM.
Lead-authored-by: Burak Yavuz <brkyvz@gmail.com>
Co-authored-by: Burak Yavuz <burak@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>1 parent b8b59d6 commit c8159c7
File tree
7 files changed
+51
-45
lines changed- external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010
- sql
- catalyst/src/main/scala/org/apache/spark/sql/internal
- core/src
- main/scala/org/apache/spark/sql
- test/scala/org/apache/spark/sql
- connector
- execution/datasources/noop
- test
7 files changed
+51
-45
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
403 | 404 | | |
404 | 405 | | |
405 | 406 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| 427 | + | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
| |||
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
| 462 | + | |
460 | 463 | | |
461 | 464 | | |
462 | 465 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1643 | 1643 | | |
1644 | 1644 | | |
1645 | 1645 | | |
1646 | | - | |
| 1646 | + | |
1647 | 1647 | | |
1648 | 1648 | | |
1649 | 1649 | | |
| |||
Lines changed: 15 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
380 | 383 | | |
381 | 384 | | |
382 | 385 | | |
383 | | - | |
384 | | - | |
| 386 | + | |
| 387 | + | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 400 | | |
402 | 401 | | |
403 | 402 | | |
| |||
411 | 410 | | |
412 | 411 | | |
413 | 412 | | |
414 | | - | |
| 413 | + | |
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
| |||
490 | 489 | | |
491 | 490 | | |
492 | 491 | | |
493 | | - | |
| 492 | + | |
494 | 493 | | |
495 | 494 | | |
496 | | - | |
497 | | - | |
498 | | - | |
| 495 | + | |
499 | 496 | | |
500 | 497 | | |
501 | 498 | | |
| |||
507 | 504 | | |
508 | 505 | | |
509 | 506 | | |
510 | | - | |
| 507 | + | |
511 | 508 | | |
512 | 509 | | |
513 | 510 | | |
| |||
568 | 565 | | |
569 | 566 | | |
570 | 567 | | |
571 | | - | |
| 568 | + | |
572 | 569 | | |
573 | 570 | | |
574 | 571 | | |
| |||
624 | 621 | | |
625 | 622 | | |
626 | 623 | | |
627 | | - | |
| 624 | + | |
628 | 625 | | |
629 | 626 | | |
630 | 627 | | |
| |||
830 | 827 | | |
831 | 828 | | |
832 | 829 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | 830 | | |
838 | 831 | | |
839 | 832 | | |
| |||
848 | 841 | | |
849 | 842 | | |
850 | 843 | | |
851 | | - | |
| 844 | + | |
852 | 845 | | |
853 | 846 | | |
854 | 847 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
| |||
281 | 285 | | |
282 | 286 | | |
283 | 287 | | |
284 | | - | |
| 288 | + | |
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| |||
368 | 372 | | |
369 | 373 | | |
370 | 374 | | |
371 | | - | |
| 375 | + | |
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
297 | 298 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
0 commit comments