You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to make a view... for the moment i have this request :
drop table if exists computed_datum_hours;
create view computed_datum_hours as
select
toStartOfHour(b.datetime_value) as datetime_desc,
b.computed_id,
b.computed_kind,
b.computed_type,
sum(b.value) as value
from computed_datum as b
group by
b.computed_id,
b.computed_kind,
b.computed_type,
toStartOfHour(b.datetime_value)
;
but clickhouse say : Code: 47, e.displayText() = DB::Exception: Missing columns: 'b.value' 'b.datetime_value' 'b.computed_type' 'b.computed_kind' 'b.computed_id' while processing query: 'SELECT toStartOfHour(b.datetime_value) AS datetime_desc, b.computed_id, b.computed_kind, b.computed_type, sum(b.value) AS value FROM api_client.computed_datum GROUP BY b.computed_id, b.computed_kind, b.computed_type, toStartOfHour(b.datetime_value)', required columns: 'b.computed_id' 'b.computed_kind' 'b.computed_type' 'b.datetime_value' 'b.value', source columns: 'flags' 'computed_type' 'datetime_value' 'uuid' 'value' 'computed_id' 'insert' 'computed_kind' 'EventDateTime' (version 20.4.2.9 (official build))
this is a bug or alias is different from mariadb ?
( PS, if i remove every alias to b , the view work )
create table vt(datetime_value DateTime, value Float64) Engine=Memory;
create view computed_datum_hours as
SELECT
toStartOfHour(b.datetime_value) AS datetime_desc,
sum(b.value) AS value
FROM vt AS b
GROUP BY toStartOfHour(b.datetime_value)
Received exception from server (version 20.3.8):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'b.value'
SELECT
toStartOfHour(b.datetime_value) AS datetime_desc,
sum(b.value) AS value
FROM vt AS b
GROUP BY toStartOfHour(b.datetime_value)
Ok.
0 rows in set. Elapsed: 0.003 sec.
Received exception from server (version 18.16.1):
Code: 47. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Unknown identifier: b.value.
Received exception from server (version 19.11.14):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'b.datetime_value' 'b.value' while processing query: 'SELECT toStartOfHour(b.datetime_value) AS datetime_desc, sum(b.value) AS value FROM default.vt GROUP BY toStartOfHour(b.datetime_value)', required columns: 'b.datetime_value' 'b.value', source columns: 'value' 'datetime_value'.
Activity
den-crane commentedon May 20, 2020
STR:
PHaroZ commentedon Sep 11, 2020
The same here with a more simple query
A simple workaround is to prefix table with its database name :
My CH version is 20.6.4.44
filimonov commentedon Oct 12, 2020
Old versions had the same issue.
andrelec1 commentedon Oct 14, 2020
Affect last version too
version 20.9.2.20 (official build)
PS: Think 20.7 ans 20.8 is affected too ...
sah4ez commentedon Jan 31, 2021
I got the same error, but when I add the database name, a view was created.
andrelec1 commentedon Dec 6, 2021
any news ?
NpDen4ik commentedon Mar 21, 2022
Still no solution please fix it
Gachegov59 commentedon Mar 21, 2022
please fix it 🙂
Nicholas-Kant commentedon Mar 21, 2022
please fix it 🙏