SELECT '---map--';
SELECT arrayMap(x -> 123, emptyArrayUInt8());
SELECT arrayMap(x -> 123, [1, 2, 3]);
SELECT arrayMap(x -> 123, range(number)) FROM system.numbers LIMIT 10;
SELECT '---filter--';
SELECT arrayFilter(x -> 0, emptyArrayUInt8());
SELECT arrayFilter(x -> 0, [1, 2, 3]);
SELECT arrayFilter(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> 1, emptyArrayUInt8());
SELECT arrayFilter(x -> 1, [1, 2, 3]);
SELECT arrayFilter(x -> 1, range(number)) FROM system.numbers LIMIT 10;
SELECT '---count---';
SELECT arrayCount(x -> 0, emptyArrayUInt8());
SELECT arrayCount(x -> 0, [1, 2, 3]);
SELECT arrayCount(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> 1, emptyArrayUInt8());
SELECT arrayCount(x -> 1, [1, 2, 3]);
SELECT arrayCount(x -> 1, range(number)) FROM system.numbers LIMIT 10;
SELECT '---sum---';
SELECT arraySum(x -> 0, emptyArrayUInt8());
SELECT arraySum(x -> 0, [1, 2, 3]);
SELECT arraySum(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> 10, emptyArrayUInt8());
SELECT arraySum(x -> 10, [1, 2, 3]);
SELECT arraySum(x -> 10, range(number)) FROM system.numbers LIMIT 10;
SELECT '---all---';
SELECT arrayAll(x -> 0, emptyArrayUInt8());
SELECT arrayAll(x -> 0, [1, 2, 3]);
SELECT arrayAll(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> 1, emptyArrayUInt8());
SELECT arrayAll(x -> 1, [1, 2, 3]);
SELECT arrayAll(x -> 1, range(number)) FROM system.numbers LIMIT 10;
SELECT '---exists---';
SELECT arrayExists(x -> 0, emptyArrayUInt8());
SELECT arrayExists(x -> 0, [1, 2, 3]);
SELECT arrayExists(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> 1, emptyArrayUInt8());
SELECT arrayExists(x -> 1, [1, 2, 3]);
SELECT arrayExists(x -> 1, range(number)) FROM system.numbers LIMIT 10;
SELECT '---first---';
SELECT arrayFirst(x -> 0, emptyArrayUInt8());
SELECT arrayFirst(x -> 0, [1, 2, 3]);
SELECT arrayFirst(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> 1, emptyArrayUInt8());
SELECT arrayFirst(x -> 1, [1, 2, 3]);
SELECT arrayFirst(x -> 1, range(number)) FROM system.numbers LIMIT 10;
SELECT '---first index---';
SELECT arrayFirstIndex(x -> 0, emptyArrayUInt8());
SELECT arrayFirstIndex(x -> 0, [1, 2, 3]);
SELECT arrayFirstIndex(x -> 0, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> 1, emptyArrayUInt8());
SELECT arrayFirstIndex(x -> 1, [1, 2, 3]);
SELECT arrayFirstIndex(x -> 1, range(number)) FROM system.numbers LIMIT 10;

SELECT '---map--';
SELECT arrayMap(x -> materialize(123), emptyArrayUInt8());
SELECT arrayMap(x -> materialize(123), [1, 2, 3]);
SELECT arrayMap(x -> materialize(123), range(number)) FROM system.numbers LIMIT 10;
SELECT '---filter--';
SELECT arrayFilter(x -> materialize(0), emptyArrayUInt8());
SELECT arrayFilter(x -> materialize(0), [1, 2, 3]);
SELECT arrayFilter(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> materialize(1), emptyArrayUInt8());
SELECT arrayFilter(x -> materialize(1), [1, 2, 3]);
SELECT arrayFilter(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;
SELECT '---count---';
SELECT arrayCount(x -> materialize(0), emptyArrayUInt8());
SELECT arrayCount(x -> materialize(0), [1, 2, 3]);
SELECT arrayCount(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> materialize(1), emptyArrayUInt8());
SELECT arrayCount(x -> materialize(1), [1, 2, 3]);
SELECT arrayCount(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;
SELECT '---sum---';
SELECT arraySum(x -> materialize(0), emptyArrayUInt8());
SELECT arraySum(x -> materialize(0), [1, 2, 3]);
SELECT arraySum(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> materialize(10), emptyArrayUInt8());
SELECT arraySum(x -> materialize(10), [1, 2, 3]);
SELECT arraySum(x -> materialize(10), range(number)) FROM system.numbers LIMIT 10;
SELECT '---all---';
SELECT arrayAll(x -> materialize(0), emptyArrayUInt8());
SELECT arrayAll(x -> materialize(0), [1, 2, 3]);
SELECT arrayAll(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> materialize(1), emptyArrayUInt8());
SELECT arrayAll(x -> materialize(1), [1, 2, 3]);
SELECT arrayAll(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;
SELECT '---exists---';
SELECT arrayExists(x -> materialize(0), emptyArrayUInt8());
SELECT arrayExists(x -> materialize(0), [1, 2, 3]);
SELECT arrayExists(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> materialize(1), emptyArrayUInt8());
SELECT arrayExists(x -> materialize(1), [1, 2, 3]);
SELECT arrayExists(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;
SELECT '---first---';
SELECT arrayFirst(x -> materialize(0), emptyArrayUInt8());
SELECT arrayFirst(x -> materialize(0), [1, 2, 3]);
SELECT arrayFirst(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> materialize(1), emptyArrayUInt8());
SELECT arrayFirst(x -> materialize(1), [1, 2, 3]);
SELECT arrayFirst(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;
SELECT '---first index---';
SELECT arrayFirstIndex(x -> materialize(0), emptyArrayUInt8());
SELECT arrayFirstIndex(x -> materialize(0), [1, 2, 3]);
SELECT arrayFirstIndex(x -> materialize(0), range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> materialize(1), emptyArrayUInt8());
SELECT arrayFirstIndex(x -> materialize(1), [1, 2, 3]);
SELECT arrayFirstIndex(x -> materialize(1), range(number)) FROM system.numbers LIMIT 10;

SELECT '---map--';
SELECT arrayMap(x -> 123, emptyArrayString());
SELECT arrayMap(x -> 123, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayMap(x -> 123, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---filter--';
SELECT arrayFilter(x -> 0, emptyArrayString());
SELECT arrayFilter(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFilter(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> 1, emptyArrayString());
SELECT arrayFilter(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFilter(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---count---';
SELECT arrayCount(x -> 0, emptyArrayString());
SELECT arrayCount(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayCount(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> 1, emptyArrayString());
SELECT arrayCount(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayCount(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---sum---';
SELECT arraySum(x -> 0, emptyArrayString());
SELECT arraySum(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arraySum(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> 10, emptyArrayString());
SELECT arraySum(x -> 10, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arraySum(x -> 10, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---all---';
SELECT arrayAll(x -> 0, emptyArrayString());
SELECT arrayAll(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayAll(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> 1, emptyArrayString());
SELECT arrayAll(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayAll(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---exists---';
SELECT arrayExists(x -> 0, emptyArrayString());
SELECT arrayExists(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayExists(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> 1, emptyArrayString());
SELECT arrayExists(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayExists(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---first---';
SELECT arrayFirst(x -> 0, emptyArrayString());
SELECT arrayFirst(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirst(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> 1, emptyArrayString());
SELECT arrayFirst(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirst(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---first index---';
SELECT arrayFirstIndex(x -> 0, emptyArrayString());
SELECT arrayFirstIndex(x -> 0, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirstIndex(x -> 0, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> 1, emptyArrayString());
SELECT arrayFirstIndex(x -> 1, arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirstIndex(x -> 1, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;

SELECT '---map--';
SELECT arrayMap(x -> materialize(123), emptyArrayString());
SELECT arrayMap(x -> materialize(123), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayMap(x -> materialize(123), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---filter--';
SELECT arrayFilter(x -> materialize(0), emptyArrayString());
SELECT arrayFilter(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFilter(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> materialize(1), emptyArrayString());
SELECT arrayFilter(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFilter(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---count---';
SELECT arrayCount(x -> materialize(0), emptyArrayString());
SELECT arrayCount(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayCount(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> materialize(1), emptyArrayString());
SELECT arrayCount(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayCount(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---sum---';
SELECT arraySum(x -> materialize(0), emptyArrayString());
SELECT arraySum(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arraySum(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> materialize(10), emptyArrayString());
SELECT arraySum(x -> materialize(10), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arraySum(x -> materialize(10), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---all---';
SELECT arrayAll(x -> materialize(0), emptyArrayString());
SELECT arrayAll(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayAll(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> materialize(1), emptyArrayString());
SELECT arrayAll(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayAll(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---exists---';
SELECT arrayExists(x -> materialize(0), emptyArrayString());
SELECT arrayExists(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayExists(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> materialize(1), emptyArrayString());
SELECT arrayExists(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayExists(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---first---';
SELECT arrayFirst(x -> materialize(0), emptyArrayString());
SELECT arrayFirst(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirst(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> materialize(1), emptyArrayString());
SELECT arrayFirst(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirst(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT '---first index---';
SELECT arrayFirstIndex(x -> materialize(0), emptyArrayString());
SELECT arrayFirstIndex(x -> materialize(0), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirstIndex(x -> materialize(0), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> materialize(1), emptyArrayString());
SELECT arrayFirstIndex(x -> materialize(1), arrayMap(x -> toString(x), [1, 2, 3]));
SELECT arrayFirstIndex(x -> materialize(1), arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;


SELECT '--- ---';
SELECT arrayMap(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> number % 2, range(number)) FROM system.numbers LIMIT 10;
SELECT '--- ---';
SELECT arrayMap(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFilter(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayCount(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arraySum(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayAll(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayExists(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirst(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
SELECT arrayFirstIndex(x -> number % 2, arrayMap(x -> toString(x), range(number))) FROM system.numbers LIMIT 10;
