mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
fix: batter
This commit is contained in:
parent
5d36d1aa4e
commit
2f6db2ac47
@ -42,12 +42,13 @@ public:
|
|||||||
Columns converted_columns(arg_size);
|
Columns converted_columns(arg_size);
|
||||||
for (size_t arg = 0; arg < arg_size; ++arg)
|
for (size_t arg = 0; arg < arg_size; ++arg)
|
||||||
converted_columns[arg] = castColumn(arguments[arg], result_type)->convertToFullColumnIfConst();
|
converted_columns[arg] = castColumn(arguments[arg], result_type)->convertToFullColumnIfConst();
|
||||||
if (converted_columns[1]->compareAt(0, 0, *converted_columns[2], 1) > 0)
|
|
||||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function {} the minimum value cannot be greater than the maximum value", getName());
|
|
||||||
|
|
||||||
auto result_column = result_type->createColumn();
|
auto result_column = result_type->createColumn();
|
||||||
for (size_t row_num = 0; row_num < input_rows_count; ++row_num)
|
for (size_t row_num = 0; row_num < input_rows_count; ++row_num)
|
||||||
{
|
{
|
||||||
|
if (converted_columns[1]->compareAt(row_num, row_num, *converted_columns[2], 1) > 0)
|
||||||
|
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function {} the minimum value cannot be greater than the maximum value", getName());
|
||||||
|
|
||||||
size_t best_arg = 0;
|
size_t best_arg = 0;
|
||||||
if (converted_columns[1]->compareAt(row_num, row_num, *converted_columns[best_arg], 1) > 0)
|
if (converted_columns[1]->compareAt(row_num, row_num, *converted_columns[best_arg], 1) > 0)
|
||||||
best_arg = 1;
|
best_arg = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user