| 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 | |
| 1195 | template <typename Type, typename AllocateMem> |
nothing calls this directly
no test coverage detected