Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/13065#discussion_r88754155
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
---
@@ -113,4 +117,25 @@ class WholeStageCodegenSuite extends SparkPlanTest
with SharedSQLContext {
p.asInstanceOf[WholeStageCodegenExec].child.isInstanceOf[HashAggregateExec]).isDefined)
assert(ds.collect() === Array(("a", 10.0), ("b", 3.0), ("c", 1.0)))
}
+
+ test("generate should be included in WholeStageCodegen") {
+ import org.apache.spark.sql.functions._
+ val ds = spark.range(2).select(
+ col("id"),
+ explode(array(col("id") + 1, col("id") + 2)).as("value"))
+ val plan = ds.queryExecution.executedPlan
+ assert(plan.find(p =>
+ p.isInstanceOf[WholeStageCodegenExec] &&
+
p.asInstanceOf[WholeStageCodegenExec].child.isInstanceOf[GenerateExec]).isDefined)
+ assert(ds.collect() === Array(Row(0, 1), Row(0, 2), Row(1, 2), Row(1,
3)))
+ }
+
+ test("large inline generate should fail in WholeStageCodegen") {
--- End diff --
I mean it should not reply on the fallback for failed compiling (whole plan
will fallback), but don't use whole stage codegen for this Generate.
This could be done by checking it in `Generate.supportCodegen()`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]