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

    https://github.com/apache/spark/pull/9659#discussion_r44648531
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
 ---
    @@ -104,118 +113,143 @@ class ParquetFilterSuite extends QueryTest with 
ParquetTest with SharedSQLContex
         checkBinaryFilterPredicate(predicate, filterClass, 
Seq(Row(expected)))(df)
       }
     
    -  test("filter pushdown - boolean") {
    -    withParquetDataFrame((true :: false :: Nil).map(b => 
Tuple1.apply(Option(b)))) { implicit df =>
    -      checkFilterPredicate('_1.isNull, classOf[Eq[_]], Seq.empty[Row])
    -      checkFilterPredicate('_1.isNotNull, classOf[NotEq[_]], 
Seq(Row(true), Row(false)))
    +  private def extractSourceRDDToDataFrame(df: DataFrame): DataFrame = {
     
    -      checkFilterPredicate('_1 === true, classOf[Eq[_]], true)
    -      checkFilterPredicate('_1 <=> true, classOf[Eq[_]], true)
    -      checkFilterPredicate('_1 !== true, classOf[NotEq[_]], false)
    +    // This is the source RDD without Spark-side filtering.
    +    val schema = df.schema
    +    val childRDD = df
    +      .queryExecution
    +      .executedPlan.asInstanceOf[org.apache.spark.sql.execution.Filter]
    +      .child
    +      .execute()
    +      .map(row => Row.fromSeq(row.toSeq(schema)))
    +
    +    sqlContext.createDataFrame(childRDD, schema)
    +  }
    +
    +  test("filter pushdown - boolean") {
    +    withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true") {
    +      withParquetDataFrame((true :: false :: Nil).map(b => 
Tuple1.apply(Option(b))))
    +      { implicit df =>
    --- End diff --
    
    Please follow the style below in this case:
    
    ```scala
    withParquetDataFrame(...) {
      implicit df =>
        checkFilterPredicate(...)
        ...
    }
    ```


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