Github user arunmahadevan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21222#discussion_r186238156
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala ---
    @@ -116,6 +168,30 @@ package object debug {
         }
       }
     
    +  implicit class DebugStreamQuery(query: StreamingQuery) extends Logging {
    +    def debug(): Unit = {
    +      query match {
    +        case w: StreamExecution =>
    --- End diff --
    
    The expectations is that `query.debug` and `query.debugCodegen` should work 
correct ? I think you need to match `StreamingQuery` and extract the 
`StreamExecution` here.
    
    At-least in the spark-shell the return value for `DataStreamWriter.start` 
is a StreamingQueryWrapper.
    ```
    scala> import org.apache.spark.sql.execution.debug._
    import org.apache.spark.sql.execution.debug._
    
    scala> val query = 
windowedCounts.writeStream.outputMode("complete").format("console").option("truncate",
 "false").start()
    query: org.apache.spark.sql.streaming.StreamingQuery = 
org.apache.spark.sql.execution.streaming.StreamingQueryWrapper@6eb825e4
    scala> query.debug
    Only supported for StreamExecution.
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to