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

    https://github.com/apache/spark/pull/10678#discussion_r50047396
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
 ---
    @@ -76,6 +76,118 @@ class AnalysisSuite extends AnalysisTest {
           caseSensitive = false)
       }
     
    +  test("resolve sort references - filter/limit") {
    +    val a = testRelation2.output(0)
    +    val b = testRelation2.output(1)
    +    val c = testRelation2.output(2)
    +
    +    // Case 1: one missing attribute is in the leaf node and another is in 
the unary node
    +    val plan1 = testRelation2
    +      .where('a > 0).select('a, 'b)
    +      .where('b > 0).select('a)
    +      .limit(4)
    +      .sortBy('b.asc, 'c.desc)
    +    val expected1 = testRelation2
    +      .where(a.cast(DoubleType) > Literal(0).cast(DoubleType)).select(a, 
b, c)
    +      .where(b.cast(DoubleType) > Literal(0).cast(DoubleType)).select(a, 
b, c)
    --- End diff --
    
    We can pick the attributes carefully(like pick a int column instead of `a`) 
to avoid adding cast in analyzed plan, to make the test easier to read.


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