You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the unexpected behaviour
A clear and concise description of what works not as it is supposed to.
How to reproduce
ClickHouse 22.3, 22.6
SELECT argMaxOrNull(id, timestamp)
FROM
(
SELECT
CAST(NULL, 'Nullable(UInt32)') AS id,
2 AS timestamp
)
Query id: 17bf3c85-de37-428f-990e-e82c78cc06fa
┌─argMaxOrNull(id, timestamp)─┐
│ 0 │ <-- expected to have NULL here
└─────────────────────────────┘
SELECT
argMax(id, timestamp),
argMaxOrNull(id, timestamp)
FROM
(
SELECT
CAST(NULL, 'Nullable(UInt32)') AS id,
2 AS timestamp
UNION ALL
SELECT
1 AS id,
1 AS timestamp
)
Query id: 01180512-509b-481e-9833-1256cc4d01c1
┌─argMax(id, timestamp)─┬─argMaxOrNull(id, timestamp)─┐
│ 1 │ 0 │ <- expected to have 1 here as latest non-null value
└───────────────────────┴─────────────────────────────┘
Workaround for second issue:
SELECT argMaxIfOrNull(id, timestamp, id IS NOT NULL)
FROM
(
SELECT
CAST(NULL, 'Nullable(UInt32)') AS id,
2 AS timestamp
UNION ALL
SELECT
1 AS id,
1 AS timestamp
)
Query id: a3f72ba8-b17c-40b3-955e-22d311c0e428
┌─argMaxOrNullIf(id, timestamp, isNotNull(id))─┐
│ 1 │
└──────────────────────────────────────────────┘
Expected behavior
For first query, it should return NULL
For second either return 1, either confirm that argMaxOrNull working as intended.
The text was updated successfully, but these errors were encountered:
Describe the unexpected behaviour
A clear and concise description of what works not as it is supposed to.
How to reproduce
ClickHouse 22.3, 22.6
Expected behavior
For first query, it should return NULL
For second either return 1, either confirm that argMaxOrNull working as intended.
The text was updated successfully, but these errors were encountered: