-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Expand file tree
/
Copy patharrayAll.h
More file actions
30 lines (23 loc) · 946 Bytes
/
arrayAll.h
File metadata and controls
30 lines (23 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <Columns/ColumnsNumber.h>
#include <DataTypes/DataTypesNumber.h>
#include <Functions/array/FunctionArrayMapped.h>
namespace DB
{
/** arrayAll(x1,...,xn -> expression, array1,...,arrayn) - is the expression true for all elements of the array.
* An overload of the form f(array) is available, which works in the same way as f(x -> x, array).
*/
struct ArrayAllImpl
{
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<DataTypeUInt8>();
}
static ColumnPtr execute(const ColumnArray & array, ColumnPtr mapped);
};
struct NameArrayAll { static constexpr auto name = "arrayAll"; };
using FunctionArrayAll = FunctionArrayMapped<ArrayAllImpl, NameArrayAll>;
}