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

Function ExpectExecute

cpp/src/arrow/compute/expression_test.cc:1130–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130void ExpectExecute(Expression expr, Datum in, Datum* actual_out = NULLPTR) {
1131 std::shared_ptr<Schema> schm;
1132 if (in.is_value()) {
1133 ASSERT_OK_AND_ASSIGN(expr, expr.Bind(in.type()));
1134 schm = schema(in.type()->fields());
1135 } else {
1136 ASSERT_OK_AND_ASSIGN(expr, expr.Bind(*in.schema()));
1137 schm = in.schema();
1138 }
1139
1140 ASSERT_OK_AND_ASSIGN(Datum actual, ExecuteScalarExpression(expr, *schm, in));
1141
1142 ASSERT_OK_AND_ASSIGN(Datum expected, NaiveExecuteScalarExpression(expr, in));
1143
1144 AssertDatumsEqual(actual, expected, /*verbose=*/true);
1145
1146 if (actual_out) {
1147 *actual_out = actual;
1148 }
1149}
1150
1151TEST(Expression, ExecuteCall) {
1152 ExpectExecute(add(field_ref("a"), literal(3.5)),

Callers 2

TESTFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85

Calls 7

AssertDatumsEqualFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
schemaFunction · 0.50
BindMethod · 0.45
typeMethod · 0.45
fieldsMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected