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

Function ExpectExecute

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

Source from the content-addressed store, hash-verified

1064}
1065
1066void ExpectExecute(Expression expr, Datum in, Datum* actual_out = NULLPTR) {
1067 std::shared_ptr<Schema> schm;
1068 if (in.is_value()) {
1069 ASSERT_OK_AND_ASSIGN(expr, expr.Bind(in.type()));
1070 schm = schema(in.type()->fields());
1071 } else {
1072 ASSERT_OK_AND_ASSIGN(expr, expr.Bind(*in.schema()));
1073 schm = in.schema();
1074 }
1075
1076 ASSERT_OK_AND_ASSIGN(Datum actual, ExecuteScalarExpression(expr, *schm, in));
1077
1078 ASSERT_OK_AND_ASSIGN(Datum expected, NaiveExecuteScalarExpression(expr, in));
1079
1080 AssertDatumsEqual(actual, expected, /*verbose=*/true);
1081
1082 if (actual_out) {
1083 *actual_out = actual;
1084 }
1085}
1086
1087TEST(Expression, ExecuteCall) {
1088 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