Repository navigation
Consolidate Example: simplify_udaf_expression.rs into advanced_udaf.rs #13842
Description
Activity
- addedenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
on Dec 19, 2024 - changed the title
[-]Consolidate parquet.sql into [/-][+]Consolidate Example: simplify_udaf_expression.rs into advanced_udaf.rs[/+]on Dec 19, 2024 take
Reacted by Andrew LambThank you @takaebato 🙏
Reacted by Takahiro EbatoSorry for the delay🙏 But I have a quick question!
I’m not too sure about this, but should the return type ofAggregateFunctionSimplificationperhaps beResult<ExprSimplifyResult>(or a similar enum that can indicate whether or not simplification occurred)?Currently, it doesn’t seem possible to skip simplification, as it always returns a simplified
Expr(or Err).
Thesimplifymethod can return anOption, but the decision to simplify seems to rely on information passed toAggregateFunctionSimplification, so might it be better if this method can choose whether or not to simplify..?Sorry for the delay🙏 But I have a quick question! I’m not too sure about this, but should the return type of
AggregateFunctionSimplificationperhaps beResult<ExprSimplifyResult>(or a similar enum that can indicate whether or not simplification occurred)?Currently, it doesn’t seem possible to skip simplification, as it always returns a simplified
Expr(or Err). Thesimplifymethod can return anOption, but the decision to simplify seems to rely on information passed toAggregateFunctionSimplification, so might it be better if this method can choose whether or not to simplify..?The rationale for returning ExprSimplifyResult is so that the argument doesn't have to be cloned -- aka to avoid coping the ownership of argument is passed to the function and there needs to be some way to get the original structuer back
Thank you so much for the explanation!!
(I also realized that if we want to use the actual implementation conditionally, we can returnOk(Expr::AggregateFunction(aggregate_function)).)Reacted by Andrew Lamb
Is your feature request related to a problem or challenge?
The large number of small examples in DataFusion leads to multiple problems:
cargo ttime (each binary must be linked / created)Thus I think the fewer examples we have the
Describe the solution you'd like
Then update the readme page:
Describe alternatives you've considered
No response
Additional context
I think this is a good first issue as the task is straightforward and doesn't require deep understanding of the DataFusion codebase