MCPcopy Create free account
hub / github.com/apache/arrow / RemoveNamedRefs

Function RemoveNamedRefs

cpp/src/arrow/compute/expression.cc:1480–1499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480Result<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

Callers 1

NormalizeAndValidateMethod · 0.85

Calls 7

ModifyExpressionFunction · 0.85
IsBoundMethod · 0.80
ExpressionClass · 0.70
InvalidFunction · 0.50
parameterMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected