[ 
https://issues.apache.org/jira/browse/SPARK-32792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yuming Wang updated SPARK-32792:
--------------------------------
    Description: 
Support push down `GreaterThanOrEqual` minimum value and `LessThanOrEqual` 
maximum value  when its values exceeds 
`spark.sql.parquet.pushdown.inFilterThreshold`. For example:

```sql
SELECT * FROM t WHERE id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15)
```

We will push down `id >= 1 and id <= 15`.

  was:
[https://github.com/apache/spark/blob/d6a68e0b67ff7de58073c176dd097070e88ac831/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala#L600-L602]
{code:scala}
      case sources.In(name, values) if canMakeFilterOn(name, values.head)
        && values.distinct.length <= pushDownInFilterThreshold =>
        values.distinct.flatMap { v =>
{code}

*distinct* is expensive
 


> Improve in filter pushdown for ParquetFilters
> ---------------------------------------------
>
>                 Key: SPARK-32792
>                 URL: https://issues.apache.org/jira/browse/SPARK-32792
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> Support push down `GreaterThanOrEqual` minimum value and `LessThanOrEqual` 
> maximum value  when its values exceeds 
> `spark.sql.parquet.pushdown.inFilterThreshold`. For example:
> ```sql
> SELECT * FROM t WHERE id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15)
> ```
> We will push down `id >= 1 and id <= 15`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to