Commit 16784fa
[SPARK-50854][SS] Make path fully qualified before passing it to FileStreamSink
### What changes were proposed in this pull request?
1. Ensure that if relative path is used in `DataStreamWriter`, the path resolution is done on the Spark Driver and is not deferred to Spark Executor.
2. Construct fully qualified path in `DataSource` similar to how it is done for `DataFrameWriter` before it is passed to `FileStreamSink`.
3. Add a check to `FileStreamSink` that asserts that `path` is an absolute path.
https://lists.apache.org/thread/ffzwn1y2fgyjw0j09cv4np9z00wymxwv
### Why are the changes needed?
To properly support relative paths in structured streaming. The use case mostly applies to single node local Spark cluster.
### Does this PR introduce _any_ user-facing change?
The change is only applicable to the use case when relative path is used in `DataStreamWriter`, resulting in data being output to correct directory. No changes are expected for absolute path (the most common production case).
### How was this patch tested?
Added new test case to `FileStreamSinkSuite`.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #49654 from vrozov/SPARK-50854.
Authored-by: Vlad Rozov <[email protected]>
Signed-off-by: Jungtaek Lim <[email protected]>1 parent 2cd5365 commit 16784fa
File tree
6 files changed
+52
-17
lines changed- docs/streaming
- sql
- catalyst/src/main/scala/org/apache/spark/sql/errors
- core/src
- main/scala/org/apache/spark/sql/execution
- datasources
- streaming
- test/scala/org/apache/spark/sql
- execution/streaming
- streaming
6 files changed
+52
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2950 | 2950 | | |
2951 | 2951 | | |
2952 | 2952 | | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
2953 | 2957 | | |
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| |||
319 | 324 | | |
320 | 325 | | |
321 | 326 | | |
322 | | - | |
| 327 | + | |
323 | 328 | | |
324 | | - | |
| 329 | + | |
325 | 330 | | |
326 | 331 | | |
327 | 332 | | |
| |||
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
459 | | - | |
460 | | - | |
461 | | - | |
| 464 | + | |
462 | 465 | | |
463 | 466 | | |
464 | 467 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | | - | |
| 1104 | + | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| |||
Lines changed: 35 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| 296 | + | |
| 297 | + | |
295 | 298 | | |
296 | 299 | | |
297 | 300 | | |
298 | 301 | | |
| 302 | + | |
299 | 303 | | |
300 | 304 | | |
301 | 305 | | |
302 | 306 | | |
| 307 | + | |
303 | 308 | | |
304 | 309 | | |
305 | 310 | | |
306 | 311 | | |
| 312 | + | |
307 | 313 | | |
308 | 314 | | |
309 | | - | |
310 | | - | |
| 315 | + | |
| 316 | + | |
311 | 317 | | |
312 | 318 | | |
313 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
314 | 325 | | |
315 | 326 | | |
316 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
317 | 332 | | |
| 333 | + | |
318 | 334 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
324 | 338 | | |
325 | 339 | | |
326 | 340 | | |
| |||
664 | 678 | | |
665 | 679 | | |
666 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
667 | 691 | | |
668 | 692 | | |
669 | 693 | | |
| |||
0 commit comments