Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB::Exception: Cannot find column count(id_with) in source stream #44963

Closed
ucasfl opened this issue Jan 6, 2023 · 0 comments · Fixed by #46537
Closed

DB::Exception: Cannot find column count(id_with) in source stream #44963

ucasfl opened this issue Jan 6, 2023 · 0 comments · Fixed by #46537
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@ucasfl
Copy link
Collaborator

ucasfl commented Jan 6, 2023

How to reproduce:

:) create table test(day Date, id UInt32) engine=MergeTree partition by day order by tuple()                                                    
                                                                                                                                                                                                                    
CREATE TABLE test                                                                                                                                                                                                   
(                                                                                                                                                                                                                   
    `day` Date,                                                                                                                                                                                                     
    `id` UInt32                                                                                                                                                                                                     
)                                                                                                                                                                                                                   
ENGINE = MergeTree                                                                                                                                                                                                  
PARTITION BY day                                                                                                                                                                                                    
ORDER BY tuple()                                                                                                                                                                                                    
                                                                                                                                                                                                                    
Query id: a81e4c06-cbc1-4e18-b1dd-1d68cc30a630                                                                                                                                                                      
                                                                                                                                                                                                                    
Ok.                                                                                                                                                                                                                 
                                                                                                                                                                                                                    
0 rows in set. Elapsed: 0.011 sec.           

:) insert into test select toDate('2023-01-05') AS day, number from numbers(10);

INSERT INTO test SELECT
    toDate('2023-01-05') AS day,
    number
FROM numbers(10)

Query id: 1ee62a35-6c91-4797-9a6e-08518f34995b

Ok.

0 rows in set. Elapsed: 0.002 sec.

 :) with toUInt64(id) as id_with select day, count(id_with)  from test where day >= '2023-01-01' group by day limit 1000

WITH toUInt64(id) AS id_with
SELECT
    day,
    count(id_with)
FROM test
WHERE day >= '2023-01-01'
GROUP BY day
LIMIT 1000

Query id: 362bf093-d693-4655-9d2c-a3e4b687708c


0 rows in set. Elapsed: 0.013 sec. 

Received exception from server (version 22.13.1):
Code: 8. DB::Exception: Received from localhost:9000. DB::Exception: Cannot find column `count(id_with)` in source stream, there are only columns: [day]. (THERE_IS_NO_COLUMN)
@ucasfl ucasfl added the potential bug To be reviewed by developers and confirmed/rejected. label Jan 6, 2023
@KochetovNicolai KochetovNicolai added the bug Confirmed user-visible misbehaviour in official release label Jan 6, 2023
@den-crane den-crane removed the potential bug To be reviewed by developers and confirmed/rejected. label Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
3 participants