Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This is a followup of #38302 . For events generated by old versions of Spark, which do not have the new errorMessage field, we should use the old way to detect query execution status (failed or not).

This PR also adds a UI test for the expected behavior.

Why are the changes needed?

backward compatibility

Does this PR introduce any user-facing change?

no

How was this patch tested?

new tests

var driverAccumUpdates = Seq[(Long, Long)]()

@volatile var metricsValues: Map[Long, String] = null
var errorMessage: Option[String] = None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: move errorMessage closer to completionTime, as they both indicate the end of the execution.

val metrics: Seq[SQLPlanMetric],
val submissionTime: Long,
val completionTime: Option[Date],
val errorMessage: Option[String],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

System.currentTimeMillis(),
// Use empty string to indicate no error, as None may mean events generated by old
// versions of Spark.
errorMessage.orElse(Some("")))
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to add docs at SparkListenerSQLExecutionEnd, Some("") is not an error. Otherwise developers may confuse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point

@cloud-fan
Copy link
Contributor Author

thanks for review, merging to master!

@cloud-fan cloud-fan closed this in 79f8c79 Nov 23, 2022
beliefer pushed a commit to beliefer/spark that referenced this pull request Dec 15, 2022
### What changes were proposed in this pull request?

This is a followup of apache#38302 . For events generated by old versions of Spark, which do not have the new `errorMessage` field, we should use the old way to detect query execution status (failed or not).

This PR also adds a UI test for the expected behavior.

### Why are the changes needed?

backward compatibility

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

new tests

Closes apache#38747 from cloud-fan/ui.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
beliefer pushed a commit to beliefer/spark that referenced this pull request Dec 18, 2022
### What changes were proposed in this pull request?

This is a followup of apache#38302 . For events generated by old versions of Spark, which do not have the new `errorMessage` field, we should use the old way to detect query execution status (failed or not).

This PR also adds a UI test for the expected behavior.

### Why are the changes needed?

backward compatibility

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

new tests

Closes apache#38747 from cloud-fan/ui.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants