mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-09 16:02:23 +00:00
3579039733
The problematic case happens when an array column of date/datetime is simultaneously specified in an Array Join clause without aliases and in a time converter, such as toYYYYMM. After applying Array Join without aliases, the column's name refers to the flattened array items, however, its data type is recognized as a ColumnArray still, which leads to the unexpected exception throws when building the preimage for the time converters. As a quick fix, we more strictly check the data types of the time converters and quit the preimage optimization pass early.
10 lines
169 B
SQL
10 lines
169 B
SQL
select
|
|
toYYYYMM(date) as date_,
|
|
n
|
|
from (select
|
|
[toDate('20230815'), toDate('20230816')] as date,
|
|
[1, 2] as n
|
|
) as data
|
|
array join date, n
|
|
where date_ >= 202303;
|