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

    https://github.com/apache/spark/pull/19971#discussion_r156810446
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala ---
    @@ -84,10 +79,31 @@ package object debug {
         }
         codegenSubtrees.toSeq.map { subtree =>
           val (_, source) = subtree.doCodeGen()
    -      (subtree.toString, CodeFormatter.format(source))
    +      (subtree, source)
         }
       }
     
    +  /**
    +   * Get WholeStageCodegenExec subtrees and the codegen in a query plan
    +   *
    +   * @param plan the query plan for codegen
    +   * @return Sequence of WholeStageCodegen subtrees and corresponding 
codegen
    +   */
    +  def codegenStringSeq(plan: SparkPlan): Seq[(String, String)] = {
    +    codegenSubtreeSourceSeq(plan).map(s => (s._1.toString, 
CodeFormatter.format(s._2)))
    +  }
    +
    +
    +  /**
    +   * Get WholeStageCodegenExec subtrees' CodeAndComment in a query plan
    +   *
    +   * @param plan the query plan for CodeAndComment
    +   * @return Sequence of WholeStageCodegen subtrees' `CodeAndComment`
    +   */
    +  def codegenCodeAndCommentSeq(plan: SparkPlan): Seq[CodeAndComment] = {
    +    codegenSubtreeSourceSeq(plan).map(_._2)
    --- End diff --
    
    we essentially need the changes in this file? I feel it's okay to touch 
`TPCDSQuerySuite.scala` only like: 
https://github.com/apache/spark/compare/master...maropu:SPARK-22140-FOLLOWUP


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to