| 1478 | } |
| 1479 | |
| 1480 | Result<Expression> RemoveNamedRefs(Expression src) { |
| 1481 | if (!src.IsBound()) { |
| 1482 | return Status::Invalid("RemoveNamedRefs called on unbound expression"); |
| 1483 | } |
| 1484 | return ModifyExpression( |
| 1485 | std::move(src), |
| 1486 | /*pre=*/ |
| 1487 | [](Expression expr) { |
| 1488 | const Expression::Parameter* param = expr.parameter(); |
| 1489 | if (param && !param->ref.IsFieldPath()) { |
| 1490 | FieldPath ref_as_path( |
| 1491 | std::vector<int>(param->indices.begin(), param->indices.end())); |
| 1492 | return Expression( |
| 1493 | Expression::Parameter{std::move(ref_as_path), param->type, param->indices}); |
| 1494 | } |
| 1495 | |
| 1496 | return expr; |
| 1497 | }, |
| 1498 | /*post_call=*/[](Expression expr, ...) { return expr; }); |
| 1499 | } |
| 1500 | |
| 1501 | // Serialization is accomplished by converting expressions to KeyValueMetadata and storing |
| 1502 | // this in the schema of a RecordBatch. Embedded arrays and scalars are stored in its |
no test coverage detected