mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #29454 from Avogar/fix-least-greatest
Fix logical error in functions greatest/least
This commit is contained in:
commit
cd1e72e312
@ -107,6 +107,8 @@ public:
|
||||
FunctionBasePtr buildImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & return_type) const override
|
||||
{
|
||||
DataTypes argument_types;
|
||||
for (const auto & argument : arguments)
|
||||
argument_types.push_back(argument.type);
|
||||
|
||||
/// More efficient specialization for two numeric arguments.
|
||||
if (arguments.size() == 2 && isNumber(arguments[0].type) && isNumber(arguments[1].type))
|
||||
|
@ -153,3 +153,4 @@ select number % 2 and toLowCardinality(number) from numbers(5);
|
||||
select number % 2 or toLowCardinality(number) from numbers(5);
|
||||
select if(toLowCardinality(number) % 2, number, number + 1) from numbers(10);
|
||||
select multiIf(toLowCardinality(number) % 2, number, number + 1) from numbers(10);
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
0
|
||||
1
|
||||
0
|
||||
0
|
@ -0,0 +1,2 @@
|
||||
select 1 and greatest(number % 2, number % 3) from numbers(10);
|
||||
select 1 and least(number % 2, number % 3) from numbers(10);
|
Loading…
Reference in New Issue
Block a user