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
When using AggregateFunction(argMaxIf) the aggregated field returns "true" instead of the original column value. It also invalidates the usability of the instance attribute because it's always set to "true".
This issue does not occur when using argMax instead of argMaxIf.
How to reproduce
Given the following table/model with any value:
CREATETABLEtests (
id UUID,
aggregated_field AggregateFunction(argMaxIf, Nullable(String), DateTime64(3), Bool)
) ENGINE = AggregatingMergeTree ORDER BY (id)
INSERT INTO tests (id, aggregated_field) SELECT'468832a5-40c3-4d41-b804-da204abefd06',
argMaxIfState(toNullable('aggregatedValue'), toDateTime64('2024-10-11 18:01:37.794', 3), true)
┌─id───────────────────────────────────┬─aggregated_field──┐
1. │ 468832a5-40c3-4d41-b804-da204abefd06 │ aggregatedValueG| │
└──────────────────────────────────────┴───────────────────┘
The aggregated field returns "true" instead of the column value / aggregated state:
Of course, aggregated fields should be requested using Aggregate Functions, but as it's a column / attribute I think it makes sense to return and keep the original value from the database otherwise it's misleading.
As a consequence, it's not possible to set an instance value for the aggregated field as it would usually be:
💡 This problem does not occur when using argMax instead of ArgMaxIf. For example, using aggregated_field AggregateFunction(argMax, Nullable(String), DateTime64(3)) instead.
When using AggregateFunction(argMaxIf) the aggregated field returns "true" instead of the original column value. It also invalidates the usability of the instance attribute because it's always set to "true".
This issue does not occur when using argMax instead of argMaxIf.
How to reproduce
Given the following table/model with any value:
The aggregated field returns "true" instead of the column value / aggregated state:
Of course, aggregated fields should be requested using Aggregate Functions, but as it's a column / attribute I think it makes sense to return and keep the original value from the database otherwise it's misleading.
As a consequence, it's not possible to set an instance value for the aggregated field as it would usually be:
💡 This problem does not occur when using
argMax
instead ofArgMaxIf
. For example, usingaggregated_field AggregateFunction(argMax, Nullable(String), DateTime64(3))
instead.Fetching it with clickhouse-activerecord returns the right column value / aggregated state and it's possible to use the instance attribute as usual.
Version:
rails 7.2.1
clickhouse-activerecord 1.1.3
ClickHouse 24.3.5.47.altinitystable
The text was updated successfully, but these errors were encountered: