Repository navigation
Description
There is a DB named "jrliu_test" I created before.
Then I connect to Clickhouse like this:
clickhouse-client -m --database=jrliu_test
Then I execute the followint SQLs:
-
create table "test_table_local"
CREATE TABLE IF NOT EXISTS jrliu_test.test_table_local ON CLUSTER '{cluster}' ( join_key String, value String ) ENGINE = MergeTree() PARTITION BY tuple() ORDER BY tuple(); -
create table "test_table_distribute"
CREATE TABLE jrliu_test.test_table_distribute ON CLUSTER '{cluster}' AS jrliu_test.test_table_local ENGINE = Distributed('{cluster}', 'jrliu_test', test_table_local); -
create table "test_table_join"
CREATE TABLE IF NOT EXISTS jrliu_test.test_table_join ON CLUSTER '{cluster}' ( join_key String, value String ) ENGINE = MergeTree() PARTITION BY tuple() ORDER BY tuple(); -
insert data to "test_table_local" and "test_table_join"
INSERT INTO jrliu_test.test_table_local FORMAT Values ('key1', 'value1'), ('key2', 'value2');
INSERT INTO jrliu_test.test_table_join FORMAT Values ('key1', 'value1'), ('key3', 'value3'); -
execute query
5.1 execute Local table join Local table
SELECT * FROM test_table_local as t INNER JOIN test_table_join as j ON t.join_key = j.join_key;
(This query return result without any errors)
5.2 execute Distribute table join Local table
SELECT * FROM test_table_distribute as t INNER JOIN test_table_join as j ON t.join_key = j.join_key;
(This query return error: Code: 60, e.displayText() = DB::Exception: Received from clickhouse-stg-af-shard1-replica0:9000. DB::Exception: Table default.test_table_join doesn't exist.. (version 19.14.7.15 (official build)))
Table "test_table_join" should be found in "jrliu_test" database but not in "default".
Server version: 19.14.7.15
Activity
4ertus2 commentedon May 6, 2020
It's most probable duplicate for #4756
Need reproduction on 20.4+
azat commentedon May 6, 2020
AFAICS the problem here is different, distributed engine do not account current database, IOW:
Will trigger the following error:
But note, that the error is only on the remote shard, on the local shard it is ok
4ertus2 commentedon Oct 2, 2020
Could be related #15538
dzeban commentedon Nov 11, 2020
Still reproduced on the latest stable version 20.10.3.30, so fix in #15538 doesn't help here.