-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-43973][SS][UI] Structured Streaming UI should display failed queries correctly #41468
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gengliangwang
approved these changes
Jun 5, 2023
Member
|
Merging to master/3.4 |
gengliangwang
pushed a commit
that referenced
this pull request
Jun 6, 2023
…ueries correctly ### What changes were proposed in this pull request? Handle the `exception` message from Structured Streaming's `QueryTerminatedEvent` in `StreamingQueryStatusListener`, so that the Structured Streaming UI can display the status and error message correctly for failed queries. ### Why are the changes needed? The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the `exception` from `QueryTerminatedEvent` in `StreamingQueryStatusListener.onQueryTerminated`, so that field is never updated in the UI data, i.e. it's always `None`. In turn, the UI would always show the status of failed queries as `FINISHED` instead of `FAILED`. ### Does this PR introduce _any_ user-facing change? Yes. Failed Structured Streaming queries would show incorrectly as `FINISHED` before the fix:  and show correctly as `FAILED` after the fix:  The example query is: ```scala implicit val ctx = spark.sqlContext import org.apache.spark.sql.execution.streaming.MemoryStream spark.conf.set("spark.sql.ansi.enabled", "true") val inputData = MemoryStream[(Int, Int)] val df = inputData.toDF().selectExpr("_1 / _2 as a") inputData.addData((1, 2), (3, 4), (5, 6), (7, 0)) val testQuery = df.writeStream.format("memory").queryName("kristest").outputMode("append").start testQuery.processAllAvailable() ``` ### How was this patch tested? Added UT to `StreamingQueryStatusListenerSuite` Closes #41468 from rednaxelafx/fix-streaming-ui. Authored-by: Kris Mok <[email protected]> Signed-off-by: Gengliang Wang <[email protected]> (cherry picked from commit 51a919e) Signed-off-by: Gengliang Wang <[email protected]>
Contributor
|
@rednaxelafx @gengliangwang Looks like CI is failing for 3.4, FYI |
Member
|
Thank you for reporting, @kazuyukitanimura . I'm looking at it now |
Member
|
The difference is the following. I'll make a follow-up PR quickly. |
Member
dongjoon-hyun
left a comment
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.
I made a follow-up. Let's wait for the CI result.
dongjoon-hyun
added a commit
that referenced
this pull request
Jun 6, 2023
…ing QueryTerminatedEvent constructor ### What changes were proposed in this pull request? This is a follow-up of #41468 to fix `branch-3.4`'s compilation issue. ### Why are the changes needed? To recover the compilation. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. Closes #41484 from dongjoon-hyun/SPARK-43973. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
czxm
pushed a commit
to czxm/spark
that referenced
this pull request
Jun 12, 2023
…ueries correctly ### What changes were proposed in this pull request? Handle the `exception` message from Structured Streaming's `QueryTerminatedEvent` in `StreamingQueryStatusListener`, so that the Structured Streaming UI can display the status and error message correctly for failed queries. ### Why are the changes needed? The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the `exception` from `QueryTerminatedEvent` in `StreamingQueryStatusListener.onQueryTerminated`, so that field is never updated in the UI data, i.e. it's always `None`. In turn, the UI would always show the status of failed queries as `FINISHED` instead of `FAILED`. ### Does this PR introduce _any_ user-facing change? Yes. Failed Structured Streaming queries would show incorrectly as `FINISHED` before the fix:  and show correctly as `FAILED` after the fix:  The example query is: ```scala implicit val ctx = spark.sqlContext import org.apache.spark.sql.execution.streaming.MemoryStream spark.conf.set("spark.sql.ansi.enabled", "true") val inputData = MemoryStream[(Int, Int)] val df = inputData.toDF().selectExpr("_1 / _2 as a") inputData.addData((1, 2), (3, 4), (5, 6), (7, 0)) val testQuery = df.writeStream.format("memory").queryName("kristest").outputMode("append").start testQuery.processAllAvailable() ``` ### How was this patch tested? Added UT to `StreamingQueryStatusListenerSuite` Closes apache#41468 from rednaxelafx/fix-streaming-ui. Authored-by: Kris Mok <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
snmvaughan
pushed a commit
to snmvaughan/spark
that referenced
this pull request
Jun 20, 2023
…ueries correctly ### What changes were proposed in this pull request? Handle the `exception` message from Structured Streaming's `QueryTerminatedEvent` in `StreamingQueryStatusListener`, so that the Structured Streaming UI can display the status and error message correctly for failed queries. ### Why are the changes needed? The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the `exception` from `QueryTerminatedEvent` in `StreamingQueryStatusListener.onQueryTerminated`, so that field is never updated in the UI data, i.e. it's always `None`. In turn, the UI would always show the status of failed queries as `FINISHED` instead of `FAILED`. ### Does this PR introduce _any_ user-facing change? Yes. Failed Structured Streaming queries would show incorrectly as `FINISHED` before the fix:  and show correctly as `FAILED` after the fix:  The example query is: ```scala implicit val ctx = spark.sqlContext import org.apache.spark.sql.execution.streaming.MemoryStream spark.conf.set("spark.sql.ansi.enabled", "true") val inputData = MemoryStream[(Int, Int)] val df = inputData.toDF().selectExpr("_1 / _2 as a") inputData.addData((1, 2), (3, 4), (5, 6), (7, 0)) val testQuery = df.writeStream.format("memory").queryName("kristest").outputMode("append").start testQuery.processAllAvailable() ``` ### How was this patch tested? Added UT to `StreamingQueryStatusListenerSuite` Closes apache#41468 from rednaxelafx/fix-streaming-ui. Authored-by: Kris Mok <[email protected]> Signed-off-by: Gengliang Wang <[email protected]> (cherry picked from commit 51a919e) Signed-off-by: Gengliang Wang <[email protected]>
snmvaughan
pushed a commit
to snmvaughan/spark
that referenced
this pull request
Jun 20, 2023
…ing QueryTerminatedEvent constructor ### What changes were proposed in this pull request? This is a follow-up of apache#41468 to fix `branch-3.4`'s compilation issue. ### Why are the changes needed? To recover the compilation. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. Closes apache#41484 from dongjoon-hyun/SPARK-43973. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
GladwinLee
pushed a commit
to lyft/spark
that referenced
this pull request
Oct 10, 2023
…ueries correctly ### What changes were proposed in this pull request? Handle the `exception` message from Structured Streaming's `QueryTerminatedEvent` in `StreamingQueryStatusListener`, so that the Structured Streaming UI can display the status and error message correctly for failed queries. ### Why are the changes needed? The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the `exception` from `QueryTerminatedEvent` in `StreamingQueryStatusListener.onQueryTerminated`, so that field is never updated in the UI data, i.e. it's always `None`. In turn, the UI would always show the status of failed queries as `FINISHED` instead of `FAILED`. ### Does this PR introduce _any_ user-facing change? Yes. Failed Structured Streaming queries would show incorrectly as `FINISHED` before the fix:  and show correctly as `FAILED` after the fix:  The example query is: ```scala implicit val ctx = spark.sqlContext import org.apache.spark.sql.execution.streaming.MemoryStream spark.conf.set("spark.sql.ansi.enabled", "true") val inputData = MemoryStream[(Int, Int)] val df = inputData.toDF().selectExpr("_1 / _2 as a") inputData.addData((1, 2), (3, 4), (5, 6), (7, 0)) val testQuery = df.writeStream.format("memory").queryName("kristest").outputMode("append").start testQuery.processAllAvailable() ``` ### How was this patch tested? Added UT to `StreamingQueryStatusListenerSuite` Closes apache#41468 from rednaxelafx/fix-streaming-ui. Authored-by: Kris Mok <[email protected]> Signed-off-by: Gengliang Wang <[email protected]> (cherry picked from commit 51a919e) Signed-off-by: Gengliang Wang <[email protected]>
GladwinLee
pushed a commit
to lyft/spark
that referenced
this pull request
Oct 10, 2023
…ing QueryTerminatedEvent constructor ### What changes were proposed in this pull request? This is a follow-up of apache#41468 to fix `branch-3.4`'s compilation issue. ### Why are the changes needed? To recover the compilation. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. Closes apache#41484 from dongjoon-hyun/SPARK-43973. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
catalinii
pushed a commit
to lyft/spark
that referenced
this pull request
Oct 10, 2023
…ueries correctly ### What changes were proposed in this pull request? Handle the `exception` message from Structured Streaming's `QueryTerminatedEvent` in `StreamingQueryStatusListener`, so that the Structured Streaming UI can display the status and error message correctly for failed queries. ### Why are the changes needed? The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the `exception` from `QueryTerminatedEvent` in `StreamingQueryStatusListener.onQueryTerminated`, so that field is never updated in the UI data, i.e. it's always `None`. In turn, the UI would always show the status of failed queries as `FINISHED` instead of `FAILED`. ### Does this PR introduce _any_ user-facing change? Yes. Failed Structured Streaming queries would show incorrectly as `FINISHED` before the fix:  and show correctly as `FAILED` after the fix:  The example query is: ```scala implicit val ctx = spark.sqlContext import org.apache.spark.sql.execution.streaming.MemoryStream spark.conf.set("spark.sql.ansi.enabled", "true") val inputData = MemoryStream[(Int, Int)] val df = inputData.toDF().selectExpr("_1 / _2 as a") inputData.addData((1, 2), (3, 4), (5, 6), (7, 0)) val testQuery = df.writeStream.format("memory").queryName("kristest").outputMode("append").start testQuery.processAllAvailable() ``` ### How was this patch tested? Added UT to `StreamingQueryStatusListenerSuite` Closes apache#41468 from rednaxelafx/fix-streaming-ui. Authored-by: Kris Mok <[email protected]> Signed-off-by: Gengliang Wang <[email protected]> (cherry picked from commit 51a919e) Signed-off-by: Gengliang Wang <[email protected]>
catalinii
pushed a commit
to lyft/spark
that referenced
this pull request
Oct 10, 2023
…ing QueryTerminatedEvent constructor ### What changes were proposed in this pull request? This is a follow-up of apache#41468 to fix `branch-3.4`'s compilation issue. ### Why are the changes needed? To recover the compilation. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. Closes apache#41484 from dongjoon-hyun/SPARK-43973. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Handle the
exceptionmessage from Structured Streaming'sQueryTerminatedEventinStreamingQueryStatusListener, so that the Structured Streaming UI can display the status and error message correctly for failed queries.Why are the changes needed?
The original implementation of the Structured Streaming UI had a copy-and-paste bug where it forgot to handle the
exceptionfromQueryTerminatedEventinStreamingQueryStatusListener.onQueryTerminated, so that field is never updated in the UI data, i.e. it's alwaysNone. In turn, the UI would always show the status of failed queries asFINISHEDinstead ofFAILED.Does this PR introduce any user-facing change?
Yes. Failed Structured Streaming queries would show incorrectly as


FINISHEDbefore the fix:and show correctly as
FAILEDafter the fix:The example query is:
How was this patch tested?
Added UT to
StreamingQueryStatusListenerSuite