findepi commented on PR #13290: URL: https://github.com/apache/datafusion/pull/13290#issuecomment-2468839698
In an ideal worlds, UDF would have single invoke method. This is why https://github.com/apache/datafusion/issues/13238 / https://github.com/apache/datafusion/issues/13064 / https://github.com/apache/datafusion/pull/13345 consolidation takes place. Now, we add new invoke variant. Would we want all implementations to consolidate on this new variant, or would it feel awkward when doing so? Passing back the `return_type: &DataType` might be sometimes useful, but generally feels redundant. In https://github.com/apache/datafusion/issues/12819#issuecomment-2468826019 i am attempting to clarify why `simplify` isn't useful for the use-case. If not simplify, what if we had something like `bind_return_type` method that's guaranteed to be invoked before `invoke` / `invoke_batch` and which may return new UDF instance (if state changes) or nothing (per default impl). This way we would provide exactly and directly what's needed for the use-case, without changing invoke itself. -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org