-
Notifications
You must be signed in to change notification settings - Fork 8.3k
unexpected behaviour for avg over empty decimal column without group by #7336
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasenot plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenlty
Description
CREATE TABLE test
(
`x` Int32,
`d` Decimal(10, 3)
)
ENGINE = MergeTree()
ORDER BY x
Ok.
0 rows in set. Elapsed: 0.004 sec.
akonyaev-laptop :) select avg(x) from test;
SELECT avg(x)
FROM test
┌─avg(x)─┐
│ nan │
└────────┘
1 rows in set. Elapsed: 0.001 sec.
akonyaev-laptop :) select avg(d) from test;
SELECT avg(d)
FROM test
↑ Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.) Received exception from server (version 19.14.3):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: AggregateFunctionAvg with zero values.
0 rows in set. Elapsed: 0.004 sec.
I think it is not good.
nan - expected ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasenot plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenlty