Skip to content

[SPARK-52346][SDP] Fix counter initialization and increment logic for flow retries #52094

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JiaqiWang18
Copy link
Contributor

@JiaqiWang18 JiaqiWang18 commented Aug 22, 2025

What changes were proposed in this pull request?

Fixes flow failure counter increments by switching to updateWith. This prevents first increment from throwing NoSuchElementException when key does not exist.

Why are the changes needed?

Current impl flowToNumConsecutiveFailure(flowIdentifier) throws exception when a flow is retried for first time:

java.util.NoSuchElementException: key not found: `spark_catalog`.`test_db`.`mv`
	at scala.collection.MapOps.default(Map.scala:289)
	at scala.collection.MapOps.default$(Map.scala:288)
	at scala.collection.AbstractMap.default(Map.scala:420)
	at scala.collection.MapOps.apply(Map.scala:176)
	at scala.collection.MapOps.apply$(Map.scala:175)
	at scala.collection.AbstractMap.apply(Map.scala:420)
	at org.apache.spark.sql.pipelines.graph.GraphExecution.incrementFlowToNumConsecutiveFailure(GraphExecution.scala:52)
	at org.apache.spark.sql.pipelines.graph.GraphExecution.$anonfun$planAndStartFlow$1(GraphExecution.scala:92)
	at org.apache.spark.sql.pipelines.graph.GraphExecution.$anonfun$planAndStartFlow$1$adapted(GraphExecution.scala:90)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)

Does this PR introduce any user-facing change?

No

How was this patch tested?

Run pipeline manually with flow failure to test.

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Aug 22, 2025
@JiaqiWang18 JiaqiWang18 changed the title [SDP] Fix counter initialization and increment logic for flow retries [SPARK-52346][SDP] Fix counter initialization and increment logic for flow retries Aug 22, 2025
@JiaqiWang18
Copy link
Contributor Author

@SCHJonathan @gengliangwang for review, thanks!

@JiaqiWang18
Copy link
Contributor Author

Also @anishm-db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants