Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9123#discussion_r42158784
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
 ---
    @@ -135,4 +135,14 @@ class AnalysisSuite extends AnalysisTest {
         plan = testRelation.select(CreateStructUnsafe(Seq(a, (a + 
1).as("a+1"))).as("col"))
         checkAnalysis(plan, plan)
       }
    +
    +  test("SPARK-10534: resolve attribute references in order by clause") {
    +    val a = testRelation2.output(0)
    +    val c = testRelation2.output(2)
    +
    +    val plan = testRelation2.select(c).orderBy(Floor(a).asc)
    --- End diff --
    
    use `'c` and `'a` instead of `c` and `a`. The `plan` will get analyzed in 
the method `checkAnalysis`, so we should give unresolved attributes, to 
simulate normal query plans. (FYI, in spark SQL DSL, the symbol `'a` will be 
automatically turned into `UnresolvedAttribute`)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to