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

    https://github.com/apache/spark/pull/5369#discussion_r27808307
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/FilteredScanSuite.scala ---
    @@ -233,6 +258,73 @@ class FilteredScanSuite extends DataSourceTest {
     
       testPushDown("SELECT a, b, c FROM oneToTenFiltered WHERE c like '%eE%'", 
1)
       testPushDown("SELECT a, b, c FROM oneToTenFiltered WHERE c like '%Ee%'", 
0)
    + 
    +  // Filter should not be duplicate with pushdown predicate 
    +  // This query should not have Filter node and have 1 row
    +  testNotFilter("SELECT a, b FROM oneToTenFiltered WHERE a = 1", 1)
    +  // This query have Filter node which filters 10 rows to 1 row
    +  testFilter("SELECT a, b FROM oneToTenFiltered WHERE b = 2", 10, 1)
    + 
    +  def testNotFilter(sqlString: String, count: Int): Unit = {
    +    test(s"Without Filter: $sqlString") {
    +      val queryExecution = sql(sqlString).queryExecution
    +      val filterPlan = queryExecution.executedPlan.collect {
    +        case f: execution.Filter => f
    +      } match {
    +        case Seq(f) => fail(s"Shouldn't find Filter\n$queryExecution")
    +        case _ =>
    +      }
    + 
    +      val physicalRDDPlan = queryExecution.executedPlan.collect {
    +        case p: execution.PhysicalRDD => p
    +      } match {
    +        case Seq(p) => p
    +        case _ => fail(s"Can't find PhysicalRDD\n$queryExecution")
    +      }
    --- End diff --
    
    Oh I see, you're checking whether the filter is pushed down here. Good 
point.


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