You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by maropu <gi...@git.apache.org> on 2017/12/13 22:56:47 UTC
[GitHub] spark pull request #19971: [SPARK-22774][SQL][Test] Add compilation check in...
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: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org