Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19916#discussion_r155513526
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/SortSuite.scala ---
@@ -119,4 +120,20 @@ class SortSuite extends SparkPlanTest with
SharedSQLContext {
)
}
}
+
+ test("SPARK-22716: SortExec should not use a global variable to
reference to itself") {
+ val ctx = new CodegenContext
+ val df = Seq(("a", 1)).toDF("a", "b").sort("a")
+ val plan = df.queryExecution.executedPlan
+ val sortExec = plan.children.head.asInstanceOf[SortExec]
+ sortExec.produce(ctx, plan.asInstanceOf[CodegenSupport])
+ // we expect 8 global variables:
--- End diff --
Thanks, I was also not very happy with them too, but I have not found a
better way to test them. Do you have any idea/suggestion? Thanks.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]