cloud-fan commented on a change in pull request #28715:
URL: https://github.com/apache/spark/pull/28715#discussion_r437986642



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala
##########
@@ -51,6 +51,77 @@ class WholeStageCodegenSuite extends QueryTest with 
SharedSparkSession
     assert(df.collect() === Array(Row(9, 4.5)))
   }
 
+  test("GenerateExec should be included in WholeStageCodegen") {
+    val arrayData1 = Seq(
+      Row("James", List("Java", "Scala"), Map("hair" -> "black", "eye" -> 
"brown"))
+    )
+
+    val arraySchema1 = new StructType()
+      .add("name", StringType)
+      .add("knownLanguages", ArrayType(StringType))
+      .add("properties", MapType(StringType, StringType))
+
+    val df = spark.createDataFrame(spark.sparkContext.parallelize(arrayData1), 
arraySchema1)
+
+    // Array - explode
+    var expDF = df.select($"name", explode($"knownLanguages"), $"properties")
+    var plan = expDF.queryExecution.executedPlan
+    assert(plan.find {
+      case stage: WholeStageCodegenExec =>
+        stage.find(_.isInstanceOf[GenerateExec]).isDefined
+      case _ =>
+        false

Review comment:
       nit: `case _ => false`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to