Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-43973

Structured Streaming UI should display failed queries correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0, 3.2.0, 3.3.0, 3.4.0
    • 3.4.1, 3.5.0
    • Web UI
    • None

    Description

      The Structured Streaming UI is designed to be able to show a query's status (active/finished/failed) and if failed, the error message.
      Due to a bug in the implementation, the error message in QueryTerminatedEvent isn't being tracked by the UI data, so in turn the UI always shows failed queries as "finished".

      Example:

      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()
      

      Here we intentionally fail a query, but the Spark UI's Structured Streaming tab would show this as "FINISHED" without any errors, which is wrong.

      Attachments

        Activity

          People

            rednaxelafx Kris Mok
            rednaxelafx Kris Mok
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: