lidavidm commented on a change in pull request #11466:
URL: https://github.com/apache/arrow/pull/11466#discussion_r743950430



##########
File path: cpp/src/arrow/compute/exec/expression.cc
##########
@@ -512,7 +509,31 @@ Result<Datum> ExecuteScalarExpression(const Expression& 
expr, const ExecBatch& i
       return MakeNullScalar(null());
     }
 
-    const Datum& field = input[param->index];
+    Datum field = input[param->indices[0]];

Review comment:
       That doesn't work so well because in the StructArray case, we're 
allocating a new array, and in the StructScalar case, the scalar contains 
Scalar values, not Datum values.

##########
File path: cpp/src/arrow/compute/exec/expression_test.cc
##########
@@ -476,15 +476,16 @@ TEST(Expression, BindLiteral) {
 }
 
 void ExpectBindsTo(Expression expr, util::optional<Expression> expected,
-                   Expression* bound_out = nullptr) {
+                   Expression* bound_out = nullptr,
+                   Schema* schema = kBoringSchema.get()) {

Review comment:
       Done.




-- 
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...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to