bkietz commented on a change in pull request #11466:
URL: https://github.com/apache/arrow/pull/11466#discussion_r743901577
##########
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:
Minor nit:
```suggestion
const Datum* field = &input[param->indices[0]];
```
use a non-owning reference to avoid unnecessary shared pointer thrashing
##########
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:
I you could keep a const& here
```suggestion
const Schema& schema = *kBoringSchema) {
```
--
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]