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

Function ASSERT_OK_AND_ASSIGN

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

Source from the content-addressed store, hash-verified

988
989TEST(Expression, ExecuteCoalesceOnMixedDecimalTypes) {
990 ASSERT_OK_AND_ASSIGN(
991 auto input, StructArray::Make(
992 ArrayVector{ArrayFromJSON(decimal128(3, 2), R"(["1.23", null])"),
993 ArrayFromJSON(decimal128(4, 3), R"([null, "2.345"])")},
994 std::vector<std::string>{"left", "right"}));
995 Schema input_schema(input->type()->fields());
996 auto expr = call("coalesce", {field_ref("left"), field_ref("right")});
997
998 ASSERT_OK_AND_ASSIGN(expr, expr.Bind(input_schema));
999 ASSERT_OK_AND_ASSIGN(auto actual,
1000 ExecuteScalarExpression(expr, input_schema, Datum(input)));
1001
1002 AssertDatumsEqual(actual, ArrayFromJSON(decimal128(4, 3), R"(["1.230", "2.345"])"));
1003}
1004
1005TEST(Expression, BindNestedCall) {
1006 auto expr = add(field_ref("a"),

Callers 6

TESTFunction · 0.70
ExpectBindsToFunction · 0.70
ExpectExecuteFunction · 0.70
expression_test.ccFile · 0.70
operator()Function · 0.70
ExpectRemovesRefsToFunction · 0.70

Calls 15

field_refFunction · 0.85
AssertDatumsEqualFunction · 0.85
ArrayFromJSONFunction · 0.85
struct_Function · 0.85
ChunkedArrayFromJSONFunction · 0.85
ExecuteScalarExpressionFunction · 0.85
ExpectExecuteFunction · 0.85
equalFunction · 0.85
projectFunction · 0.85
SimplifyWithGuaranteeFunction · 0.85
callFunction · 0.70
addFunction · 0.70

Tested by

no test coverage detected