#pragma once #include #include #include "FunctionArrayMapped.h" namespace DB { /** arrayExists(x1,...,xn -> expression, array1,...,arrayn) - is the expression true for at least one array element. * An overload of the form f(array) is available, which works in the same way as f(x -> x, array). */ struct ArrayExistsImpl { static bool needBoolean() { return true; } static bool needExpression() { return false; } static bool needOneArray() { return false; } static DataTypePtr getReturnType(const DataTypePtr & /*expression_return*/, const DataTypePtr & /*array_element*/) { return std::make_shared(); } static ColumnPtr execute(const ColumnArray & array, ColumnPtr mapped); }; struct NameArrayExists { static constexpr auto name = "arrayExists"; }; using FunctionArrayExists = FunctionArrayMapped; }