spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiangxb1987 <...@git.apache.org>
Subject [GitHub] spark pull request #15319: [SPARK-17733][SQL] InferFiltersFromConstraints ru...
Date Sat, 01 Oct 2016 08:33:51 GMT
Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15319#discussion_r81446306
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/InferFiltersFromConstraintsSuite.scala
---
    @@ -120,4 +122,28 @@ class InferFiltersFromConstraintsSuite extends PlanTest {
         val optimized = Optimize.execute(originalQuery)
         comparePlans(optimized, correctAnswer)
       }
    +
    +  test("don't generate constraints for recursive functions") {
    +    val t1 = testRelation.subquery('t1)
    +    val t2 = testRelation.subquery('t2)
    +    val t3 = testRelation.subquery('t3)
    +
    +    val originalQuery = t1.select('a, 'b.as('d), Coalesce(Seq('a, 'b)).as('int_col)).as("t")
    +      .join(t2, Inner,
    +        Some("t.a".attr === "t2.a".attr
    +          && "t.d".attr === "t2.a".attr
    +          && "t.int_col".attr === "t2.a".attr))
    +      .analyze
    +    val correctAnswer = t1.where(IsNotNull('a) && 'a === Coalesce(Seq('a, 'b))
    +      && IsNotNull('b) && 'b === Coalesce(Seq('a, 'b))
    +      && IsNotNull(Coalesce(Seq('a, 'b))) && 'a === 'b)
    --- End diff --
    
    These predicates are infered from `t.a = t2.a, t.d = t2.a, t.int_col = t2.a`, which in
line with our expectation.


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

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


Mime
View raw message