bkietz commented on code in PR #40200:
URL: https://github.com/apache/arrow/pull/40200#discussion_r1509010304
##########
cpp/src/arrow/compute/expression_internal.h:
##########
@@ -278,8 +278,11 @@ struct FlattenedAssociativeChain {
inline Result<std::shared_ptr<compute::Function>> GetFunction(
const Expression::Call& call, compute::ExecContext* exec_context) {
- if (call.function_name != "cast") {
- return exec_context->func_registry()->GetFunction(call.function_name);
+ auto input_call_function =
+ exec_context->func_registry()->GetFunction(call.function_name);
+ auto cast_function = exec_context->func_registry()->GetFunction("cast");
+ if (input_call_function != cast_function) {
+ return input_call_function;
Review Comment:
Actually instead of lazy initialization inside `cast_function()`, it'd be
more efficient to initialize it inside `AddFunction()` when the function named
"cast" is initialized
--
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]