You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 15:00:36 UTC

[GitHub] [arrow-datafusion] jdye64 opened a new issue, #2214: Support for Selective Aggregates, Filter clause

jdye64 opened a new issue, #2214:
URL: https://github.com/apache/arrow-datafusion/issues/2214

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   PostgreSQL supports the SQL `Filter Clause` which is a clause that filters certain rows based on the defined row expressions before an aggregation is performed. Currently Datafusion does not provide a mechanism for parsing those clauses. See [Filter Clause](https://modern-sql.com/feature/filter) for more in depth details on the clauses behavior.
   
   **Describe the solution you'd like**
   The `datafusion::logical_plan::plan::Aggregate` struct should include a new member Ex: `pub filter_expr: Vec<Expr>` which contains the filtering expressions that could be applied by the consuming engine before performing the actual aggregations that are defined in `pub aggr_expr: Vec<Expr>` 
   
   **Describe alternatives you've considered**
   None
   
   **Additional context**
   Description of the syntax and functionality can be found [here](https://modern-sql.com/feature/filter)
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] jhorstmann commented on issue #2214: Support for Selective Aggregates, Filter clause

Posted by GitBox <gi...@apache.org>.
jhorstmann commented on issue #2214:
URL: https://github.com/apache/arrow-datafusion/issues/2214#issuecomment-1097953956

   Note that for most aggregation functions this could be done purely on logical plan level by rewriting `AGGREGATE(input) FILTER (WHERE condition)` to `AGGREGATE(IF(condition, input, NULL))`. This works because aggregations usually ignore `NULL` values themselves. One exception I can think of would be `ARRAY_AGG` which I think keeps `NULL` values.


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] poonai commented on issue #2214: Support for Selective Aggregates, Filter clause

Posted by GitBox <gi...@apache.org>.
poonai commented on issue #2214:
URL: https://github.com/apache/arrow-datafusion/issues/2214#issuecomment-1242002173

   Excited!!. I've implemented `PhysicalExpr` with `filter` support. I'll raise an PR with relevant changes after the mentioned PR get merged.  
   
   


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] yjshen closed issue #2214: Support for Selective Aggregates, Filter clause

Posted by "yjshen (via GitHub)" <gi...@apache.org>.
yjshen closed issue #2214: Support for Selective Aggregates, Filter clause
URL: https://github.com/apache/arrow-datafusion/issues/2214


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove commented on issue #2214: Support for Selective Aggregates, Filter clause

Posted by GitBox <gi...@apache.org>.
andygrove commented on issue #2214:
URL: https://github.com/apache/arrow-datafusion/issues/2214#issuecomment-1241988308

   There is a related PR to add support in the SQL query planner and logical plan, but does not add physical plan support: https://github.com/apache/arrow-datafusion/pull/3405


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] poonai commented on issue #2214: Support for Selective Aggregates, Filter clause

Posted by GitBox <gi...@apache.org>.
poonai commented on issue #2214:
URL: https://github.com/apache/arrow-datafusion/issues/2214#issuecomment-1236673635

   I would love to pick this and work on it 


-- 
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: github-unsubscribe@arrow.apache.org

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