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

    https://github.com/apache/spark/pull/7162#discussion_r33995110
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala ---
    @@ -92,27 +153,25 @@ object SparkPlanTest {
        * @param expectedAnswer the expected result in a [[Seq]] of [[Row]]s.
        */
       def checkAnswer(
    -      input: DataFrame,
    -      planFunction: SparkPlan => SparkPlan,
    +      input: Seq[DataFrame],
    +      planFunction: Seq[SparkPlan] => SparkPlan,
           expectedAnswer: Seq[Row]): Option[String] = {
     
    -    val outputPlan = planFunction(input.queryExecution.sparkPlan)
    +    val outputPlan = planFunction(input.map(_.queryExecution.sparkPlan))
     
         // A very simple resolver to make writing tests easier. In contrast to 
the real resolver
         // this is always case sensitive and does not try to handle scoping or 
complex type resolution.
    -    val resolvedPlan = outputPlan transform {
    -      case plan: SparkPlan =>
    -        val inputMap = plan.children.flatMap(_.output).zipWithIndex.map {
    -          case (a, i) =>
    -            (a.name, BoundReference(i, a.dataType, a.nullable))
    --- End diff --
    
    @kai-zeng, why did you remove this code which creates `BoundReference`s?  
In the other half of the diff below, it looks like the new code is only mapping 
from the attribute's name back to the attribute itself rather than binding the 
reference.  This change caused a test case in my sorting patch to fail.


---
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]

Reply via email to