Repository navigation
Closed
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.
Description
ch version 20.8.12.2
select * from (
select * from (
select eventDate from (
select
eventDate
from daily_business_report final where 1=1 and storeId = '882ff105-695b-4e6c-90be-b231bfbd7db5' and
eventDate>=toDate(1625090400000/1000) and eventDate<toDate(1627682400000/1000) order by eventDate
) order by eventDate with fill from toDate(1625090400000/1000) to toDate(1627682400000/1000)-1
) order by eventDate
)
result
2021-07-01
2021-07-02
2021-07-03
2021-07-04
2021-07-05
2021-07-06
2021-07-07
2021-07-08
2021-07-09
2021-07-10
2021-07-11
2021-07-12
2021-07-13
2021-07-14
2021-07-15
2021-07-16
2021-07-17
2021-07-18
2021-07-19
2021-07-20
2021-07-21
2021-07-22
2021-07-23
2021-07-24
2021-07-25
2021-07-26
2021-07-27
2021-07-28
2021-07-29
there has 9 records is not in the ch, gived by the 'with fill'
and then execute sql
select
groupArray(eventDate) as keys,
count() as c
from (
select * from (
select * from (
select eventDate from (
select
eventDate
from daily_business_report final where 1=1 and storeId = '882ff105-695b-4e6c-90be-b231bfbd7db5' and
eventDate>=toDate(1625090400000/1000) and eventDate<toDate(1627682400000/1000) order by eventDate
) order by eventDate with fill from toDate(1625090400000/1000) to toDate(1627682400000/1000)-1
) order by eventDate
)
)
result
keys c
['2021-07-06','2021-07-08','2021-07-09','2021-07-10','2021-07-11','2021-07-12','2021-07-14','2021-07-15','2021-07-16','2021-07-17','2021-07-18','2021-07-19','2021-07-20','2021-07-21','2021-07-22','2021-07-23','2021-07-24','2021-07-25','2021-07-26','2021-07-27'] 20
it just has 20 record and not inlcude the data gived by the 'with fill'
there expect to get the all data include the record gived by the 'with fill'
thanks
Metadata
Metadata
Assignees
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.
Activity
den-crane commentedon Aug 3, 2021
Do you have reproducible example?
peaksnail commentedon Aug 3, 2021
create table
insert into data
query
result
peaksnail commentedon Aug 3, 2021
I find that I use the alias
eventDate as keyand thengroupArray(key)and I get the unexpected resultIf I don't use the alias
eventDate as key, it worksthe sql works
alexey-milovidov commentedon Oct 20, 2022
See #23194
Close: #27115