ZhangHuiGui commented on code in PR #39908:
URL: https://github.com/apache/arrow/pull/39908#discussion_r1476927183
##########
cpp/src/arrow/compute/expression.cc:
##########
@@ -750,15 +750,23 @@ Result<Datum> ExecuteScalarExpression(const Expression&
expr, const ExecBatch& i
auto call = CallNotNull(expr);
- std::vector<Datum> arguments(call->arguments.size());
-
+ size_t num_args = call->arguments.size();
+ std::vector<Datum> arguments(num_args);
bool all_scalar = true;
- for (size_t i = 0; i < arguments.size(); ++i) {
- ARROW_ASSIGN_OR_RAISE(
- arguments[i], ExecuteScalarExpression(call->arguments[i], input,
exec_context));
- if (arguments[i].is_array()) {
- all_scalar = false;
+
+ if (num_args) {
Review Comment:
Agree, this is more reasonable.
--
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]