mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
20 lines
454 B
C++
20 lines
454 B
C++
#include "arrayIndex.h"
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct NameIndexOf { static constexpr auto name = "indexOf"; };
|
|
|
|
/// 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.
|
|
using FunctionIndexOf = FunctionArrayIndex<IndexIdentity, NameIndexOf>;
|
|
|
|
void registerFunctionIndexOf(FunctionFactory & factory)
|
|
{
|
|
factory.registerFunction<FunctionIndexOf>();
|
|
}
|
|
|
|
|
|
}
|