You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "bertvermeiren (via GitHub)" <gi...@apache.org> on 2025/03/18 10:21:54 UTC

[D] enum Expr extension on logical level [datafusion]

GitHub user bertvermeiren created a discussion: enum Expr extension on logical level

Hi,

In order to write some additional logical and physical plan implementations, we do have to create some kind of "composite" logical expression. 

Nowadays in the code base you have already existing expression implementations with such composite behaviour like the `ScalarFunction` expression containing other expressions (the arguments) ; the `AggregateFunction` containing filtering and order by expressions, etc.

Lot's of interfaces/API/traits are working on the `enum Expr` directly :

`UserLogicalNode::with_exprs_and_inputs` and related `UserLogicalNode::expressions`
Applying optimisation rules on those logical plans by analysing and potentially rewriting expressions.

By not having some customisation, we loose the internal semantics  of “composite” logical expressions if those have to be “decomposed” again into existing expression implementations to be used throughput the codebase.

Would it be opportune the have an extension point on logical expression as well, like it has been introduced on the `LogicalPlan::Extension(Extension)`?

What are the opinions on this ? Are there other alternatives ? How would such an extension look like ? 

Regards, Bert.


GitHub link: https://github.com/apache/datafusion/discussions/15297

----
This is an automatically sent email for github@datafusion.apache.org.
To unsubscribe, please send an email to: github-unsubscribe@datafusion.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [D] enum Expr extension on logical level [datafusion]

Posted by "bertvermeiren (via GitHub)" <gi...@apache.org>.
GitHub user bertvermeiren edited a discussion: enum Expr extension on logical level

Hi,

In order to write some additional logical and physical plan implementations, we do have to create some kind of "composite" logical expression. 

Nowadays in the code base you have already existing expression implementations with such composite behaviour like the `ScalarFunction` expression containing other expressions (the arguments) ; the `AggregateFunction` containing _filtering_ and _order by_ expressions, etc.

Lot's of interfaces/API/traits are working on the `enum Expr` directly :

`UserLogicalNode::with_exprs_and_inputs` and related `UserLogicalNode::expressions`
Applying optimisation rules on those logical plans by analysing and potentially rewriting expressions.

By not having some customisation, we loose the internal semantics  of “composite” logical expressions if those have to be “decomposed” again into existing expression implementations to be used throughout the codebase.

Would it be opportune the have an extension point on logical expression as well, like it has been introduced on the `LogicalPlan::Extension(Extension)`?

What are the opinions on this ? Are there other alternatives ? How would such an extension look like ? 

Regards, Bert.


GitHub link: https://github.com/apache/datafusion/discussions/15297

----
This is an automatically sent email for github@datafusion.apache.org.
To unsubscribe, please send an email to: github-unsubscribe@datafusion.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org