mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #12746 from ClickHouse/add-test-extra-overflow-row
Added test with extra overflow row.
This commit is contained in:
commit
0320b05408
@ -0,0 +1,4 @@
|
|||||||
|
2020-07-10
|
||||||
|
2020-07-11
|
||||||
|
|
||||||
|
0000-00-00
|
34
tests/queries/0_stateless/01412_row_from_totals.sql
Normal file
34
tests/queries/0_stateless/01412_row_from_totals.sql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
DROP TABLE IF EXISTS tracking_events_tmp;
|
||||||
|
DROP TABLE IF EXISTS open_events_tmp;
|
||||||
|
|
||||||
|
CREATE TABLE tracking_events_tmp (`APIKey` UInt32, `EventDate` Date) ENGINE = MergeTree PARTITION BY toYYYYMM(EventDate) ORDER BY (APIKey, EventDate);
|
||||||
|
CREATE TABLE open_events_tmp (`APIKey` UInt32, `EventDate` Date) ENGINE = MergeTree PARTITION BY toMonday(EventDate) ORDER BY (APIKey, EventDate);
|
||||||
|
|
||||||
|
insert into open_events_tmp select 2, '2020-07-10' from numbers(32);
|
||||||
|
insert into open_events_tmp select 2, '2020-07-11' from numbers(31);
|
||||||
|
|
||||||
|
insert into tracking_events_tmp select 2, '2020-07-10' from numbers(1881);
|
||||||
|
insert into tracking_events_tmp select 2, '2020-07-11' from numbers(1623);
|
||||||
|
|
||||||
|
SELECT EventDate
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT EventDate
|
||||||
|
FROM tracking_events_tmp AS t1
|
||||||
|
WHERE (EventDate >= toDate('2020-07-10')) AND (EventDate <= toDate('2020-07-11')) AND (APIKey = 2)
|
||||||
|
GROUP BY EventDate
|
||||||
|
)
|
||||||
|
FULL OUTER JOIN
|
||||||
|
(
|
||||||
|
SELECT EventDate
|
||||||
|
FROM remote('127.0.0.{1,3}', currentDatabase(), open_events_tmp) AS t2
|
||||||
|
WHERE (EventDate >= toDate('2020-07-10')) AND (EventDate <= toDate('2020-07-11')) AND (APIKey = 2)
|
||||||
|
GROUP BY EventDate
|
||||||
|
WITH TOTALS
|
||||||
|
) USING EventDate
|
||||||
|
ORDER BY EventDate
|
||||||
|
settings totals_mode = 'after_having_auto', group_by_overflow_mode = 'any', max_rows_to_group_by = 10000000, joined_subquery_requires_alias=0;
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tracking_events_tmp;
|
||||||
|
DROP TABLE IF EXISTS open_events_tmp;
|
Loading…
Reference in New Issue
Block a user