[英]Too many or too few rows when using different engines when creating one table from another
我正在嘗試從另一個使用創建一個表
CREATE TABLE IF NOT EXISTS new_data ENGINE = ReplicatedReplacingMergeTree(/clickhouse/fedor/tables/{shard}/subfolder/new_data', '{replica}')
ORDER BY created_at
SETTINGS index_granularity = 8192, allow_nullable_key=TRUE
AS
SELECT *
FROM table
WHERE column IS NOT NULL
當我使用
ENGINE = ReplicatedReplacingMergeTree('/clickhouse/fedor/tables/{shard}/subfolder/new_data', '{replica}'),
我從查詢 SELECT...FROM...WHERE 獲得了大約 7-9% 的預期行數
當我使用
ENGINE = ReplicatedMergeTree('/clickhouse/fedor/tables/{shard}/subfolder/new_data', '{replica}')
我比預期多了 3 倍(我假設每一行恰好出現 3 次)
我想要准確的行數而不會丟失且不會重復
ReplicatedReplacingMergeTree
with ORDER BY created_at
會將許多具有相同 created_at 值的行替換為一行
在創建ReplicatedMergeTree('/clickhouse/fedor/tables/{shard}/subfolder/new_data'...)
之前,您是如何刪除現有表數據的?
你用過DROP TABLE new_data SYNC
嗎?
你的table
有什么引擎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.