Commit 59977a8
committed
[SPARK-54720][SQL] Add SparkSession.emptyDataFrame with a schema
### What changes were proposed in this pull request?
This PR adds a version of `SparkSession.emptyDataFrame` that takes a schema.
### Why are the changes needed?
It makes it easier to create an empty DataFrame in Scala.
### Does this PR introduce _any_ user-facing change?
Yes, it adds a new API.
### How was this patch tested?
I have added a test case.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53489 from hvanhovell/SPARK-54720.
Authored-by: Herman van Hövell <[email protected]>
Signed-off-by: Herman van Hövell <[email protected]>1 parent 1aa4b15 commit 59977a8
File tree
2 files changed
+21
-1
lines changed- sql/api/src
- main/scala/org/apache/spark/sql
- test/scala/org/apache/spark/sql
2 files changed
+21
-1
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | 213 | | |
215 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
0 commit comments