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