-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sum(null) can't work on remote/distributed table #16689
Comments
use cast
|
use cast is a workroud. |
@weiqxu the problem that your query |
How to reproduce:
|
I tried to investigate this issue, following are my findings:
┌─explain───────────────────────────────────────────────────────────────────────────────────────────┐ -- sum(cast(null as Nullable(Int32)) ┌─explain──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
AggregateFunctionPtr AggregateFunctionFactory::get(
...
... AggregateFunctionCombinatorNull::transformAggregateFunction(
┌─explain─────────────────────────────────────────────────────────────────────────────────────────────┐
=== code changes === AggregateFunctionPtr AggregateFunctionFactory::getImpl(
... |
Describe the bug
sum(null) can work on a local table but can't work on the remote/distributed table. I will throw a Exception
"Code: 63, e.displayText() = DB::Exception: Unknown aggregate function nothing: while receiving packet from"
How to reproduce
version v20.8.4.11-lts .
on local table , it worl OK:
select sum(null) from system.one; // retrun null
on remote/distributed table, throw exception:
select sum(null) from remote('xxx', 'system', 'one') ; // throw Exception
(by the way, if using remote, it need more at least 2 node in the node list to reproduece)
Expected behavior
A clear and concise description of what you expected to happen.
Error message and/or stacktrace
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) @ 0x124b504c in /home/clickhouse/software/clickhouse-20.8.4.11-lts
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: