You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wecharyu (via GitHub)" <gi...@apache.org> on 2023/09/18 10:10:24 UTC

[GitHub] [spark] wecharyu opened a new pull request, #42978: [SPARK-45199][SQL] Release cast from attribute in filter to support predicate push down

wecharyu opened a new pull request, #42978:
URL: https://github.com/apache/spark/pull/42978

   ### What changes were proposed in this pull request?
   When a `cast clause` was used in a column in a filter, it will not be able to push down. We can remove the cast from attribute side to support predicate push down if the cast not change the precision or range.
   
   
   ### Why are the changes needed?
   To use more predicate push down in query. For example:
   ```sql
   -- dt is string type
   explain select * from wechar_tbl where cast(dt as date) = date_sub(current_date(), 1);
   ```
   - Before this patch
   ```bash
   == Physical Plan ==
   *(1) ColumnarToRow
   +- FileScan parquet default.wechar_tbl[id#5,name#6,dt#7] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex(0 paths)[], PartitionFilters: [isnotnull(dt#7), (cast(dt#7 as date) = 2023-09-17)], PushedFilters: [], ReadSchema: struct<id:int,name:string>
   ```
   **(cast(dt#7 as date) = 2023-09-17) can not be push down in partition filter**
   - After this patch
   ```bash
   == Physical Plan ==
   *(1) ColumnarToRow
   +- FileScan parquet default.wechar_tbl[id#62,name#63,dt#64] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex[], PartitionFilters: [isnotnull(dt#64), (dt#64 = 2023-09-17)], PushedFilters: [], ReadSchema: struct<id:int,name:string>
   ```
   **(dt#64 = 2023-09-17) can be push down in partition filter**
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Add unit test.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] wecharyu commented on pull request #42978: [SPARK-45199][SQL] Release cast from attribute in filter to support predicate push down

Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on PR #42978:
URL: https://github.com/apache/spark/pull/42978#issuecomment-1725272972

   @cloud-fan could you please take a look?


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


Re: [PR] [SPARK-45199][SQL] Release cast from attribute in filter to support predicate push down [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #42978: [SPARK-45199][SQL] Release cast from attribute in filter to support predicate push down
URL: https://github.com/apache/spark/pull/42978


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


Re: [PR] [SPARK-45199][SQL] Release cast from attribute in filter to support predicate push down [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42978:
URL: https://github.com/apache/spark/pull/42978#issuecomment-1871639134

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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