| 856 | } |
| 857 | |
| 858 | static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) { |
| 859 | if (batch[0].is_array()) { |
| 860 | if (batch[1].is_array()) { |
| 861 | return ArrayArray(ctx, batch[0].array, batch[1].array, out); |
| 862 | } else { |
| 863 | return ArrayScalar(ctx, batch[0].array, *batch[1].scalar, out); |
| 864 | } |
| 865 | } else { |
| 866 | if (batch[1].is_array()) { |
| 867 | return ScalarArray(ctx, *batch[0].scalar, batch[1].array, out); |
| 868 | } else { |
| 869 | ARROW_DCHECK(false); |
| 870 | return Status::Invalid("Should be unreachable"); |
| 871 | } |
| 872 | } |
| 873 | } |
| 874 | }; |
| 875 | |
| 876 | // An alternative to ScalarBinary that Applies a scalar operation with state on |