You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jaceklaskowski (via GitHub)" <gi...@apache.org> on 2026/04/01 19:40:22 UTC
[PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
jaceklaskowski opened a new pull request, #55145:
URL: https://github.com/apache/spark/pull/55145
### What changes were proposed in this pull request?
Refactors `FlowSystemMetadata.flowCheckpointsDirOpt` to avoid `scala.Option` (that's used exclusively for `Some` values, and no `None`). That can be very confusing for readers.
### Why are the changes needed?
Code clarification
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
A local build. Waiting for the tests to be executed on GitHub.
### Was this patch authored or co-authored using generative AI tooling?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "holdenk (via GitHub)" <gi...@apache.org>.
holdenk commented on code in PR #55145:
URL: https://github.com/apache/spark/pull/55145#discussion_r3262684818
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/SystemMetadata.scala:
##########
@@ -37,32 +37,33 @@ case class FlowSystemMetadata(
) extends SystemMetadata with Logging {
/**
- * Returns the checkpoint root directory for a given flow
- * which is storage/_checkpoints/flow_destination_table/flow_name.
- * @return the checkpoint root directory for `flow`
+ * @return the checkpoint root directory for this flow
+ * (of the form storage/_checkpoints/flow_destination_table/flow_name)
+ * @throws IllegalArgumentException when the flow's destination is neither a table nor sink
*/
- def flowCheckpointsDirOpt(): Option[Path] = {
- Option(if (graph.table.contains(flow.destinationIdentifier) ||
- graph.sink.contains(flow.destinationIdentifier)) {
- val checkpointRoot = new Path(context.storageRoot, "_checkpoints")
- // Different tables in the pipeline can have flows with the same name, so we include
- // the table's fully qualified identifier in the path to avoid collisions.
- val flowTableId = tableIdentifierToPathString(flow.destinationIdentifier)
- val flowName = flow.identifier.table
- val checkpointDir = new Path(
- new Path(checkpointRoot, flowTableId),
- flowName
- )
- logInfo(
- log"Flow ${MDC(LogKeys.FLOW_NAME, flowName)} using checkpoint " +
- log"directory: ${MDC(LogKeys.CHECKPOINT_PATH, checkpointDir)}"
- )
- checkpointDir
- } else {
+ def flowCheckpointsDir(): Path = {
+ def isTableOrSink(destination: TableIdentifier): Boolean = {
+ graph.table.contains(destination) || graph.sink.contains(destination)
+ }
Review Comment:
This is weird to have as a function
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #55145: [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option
URL: https://github.com/apache/spark/pull/55145
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4209164183
May I have your take on this super tiny change Mr. @sryza? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4254591273
Uh-oh...things are getting out of control 😢 No one seems to care about this lil' PR 😭
@dongjoon-hyun @sryza Care to help me accept the PR, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4217037114
@dongjoon-hyun could you help me push this through the gates? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #55145:
URL: https://github.com/apache/spark/pull/55145#discussion_r3409962876
##########
sql/pipelines/src/test/scala/org/apache/spark/sql/pipelines/graph/SystemMetadataSuite.scala:
##########
@@ -251,7 +251,7 @@ class SystemMetadataSuite
val stSystemMetadata = FlowSystemMetadata(updateContext, stFlow, graph)
val schema2StSystemMetadata = FlowSystemMetadata(updateContext, schema2StFlow, graph)
assert(
- stSystemMetadata.flowCheckpointsDirOpt() != schema2StSystemMetadata.flowCheckpointsDirOpt()
+ stSystemMetadata.flowCheckpointsDir() != schema2StSystemMetadata.flowCheckpointsDir()
Review Comment:
Following up on the prior round: now that `flowCheckpointsDir()` documents `@throws IllegalArgumentException`, this is API surface worth pinning, and a test is cheap (~12 lines, no manual flow construction). A `LocalTempView` registers an implicit flow whose destination is the *view* -- which is in `graph.view`, not `graph.table`/`graph.sink` -- so it hits the throw directly:
```scala
test("flowCheckpointsDir throws when the destination is neither a table nor a sink") {
val session = spark
import session.implicits._
val graph = new TestGraphRegistrationContext(spark) {
val mem: MemoryStream[Int] = MemoryStream[Int]
mem.addData(1, 2, 3)
registerView("v", query = dfFlowFunc(mem.toDF()))
}.toDataflowGraph
val updateContext = TestPipelineUpdateContext(
unresolvedGraph = graph, spark = spark, storageRoot = storageRoot, failOnErrorEvent = true)
val viewFlow = graph.flowsTo(TableIdentifier("v")).head
val systemMetadata = FlowSystemMetadata(updateContext, viewFlow, graph)
intercept[IllegalArgumentException] {
systemMetadata.flowCheckpointsDir()
}
}
```
`flowsTo` (keyed by destination identifier) avoids guessing the flow id; temp-view ids are single-part/unqualified, so `TableIdentifier("v")` is the destination key. Non-blocking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on code in PR #55145:
URL: https://github.com/apache/spark/pull/55145#discussion_r3388616624
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/SystemMetadata.scala:
##########
@@ -37,32 +37,33 @@ case class FlowSystemMetadata(
) extends SystemMetadata with Logging {
/**
- * Returns the checkpoint root directory for a given flow
- * which is storage/_checkpoints/flow_destination_table/flow_name.
- * @return the checkpoint root directory for `flow`
+ * @return the checkpoint root directory for this flow
+ * (of the form storage/_checkpoints/flow_destination_table/flow_name)
+ * @throws IllegalArgumentException when the flow's destination is neither a table nor sink
*/
- def flowCheckpointsDirOpt(): Option[Path] = {
- Option(if (graph.table.contains(flow.destinationIdentifier) ||
- graph.sink.contains(flow.destinationIdentifier)) {
- val checkpointRoot = new Path(context.storageRoot, "_checkpoints")
- // Different tables in the pipeline can have flows with the same name, so we include
- // the table's fully qualified identifier in the path to avoid collisions.
- val flowTableId = tableIdentifierToPathString(flow.destinationIdentifier)
- val flowName = flow.identifier.table
- val checkpointDir = new Path(
- new Path(checkpointRoot, flowTableId),
- flowName
- )
- logInfo(
- log"Flow ${MDC(LogKeys.FLOW_NAME, flowName)} using checkpoint " +
- log"directory: ${MDC(LogKeys.CHECKPOINT_PATH, checkpointDir)}"
- )
- checkpointDir
- } else {
+ def flowCheckpointsDir(): Path = {
+ def isTableOrSink(destination: TableIdentifier): Boolean = {
+ graph.table.contains(destination) || graph.sink.contains(destination)
+ }
Review Comment:
I disagree 😉 Every time a reader would read the or operator, they would certainly have to understand its parts (completely unnecessary). Why would we want to trigger this unpleasantness (if it can be a single word `isTableOrSink`)?
If that's the only missing part to move the PR to master, I'm fine to adjust 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4670593940
@holdenk Thanks a lot for your review and approval 🙇♂️
@sryza Mind reviewing it and pushing to master? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-5786987891
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4442990013
Seems like the only way to get this through is to wait till I'm a committer of this project and approve it myself. Ouch, it can't be that hard (it's way too hard already to contribute to Spark).
@holdenk, mind reviewing it and perhaps even pushing it to main? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4329205359
@cloud-fan, can you help me push this little change through the acceptance gates? Or know someone who could? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4172537836
Please review @sryza 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "jaceklaskowski (via GitHub)" <gi...@apache.org>.
jaceklaskowski commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4299295561
@sryza @dongjoon-hyun You seem very busy lately. Can you find some spare time to review it, please? 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "holdenk (via GitHub)" <gi...@apache.org>.
holdenk commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4443003535
Yeah I can take a look :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "holdenk (via GitHub)" <gi...@apache.org>.
holdenk commented on code in PR #55145:
URL: https://github.com/apache/spark/pull/55145#discussion_r3262684818
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/SystemMetadata.scala:
##########
@@ -37,32 +37,33 @@ case class FlowSystemMetadata(
) extends SystemMetadata with Logging {
/**
- * Returns the checkpoint root directory for a given flow
- * which is storage/_checkpoints/flow_destination_table/flow_name.
- * @return the checkpoint root directory for `flow`
+ * @return the checkpoint root directory for this flow
+ * (of the form storage/_checkpoints/flow_destination_table/flow_name)
+ * @throws IllegalArgumentException when the flow's destination is neither a table nor sink
*/
- def flowCheckpointsDirOpt(): Option[Path] = {
- Option(if (graph.table.contains(flow.destinationIdentifier) ||
- graph.sink.contains(flow.destinationIdentifier)) {
- val checkpointRoot = new Path(context.storageRoot, "_checkpoints")
- // Different tables in the pipeline can have flows with the same name, so we include
- // the table's fully qualified identifier in the path to avoid collisions.
- val flowTableId = tableIdentifierToPathString(flow.destinationIdentifier)
- val flowName = flow.identifier.table
- val checkpointDir = new Path(
- new Path(checkpointRoot, flowTableId),
- flowName
- )
- logInfo(
- log"Flow ${MDC(LogKeys.FLOW_NAME, flowName)} using checkpoint " +
- log"directory: ${MDC(LogKeys.CHECKPOINT_PATH, checkpointDir)}"
- )
- checkpointDir
- } else {
+ def flowCheckpointsDir(): Path = {
+ def isTableOrSink(destination: TableIdentifier): Boolean = {
+ graph.table.contains(destination) || graph.sink.contains(destination)
+ }
Review Comment:
nit: This is weird to have as a function, I would rather have the if check in-line
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "holdenk (via GitHub)" <gi...@apache.org>.
holdenk commented on PR #55145:
URL: https://github.com/apache/spark/pull/55145#issuecomment-4670832247
If we don't hear anything back I can try and merge it later this week (offline riding motorcycles until Friday)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56325][SDP] Refactor FlowSystemMetadata.flowCheckpointsDirOpt to avoid scala.Option [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #55145:
URL: https://github.com/apache/spark/pull/55145#discussion_r3399805436
##########
sql/pipelines/src/test/scala/org/apache/spark/sql/pipelines/graph/SystemMetadataSuite.scala:
##########
@@ -251,7 +251,7 @@ class SystemMetadataSuite
val stSystemMetadata = FlowSystemMetadata(updateContext, stFlow, graph)
val schema2StSystemMetadata = FlowSystemMetadata(updateContext, schema2StFlow, graph)
assert(
- stSystemMetadata.flowCheckpointsDirOpt() != schema2StSystemMetadata.flowCheckpointsDirOpt()
+ stSystemMetadata.flowCheckpointsDir() != schema2StSystemMetadata.flowCheckpointsDir()
Review Comment:
The `@throws IllegalArgumentException` contract on `flowCheckpointsDir()` is now documented API surface, but no test exercises it. An `intercept[IllegalArgumentException]` case for a flow whose destination is neither a table nor a sink would pin it down.
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/State.scala:
##########
@@ -89,27 +89,19 @@ object State extends Logging {
private def reset(flow: ResolvedFlow, env: PipelineUpdateContext, graph: DataflowGraph): Unit = {
logInfo(log"Clearing out state for flow ${MDC(LogKeys.FLOW_NAME, flow.displayName)}")
val flowMetadata = FlowSystemMetadata(env, flow, graph)
- flow match {
- case f if flowMetadata.latestCheckpointLocationOpt().isEmpty =>
- logInfo(
- s"Skipping resetting flow ${f.identifier} since its destination not been previously" +
- s"materialized and we can't find the checkpoint location."
- )
- case _ =>
- val hadoopConf = env.spark.sessionState.newHadoopConf()
+ val hadoopConf = env.spark.sessionState.newHadoopConf()
- // Write a new checkpoint folder if needed
- val checkpointDir = new Path(flowMetadata.latestCheckpointLocation)
- val fs1 = checkpointDir.getFileSystem(hadoopConf)
- if (fs1.exists(checkpointDir)) {
- val nextVersion = checkpointDir.getName.toInt + 1
- val nextPath = new Path(checkpointDir.getParent, nextVersion.toString)
- fs1.mkdirs(nextPath)
- logInfo(
- log"Created new checkpoint for stream ${MDC(LogKeys.FLOW_NAME, flow.displayName)} " +
- log"at ${MDC(LogKeys.CHECKPOINT_PATH, nextPath.toString)}."
- )
- }
+ // Write a new checkpoint folder if needed
+ val checkpointDir = new Path(flowMetadata.latestCheckpointLocation)
Review Comment:
The PR description only covers the `SystemMetadata.scala` refactor — it doesn't mention that `reset` here also changed (the `latestCheckpointLocationOpt().isEmpty` skip branch is removed). Deleting a guard looks behavior-changing at a glance, so it's worth recording in the description that the branch was dead: `flowCheckpointsDirOpt()` was always `Some`-or-throw, so `.isEmpty` could never be true, and an invalid destination threw the same `IllegalArgumentException` from the guard itself.
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/SystemMetadata.scala:
##########
@@ -37,32 +37,33 @@ case class FlowSystemMetadata(
) extends SystemMetadata with Logging {
/**
- * Returns the checkpoint root directory for a given flow
- * which is storage/_checkpoints/flow_destination_table/flow_name.
- * @return the checkpoint root directory for `flow`
+ * @return the checkpoint root directory for this flow
+ * (of the form storage/_checkpoints/flow_destination_table/flow_name)
+ * @throws IllegalArgumentException when the flow's destination is neither a table nor sink
Review Comment:
Grammar:
```suggestion
* @throws IllegalArgumentException when the flow's destination is neither a table nor a sink
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org