mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
fix functions with if
This commit is contained in:
parent
d7de2ae0c9
commit
0a1daa00e0
@ -71,7 +71,7 @@ public:
|
||||
|
||||
new_arguments[1] = std::move(if_arguments_nodes[0]);
|
||||
function_arguments_nodes = std::move(new_arguments);
|
||||
resolveAsAggregateFunctionWithIf(*function_node);
|
||||
resolveAggregateFunctionNodeByName(*function_node, function_node->getFunctionName() + "If");
|
||||
}
|
||||
}
|
||||
else if (first_const_node)
|
||||
@ -100,18 +100,10 @@ public:
|
||||
new_arguments[1] = std::move(not_function);
|
||||
|
||||
function_arguments_nodes = std::move(new_arguments);
|
||||
resolveAsAggregateFunctionWithIf(*function_node);
|
||||
resolveAggregateFunctionNodeByName(*function_node, function_node->getFunctionName() + "If");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static inline void resolveAsAggregateFunctionWithIf(FunctionNode & function_node)
|
||||
{
|
||||
auto result_type = function_node.getResultType();
|
||||
const auto * suffix = result_type->isNullable() ? "OrNullIf" : "If";
|
||||
resolveAggregateFunctionNodeByName(function_node, function_node.getFunctionName() + suffix);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user