-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Joining MySQL table and MergeTree table causes 'Missing columns' #14614
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...
Description
Describe the bug
If you make a query to MySQL Engine Table with joined MergeTree Engine Table, you use any columns of the latter.
How to reproduce
- ClickHouse server 20.8.2
- ClickHouse client version 20.8.2.3 (official build).
CREATE TABLE mysql_table
(
`id` UInt64,
`name` Nullable(String),
)
ENGINE = MySQL('test:3306', 'test', 'test', 'test', 'test');CREATE TABLE ch_table
(
`id` UInt64,
`mysql_item_id` UInt64,
`d` DateTime
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(d)
ORDER BY d;Query
SELECT *
FROM mysql_table AS t_mysql_table
LEFT JOIN ch_table AS t_ch_table
ON t_ch_table.mysql_item_id = t_mysql_table.id
WHERE t_ch_table.id > 100Expected behavior
Returns empty result without errors.
Error message and/or stacktrace
Code: 47. DB::Exception: Received from test:9000. DB::Exception: Missing columns: 't_ch_table.id' while processing query: 't_ch_table.id > 100', required columns: 't_ch_table.id', source columns: 'id', 'name'.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...