1#include "arrayIndex.h"
2#include <Functions/FunctionFactory.h>
3
4
5namespace DB
6{
7
8struct NameIndexOf { static constexpr auto name = "indexOf"; };
9
10/// indexOf(arr, x) - returns the index of the element x (starting with 1), if it exists in the array, or 0 if it is not.
11using FunctionIndexOf = FunctionArrayIndex<IndexIdentity, NameIndexOf>;
12
13void registerFunctionIndexOf(FunctionFactory & factory)
14{
15 factory.registerFunction<FunctionIndexOf>();
16}
17
18
19}
20