spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yucai <...@git.apache.org>
Subject [GitHub] spark pull request #20851: [SPARK-23727][SQL] Support for pushing down filte...
Date Wed, 21 Mar 2018 00:34:29 GMT
Github user yucai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20851#discussion_r175962888
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
---
    @@ -313,6 +315,36 @@ class ParquetFilterSuite extends QueryTest with ParquetTest with
SharedSQLContex
         }
       }
     
    +  test("filter pushdown - date") {
    +    implicit class IntToDate(int: Int) {
    +      def d: Date = new Date(Date.valueOf("2018-03-01").getTime + 24 * 60 * 60 * 1000
* (int - 1))
    +    }
    +
    +    withParquetDataFrame((1 to 4).map(i => Tuple1(i.d))) { implicit df =>
    +      checkFilterPredicate('_1.isNull, classOf[Eq[_]], Seq.empty[Row])
    +      checkFilterPredicate('_1.isNotNull, classOf[NotEq[_]], (1 to 4).map(i => Row.apply(i.d)))
    +
    +      checkFilterPredicate('_1 === 1.d, classOf[Eq[_]], 1.d)
    --- End diff --
    
    I agree 1.date is better, but binary is using "1.b", should we keep the same pattern with
it?
    ```
      test("filter pushdown - binary") {
        implicit class IntToBinary(int: Int) {
          def b: Array[Byte] = int.toString.getBytes(StandardCharsets.UTF_8)
        }
    ```


---

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


Mime
View raw message