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

Method Exec

cpp/src/arrow/compute/kernels/scalar_if_else.cc:1173–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171 }
1172
1173 static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
1174 RETURN_NOT_OK(CheckIdenticalTypes(&batch.values[1], /*count=*/2));
1175 if (batch[0].is_scalar()) {
1176 const auto& cond = batch[0].scalar_as<BooleanScalar>();
1177 return Call(ctx, cond, batch[1], batch[2], out);
1178 }
1179 if (batch[1].is_array()) {
1180 if (batch[2].is_array()) { // AAA
1181 return Call(ctx, batch[0].array, batch[1].array, batch[2].array, out);
1182 } else { // AAS
1183 return Call(ctx, batch[0].array, batch[1].array, *batch[2].scalar, out);
1184 }
1185 } else {
1186 if (batch[2].is_array()) { // ASA
1187 return Call(ctx, batch[0].array, *batch[1].scalar, batch[2].array, out);
1188 } else { // ASS
1189 return Call(ctx, batch[0].array, *batch[1].scalar, *batch[2].scalar, out);
1190 }
1191 }
1192 }
1193};
1194
1195template <typename Type, typename AllocateMem>

Callers

nothing calls this directly

Calls 4

CheckIdenticalTypesFunction · 0.85
CallClass · 0.85
is_scalarMethod · 0.80
is_arrayMethod · 0.80

Tested by

no test coverage detected