ClickHouse/tests/queries/0_stateless/03127_argMin_combinator_state.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
628 B
MySQL
Raw Normal View History

2024-04-17 00:31:40 +00:00
SELECT toTypeName(sumArgMinState(number, number)) FROM numbers(1);
SELECT sumArgMinState(number, number) AS a FROM numbers(3) FORMAT Null;
DROP TABLE IF EXISTS argmax_comb;
CREATE TABLE argmax_comb(
id UInt64,
state AggregateFunction(avgArgMax, Float64, UInt64)
)
ENGINE=MergeTree() ORDER BY tuple();
INSERT INTO argmax_comb
SELECT
CAST(number % 10, 'UInt64') AS id,
avgArgMaxState(CAST(number, 'Float64'), id)
FROM numbers(100)
GROUP BY id;
SELECT avgArgMaxMerge(state) FROM argmax_comb;
SELECT
id,
avgArgMaxMerge(state)
FROM argmax_comb
GROUP BY id
ORDER BY id ASC;