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

Method Exec

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

Source from the content-addressed store, hash-verified

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