Skip to content

[SPARK-52172] Add checkpoint and localCheckpoint for DataFrame #157

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Tests/SparkConnectTests/DataFrameTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -484,20 +484,24 @@ struct DataFrameTests {
@Test
func checkpoint() async throws {
let spark = try await SparkSession.builder.getOrCreate()
// By default, reliable checkpoint location is required.
try await #require(throws: Error.self) {
try await spark.range(10).checkpoint()
if await spark.version >= "4.0.0" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why skipping Spark 3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I was also surprised with the failure at the first commit.
Spark Connect didn't support this feature until 4.0.0.

// By default, reliable checkpoint location is required.
try await #require(throws: Error.self) {
try await spark.range(10).checkpoint()
}
// Checkpointing with unreliable checkpoint
let df = try await spark.range(10).checkpoint(true, false)
#expect(try await df.count() == 10)
}
// Checkpointing with unreliable checkpoint
let df = try await spark.range(10).checkpoint(true, false)
#expect(try await df.count() == 10)
await spark.stop()
}

@Test
func localCheckpoint() async throws {
let spark = try await SparkSession.builder.getOrCreate()
#expect(try await spark.range(10).localCheckpoint().count() == 10)
if await spark.version >= "4.0.0" {
#expect(try await spark.range(10).localCheckpoint().count() == 10)
}
await spark.stop()
}

Expand Down
Loading