You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/25 14:47:53 UTC

[GitHub] [spark] wangyum commented on a change in pull request #29642: [SPARK-32792][SQL] Improve in filter pushdown for ParquetFilters

wangyum commented on a change in pull request #29642:
URL: https://github.com/apache/spark/pull/29642#discussion_r511606498



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala
##########
@@ -597,12 +599,26 @@ class ParquetFilters(
         createFilterHelper(pred, canPartialPushDownConjuncts = false)
           .map(FilterApi.not)
 
-      case sources.In(name, values) if canMakeFilterOn(name, values.head)
-        && values.distinct.length <= pushDownInFilterThreshold =>

Review comment:
       Sort performance:
   ```scala
   import org.apache.spark.benchmark.Benchmark
   val N = 20000000
   val array = Range(1, N).map(_.%(10000000)).toArray
   val benchmark = new Benchmark(s"Benchmark distinct", valuesPerIteration = N, minNumIters = 30)
   benchmark.addCase("array.sorted") { _ =>
     array.sorted
   }
   benchmark.addCase("array.distinct") { _ =>
     array.distinct
   }
   benchmark.run()
   ```
   ```
   Java HotSpot(TM) 64-Bit Server VM 1.8.0_251-b08 on Mac OS X 10.15.6
   Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
   Benchmark distinct:                       Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
   ------------------------------------------------------------------------------------------------------------------------
   array.sorted                                        296            821         NaN         67.7          14.8       1.0X
   array.distinct                                     3005           3933         330          6.7         150.2       0.1X
   
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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