edmondop commented on PR #8447: URL: https://github.com/apache/arrow-datafusion/pull/8447#issuecomment-1850442176
That would be great. I am not sure how to do that without duplicating the code from the Analyzer that resolves built in functions On Mon, 11 Dec 2023 at 07:21, Andrew Lamb ***@***.***> wrote: > For example, this test > https://github.com/apache/arrow-datafusion/blob/main/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs#L1533-L1549 > will never pass now, because it uses the now function, that uses call_fn > which doesn't get resolved if they analyzer is not applied > > I think these tests will need to be updated to resolve the expressions > "now" to the actual now() function > > However, I think this brings up a good point about making sure the expr_fns > can be easily used with the lower level expr api (like simplification). > > For any API on the SessionContext or DataFrame, expr_fn::now() and > related functions will be run through the analyzer. > > However, if we create the exprs directly like in expr_simplifer (and > there are some examples) we have to arrange for the expressions to be > resolved. > > Maybe we could add a function like Expr::resolve to do this more easily? > > So it could be used like > > let expr = now() > .cast(DataType::Integer) // cast now to integer > .resolve() // recursively resolve all functions calls, like `now()` into actual function referenes > > 🤔 > > I can try and sketch up something like this later today if you want? > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/arrow-datafusion/pull/8447#issuecomment-1850294075>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAGGOKITQEOGLT7F5IF4AKTYI4QIBAVCNFSM6AAAAABAKNZHHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGI4TIMBXGU> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> > -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
