Added support for Nullable types in higher order functions [#CLICKHOUSE-4].

This commit is contained in:
Alexey Milovidov 2017-04-19 06:35:11 +03:00
parent 3af2bade1b
commit ed3c0125cd
3 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,7 @@
namespace DB
{
class FunctionTuple : public IFunction
{
public:
@ -67,8 +68,14 @@ public:
return 2;
}
bool hasSpecialSupportForNulls() const override
{
return true;
}
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
};
}

View File

@ -0,0 +1,10 @@
[]
[NULL]
[NULL,1]
[NULL,1,NULL]
[NULL,1,NULL,3]
[NULL,1,NULL,3,NULL]
[NULL,1,NULL,3,NULL,5]
[NULL,1,NULL,3,NULL,5,NULL]
[NULL,1,NULL,3,NULL,5,NULL,7]
[NULL,1,NULL,3,NULL,5,NULL,7,NULL]

View File

@ -0,0 +1 @@
SELECT arrayMap(x -> x % 2 = 0 ? NULL : x, range(number)) FROM system.numbers LIMIT 10;