-
Notifications
You must be signed in to change notification settings - Fork 5
[SPARK-51560] Support cache/persist/unpersist
for DataFrame
#22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2000073
to
6ab85b9
Compare
Could you review this PR, @viirya ? |
@Test | ||
func persist() async throws { | ||
let spark = try await SparkSession.builder.getOrCreate() | ||
#expect(try await spark.range(20).persist().count() == 20) | ||
#expect(try await spark.range(21).persist(useDisk: false).count() == 21) | ||
await spark.stop() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks the result correctness. If it is not actually cached, we still can get the same result. I'm not sure if we have a way to check if it is actually cached or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, correct! This is only API test, @viirya .
I checked the cached and uncached result manually via Connect Server UI because we didn't catalog part yet~
func persistInvalidStorageLevel() async throws { | ||
let spark = try await SparkSession.builder.getOrCreate() | ||
try await #require(throws: Error.self) { | ||
let _ = try await spark.range(9999).persist(replication: 0).count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this is a valid error result check~
Thank you! Merged to main. |
What changes were proposed in this pull request?
This PR aims to support
cache
,persist
, andunpersist
forDataFrame
.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.
Was this patch authored or co-authored using generative AI tooling?
No.