Commit 209e93e
committed
### What changes were proposed in this pull request?
This PR aims to support `cache`, `persist`, and `unpersist` for `DataFrame`.
### Why are the changes needed?
For feature parity.
### Does this PR introduce _any_ user-facing change?
No. This is a new addition.
### How was this patch tested?
Pass the CIs.
```
$ swift test --filter DataFrameTests
...
Test run started.
Testing Library Version: 102 (arm64e-apple-macos13.0)
Suite DataFrameTests started.
Test orderBy() started.
Test isEmpty() started.
Test show() started.
Test persist() started.
Test showCommand() started.
Test table() started.
Test selectMultipleColumns() started.
Test showNull() started.
Test schema() started.
Test selectNone() started.
Test rdd() started.
Test sort() started.
Test unpersist() started.
Test limit() started.
Test count() started.
Test cache() started.
Test selectInvalidColumn() started.
Test collect() started.
Test countNull() started.
Test select() started.
Test persistInvalidStorageLevel() started.
Test rdd() passed after 0.571 seconds.
Test selectNone() passed after 1.347 seconds.
Test select() passed after 1.354 seconds.
Test selectMultipleColumns() passed after 1.354 seconds.
Test selectInvalidColumn() passed after 1.395 seconds.
Test schema() passed after 1.747 seconds.
++
||
++
++
Test showCommand() passed after 1.885 seconds.
+-----------+-----------+-------------+
| namespace | tableName | isTemporary |
+-----------+-----------+-------------+
+-----------+-----------+-------------+
+------+-------+------+
| col1 | col2 | col3 |
+------+-------+------+
| 1 | true | abc |
| NULL | NULL | NULL |
| 3 | false | def |
+------+-------+------+
Test showNull() passed after 1.890 seconds.
+------+-------+
| col1 | col2 |
+------+-------+
| true | false |
+------+-------+
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
+------+------+
+------+------+
| col1 | col2 |
+------+------+
| abc | def |
| ghi | jkl |
+------+------+
Test show() passed after 1.975 seconds.
Test collect() passed after 2.045 seconds.
Test countNull() passed after 2.566 seconds.
Test persistInvalidStorageLevel() passed after 2.578 seconds.
Test cache() passed after 2.683 seconds.
Test isEmpty() passed after 2.778 seconds.
Test count() passed after 2.892 seconds.
Test persist() passed after 2.903 seconds.
Test unpersist() passed after 2.917 seconds.
Test limit() passed after 3.068 seconds.
Test orderBy() passed after 3.101 seconds.
Test sort() passed after 3.102 seconds.
Test table() passed after 3.720 seconds.
Suite DataFrameTests passed after 3.720 seconds.
Test run with 21 tests passed after 3.720 seconds.
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #22 from dongjoon-hyun/SPARK-51560.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 968b77c commit 209e93e
File tree
4 files changed
+108
-0
lines changed- Sources/SparkConnect
- Tests/SparkConnectTests
4 files changed
+108
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
248 | 287 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
259 | 294 | | |
260 | 295 | | |
261 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
196 | 229 | | |
197 | 230 | | |
0 commit comments