MG
Size: a a a
MG
SC
MG
G
CREATE TABLE IF NOT EXISTS db1.table1_local ON CLUSTER '{cluster}' (Таблицы наполнили тестовыми данными и сейчас делаю селекты. И не могу понять, должно ли так быть
transaction_id UUID,
common_tenant String,
common_device UUID,
internal_datetime_utc DateTime64(3, 'UTC'),
) ENGINE = ReplicatedReplacingMergeTree(
'/clickhouse/tables/{shard}/table1_local', '{replica}'
) ORDER BY (common_tenant, common_device, internal_datetime_utc, transaction_id)
PRIMARY KEY (common_tenant, common_device)
PARTITION BY toYYYYMM(internal_datetime_utc)
CREATE TABLE IF NOT EXISTS db1.table1 ON CLUSTER '{cluster}' (
transaction_id UUID,
common_tenant String,
common_device UUID,
internal_datetime_utc DateTime64(3, 'UTC'),
) ENGINE = Distributed(
'{cluster}', db1, table1_local, rand()
)
SELECT common_tenant, common_device FROM db1.table1_local WHERE (common_tenant, common_device) IN tuple(('23c38aa5-64a7-461b-a4a4-6cb3c01fa3b9', '4fb6b657-b4c7-4d47-a4fd-1eeda65a4d1d'), ('2e63a510-8aab-4255-ad44-c72e3ef0f6aa', 'cdfc6dc1-927f-447e-913c-4da33ef03f90')) AND isNull(customer) ORDER BY common_tenant, common_deviceВот такие селекты возвращают записанные ранее данные
SELECT common_tenant, common_device FROM db1.table1_local WHERE (common_tenant, common_device) IN (('23c38aa5-64a7-461b-a4a4-6cb3c01fa3b9', '4fb6b657-b4c7-4d47-a4fd-1eeda65a4d1d'), ('2e63a510-8aab-4255-ad44-c72e3ef0f6aa', 'cdfc6dc1-927f-447e-913c-4da33ef03f90')) AND isNull(customer) ORDER BY common_tenant, common_deviceВ этом запросе обратился к таблице table1:
SELECT common_tenant, common_device FROM db1.table1 WHERE (common_tenant, common_device) IN tuple(('23c38aa5-64a7-461b-a4a4-6cb3c01fa3b9', '4fb6b657-b4c7-4d47-a4fd-1eeda65a4d1d'), ('2e63a510-8aab-4255-ad44-c72e3ef0f6aa', 'cdfc6dc1-927f-447e-913c-4da33ef03f90')) AND isNull(customer) ORDER BY common_tenant, common_device
Так должно быть? В какую сторону смотреть, подскажите, плизG
AK
G
AZ
YV
AZ
AS
D
AS
AS
ЕА
D
AS
-
D
AS