“Everything is table(万物皆为表)” 是 ClickHouse 一个非常有意思的设计思路。数据表是它与外部进行交互的接口层,无论背后连接的是本地文件、HDFS、Zookeeper 还是其他服务,终端用户始终只需面对数据表,使用 SQL 查询语言。

1.1 外部存储类型

直接从其他存储系统读取数据,只负责元数据管理和数据查询,通常不负责数据的写入。

1.1.1 HDFS

ENGINE = HDFS(hdfs_uri, format)

示例:

CREATE TABLE hdfs_table1 (
    id UInt32,
    code String,
    name String
) ENGINE = HDFS('hdfs://hdp1.nauu.com:8020/clickhouse/hdfs_table1', 'CSV');

hdfs_uri 支持通配符:

  • *:匹配所有字符

  • ?:匹配单个字符

  • {M..N}:数字区间

1.1.2 MySQL

ENGINE = MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_duplicate_clause'])

示例:

CREATE TABLE dolphin_scheduler_table (
    id UInt32,
    name String
) ENGINE = MySQL('10.37.129.2:3306', 'escheduler', 't_escheduler_process_definition', 'root', '');

配合物化视图使用,可实时同步 MySQL 数据到本地 MergeTree。不支持 UPDATE/DELETE。

1.1.3 JDBC

需要依赖 clickhouse-jdbc-bridge 代理服务。

ENGINE = JDBC('jdbc:url', 'database', 'table')

示例:

CREATE TABLE t_ds_process_definition (
    id Int32,
    name String
) ENGINE = JDBC('jdbc:postgresql://ip:5432/dolphinscheduler?user=test&password=test', '', 't_ds_process_definition');

1.1.4 Kafka

Kafka 表引擎充当数据管道,与物化视图 + MergeTree 配合使用。

CREATE TABLE kafka_queue (
    id UInt32,
    code String,
    name String
) ENGINE = Kafka()
SETTINGS
    kafka_broker_list = 'hdp1.nauu.com:6667',
    kafka_topic_list = 'sales-queue',
    kafka_group_name = 'chgroup',
    kafka_format = 'JSONEachRow',
    kafka_skip_broken_messages = 100;

正确的使用方式(管道模式):

-- 1. Kafka 表(数据管道)
CREATE TABLE kafka_queue (...) ENGINE = Kafka() SETTINGS ...;
​
-- 2. 本地表(查询表)
CREATE TABLE kafka_table (id UInt32, code String, name String)
ENGINE = MergeTree() ORDER BY id;
​
-- 3. 物化视图(同步)
CREATE MATERIALIZED VIEW consumer TO kafka_table
AS SELECT id, code, name FROM kafka_queue;

关键配置参数:

  • kafka_num_consumers:消费者数量,默认 1

  • kafka_skip_broken_messages:允许跳过的解析错误数据行数

  • kafka_commit_every_batch:commit 频率(0=整 Block,1=每 Batch)

  • stream_poll_timeout_ms:拉取间隔,默认 500ms

  • stream_flush_interval_ms:刷新间隔,默认 7500ms

1.1.5 File

直接读取本地文件数据。

ENGINE = File(format)

数据文件保存在 <ch-path>/data/default/[table_name]/data.[format]。

支持自动创建和手动挂载两种方式。

1.2 内存类型

数据从内存中直接访问,查询性能好但受内存限制。

1.2.1 Memory

数据保存在内存中,服务重启后全部丢失。支持并行查询,亿级数据量以内性能与 MergeTree 相当。

CREATE TABLE memory_1 (id UInt64) ENGINE = Memory();

在 ClickHouse 内部,Memory 表作为集群间分发数据的存储载体(如分布式 IN 查询)。

1.2.2 Set

只能间接作为 IN 查询的右侧条件使用,不能直接 SELECT。

CREATE TABLE set_1 (id UInt8) ENGINE = Set();
INSERT INTO set_1 SELECT number FROM numbers(10);
-- 正确用法:
SELECT arrayJoin([1, 2, 3]) AS a WHERE a IN set_1;

1.2.3 Join

专门为 JOIN 查询设计的表引擎。

ENGINE = Join(join_strictness, join_type, key1[, key2, ...])

示例:

CREATE TABLE id_join_tb1 (
    id UInt8,
    price UInt32,
    time DateTime
) ENGINE = Join(ANY, LEFT, id);
​
SELECT id, name, price FROM join_tb1 LEFT JOIN id_join_tb1 USING (id);

也可通过 joinGet 函数访问:

SELECT joinGet('id_join_tb1', 'price', toUInt8(1));

1.2.4 Buffer

充当数据写入的缓冲区,满足阈值条件时自动刷新到目标表。

ENGINE = Buffer(database, table, num_layers,
    min_time, max_time,
    min_rows, max_rows,
    min_bytes, max_bytes)

示例:

CREATE TABLE buffer_to_memory_1 AS memory_1
ENGINE = Buffer(default, memory_1, 16, 10, 100, 10000, 1000000, 10000000, 100000000);

刷新条件(满足任意一个即触发):

  • 所有最小阈值都已满足

  • 至少有一个最大阈值满足

  • 单次写入数据行数 > max_rows 或 > max_bytes

1.3 日志类型

适用于数据量小(100 万以下)、查询简单、一次写入多次查询的场景。不支持索引和分区,不支持并发读写。

引擎性能文件数并行查询
TinyLog最低每列一个 .bin❌
StripeLog中等3 个固定文件✅
Log最高每列 .bin + __marks.mrk✅

1.3.1 TinyLog

按列独立存储,每个字段一个 .bin 文件 + sizes.json 元数据。

CREATE TABLE tinylog_1 (id UInt64, code UInt64) ENGINE = TinyLog();

1.3.2 StripeLog

3 个固定文件:data.bin(所有列)、index.mrk(标记)、sizes.json。

CREATE TABLE spripelog_1 (id UInt64, price Float32) ENGINE = StripeLog();

1.3.3 Log

按列独立存储 + 统一标记文件 __marks.mrk + sizes.json。性能最高的日志引擎。

CREATE TABLE log_1 (id UInt64, code UInt64) ENGINE = Log();

1.4 接口类型

自身不存储任何数据,像黏合剂一样整合其他数据表。

1.4.1 Merge

合并多个同结构数据表的查询结果。

ENGINE = Merge(database, table_name)  -- table_name 支持正则表达式
​
CREATE TABLE test_table_all AS test_table_2018
ENGINE = Merge(currentDatabase(), '^test_table_');

查询时可通过虚拟字段 _table 过滤数据来源。

1.4.2 Dictionary

数据字典的代理封装,通过表查询字典。

CREATE TABLE tb_test_flat_dict (
    id UInt64, code String, name String
) ENGINE = Dictionary(test_flat_dict);

使用 Dictionary 引擎创建数据库,自动为每个字典创建代理表:

CREATE DATABASE test_dictionaries ENGINE = Dictionary;

1.4.3 Distributed

分布式表的透明代理,详见第 10 章。

1.5 其他类型

1.5.1 Live View

类似事件监听器,对 SQL 查询结果进行准实时监听。

CREATE TABLE origin_table1 (id UInt64) ENGINE = Log;
CREATE LIVE VIEW lv_origin AS SELECT COUNT(*) FROM origin_table1;
WATCH lv_origin;

1.5.2 Null

类似 Unix 的 /dev/null。写入数据自动忽略,查询返回空表。

CREATE TABLE null_table1 (id UInt8) ENGINE = Null;

常与物化视图搭配使用:数据写入 Null 表 → 同步到物化视图 → Null 表本身不保留数据。

1.5.3 URL

等价于 HTTP 客户端,通过 HTTP/HTTPS 访问远端 REST 服务。

ENGINE = URL('url', format)
​
CREATE TABLE url_table (name String)
ENGINE = URL('http://client1.nauu.com:3000/users', JSONEachRow);

SELECT 转换为 GET 请求,INSERT 转换为 POST 请求。

1.6 本章小结

类别引擎用途
外部存储HDFS/MySQL/JDBC/Kafka/File直接读取外部系统数据
内存类型Memory/Set/Join/Buffer高性能查询/数据管道
日志类型TinyLog/StripeLog/Log小数据量简单场景
接口类型Merge/Dictionary/Distributed表整合/字典代理/分布式
其他类型Live View/Null/URL特殊用途

80 条评论

p7777 · 2026-08-04 08:52

Interesting analysis! Seeing platforms like p7777 game really push tech boundaries-KYC & security are key for trust. Solid insights on game curation too – crucial for player retention! 🧐

http://toolbarqueries.google.ws · 2026-08-21 08:04

References:

Valley view casino center seating chart http://toolbarqueries.google.ws

https://talkversecommunity.com/ · 2026-08-22 05:52

References:

Casino campione d’italia https://talkversecommunity.com/

community.goobi.io · 2026-08-22 23:13

References:

Treasure bay casino community.goobi.io

tableplus1 · 2026-08-24 12:12

The “万物皆为表” philosophy highlights powerful architectural abstraction. Unifying diverse data sources (HDFS, MySQL) into a single, consistent interface is a core principle of excellent UX design-a concept of seamless reliability we value in all user-facing systems, even when looking for a tableplus1 legit.

bbajee · 2026-08-30 19:09

[3697]bbajee অফিসিয়াল লগইন ও অ্যাপ ডাউনলোড | সেরা অনলাইন স্লট গেম,bbajee সাইটে এখন সহজেই বিকাশ দিয়ে ক্যাসিনো ডিপোজিট করুন এবং লাইভ ক্যাসিনো খেলার নিয়ম জেনে জিতে নিন। দ্রুত অ্যাপ ডাউনলোড করে আজই শুরু করুন। visit: bbajee

黄色视频 · 2026-09-09 12:36

Oh myy goodness! Impresssive rticle dude! Manny thanks, However I amm
going throuugh roblems with you RSS. I don’t know why I aam unabke tto joi it.
Is there anybody ekse having the samne RSS problems?
Anybody who kbows thee anwer will yoou kindly respond?
Thanks!! xnxx

king jl · 2026-09-22 12:13

The color probability analysis here is surprisingly robust. I initially doubted the depth, but the structural elements detailed in the guide are quite thorough. Check out king jl download for more data points.

sofort casino bonus ohne einzahlung · 2026-09-22 17:23

References:

Seriöses Sofort Casino sofort casino bonus ohne einzahlung

qingdaomop.com · 2026-09-23 03:54

References:

Online Casino Klarna Sofortüberweisung qingdaomop.com

bbs.xingxiancn.com · 2026-09-23 04:57

References:

Online casino mit sofortüberweisung bbs.xingxiancn.com

http://bbs.sdhuifa.com · 2026-09-23 05:02

References:

Casino mit Sofort Einzahlung http://bbs.sdhuifa.com/home.php?mod=space&uid=1225532

https://chuangu.xyz · 2026-09-23 08:37

References:

Online casino app sofortüberweisung https://chuangu.xyz/home.php?mod=space&uid=341838&do=profile&mycenter=1

http://xhdyz.cn · 2026-09-23 09:09

References:

Best payid pokies sites http://xhdyz.cn/home.php?mod=space&uid=1116367

http://x.kongminghu.com/home.php?mod=space&uid=871120 · 2026-09-23 09:22

References:

Sofortüberweisung casino ohne registrierung http://x.kongminghu.com/home.php?mod=space&uid=871120

https://androidonly.com · 2026-09-23 09:28

References:

$1 payid pokies https://androidonly.com/user/plantpain67/

bbs.mofang.com.tw · 2026-09-23 17:06

References:

Sofort bezahlen casino https://bbs.mofang.com.tw/home.php?mod=space&uid=2675540

http://bbs.lotsmall.cn · 2026-09-23 17:34

References:

Casino sofortüberweisung einzahlung http://bbs.lotsmall.cn/home.php?mod=space&uid=653410

online casino mindesteinzahlung sofort · 2026-09-24 00:04

References:

Casino sofortüberweisung gebühren http://www.jcdqzdh.com/home.php?mod=space&uid=1063730

super ace · 2026-09-25 10:11

This “Everything is a table” concept is a masterclass in abstraction. It mirrors how modern SaaS platforms simplify complex backend data flows into a single, intuitive user interface. This architectural pattern of unifying diverse sources is crucial, whether optimizing data pipelines or providing seamless access to varied services like those found at super ace com super ace com.

https://md.coredump.ch/ · 2026-09-25 20:55

References:

5 dollar deposit pokies payid https://md.coredump.ch/p2AK8CA5QMKdx-G5HR8MpQ

text.dsf.hs-heilbronn.de · 2026-09-26 03:17

References:

No verification payid pokies australia https://text.dsf.hs-heilbronn.de/UFGbSaZqStuDYSAqGEuQGw

payid minimum deposit pokies · 2026-09-28 22:05

References:

Australian pokies that accept payid http://womans-days.ru/user/bolthot20/

sub.elfejewelry.com · 2026-09-28 23:04

References:

Pokies payid accepted australia https://sub.elfejewelry.com:443/index.php?quinngregory200439

pay id pokies real money · 2026-09-28 23:04

References:

10 dollar deposit pokies payid https://actualites.cava.tn/user/julymouse49/

intensedebate.com · 2026-09-29 11:16

References:

Pokies sites that take payid https://intensedebate.com/people/europetwig03

mobile payid pokies australia · 2026-09-29 23:44

References:

Payid casino online pokies http://news-media35.ru/user/sphynxlip1/

high roller payid pokies · 2026-09-30 01:08

References:

Top rated payid pokies http://www.annunciogratis.net/author/signpatio74

dok.kompot.si · 2026-09-30 18:04

References:

MiFinity VIP casinos Australia https://dok.kompot.si/k-CtXGvnRIS9WdFKvXRmWg

progressive jackpot payid pokies · 2026-09-30 18:39

References:

Fast withdrawal pokies australia payid http://mashspec.ru/user/copperbirth6/

jackpot pokies payid · 2026-10-01 03:17

References:

1 minimum deposit casino australia payid https://text.dsf.hs-heilbronn.de/BfIzZDynTxeov-da0xwrTg

https://aryba.kg/ · 2026-10-01 08:36

References:

Daily free spins payid pokies https://aryba.kg/user/tulipsphere9/

neosurf free spins australia · 2026-10-03 23:30

References:

Neosurf casino instant play australia https://git.arteneo.pl/puffinheat0

is neosurf safe for online casinos · 2026-10-03 23:38

References:

Neosurf casino jackpots australia https://md.coredump.ch/qQm-CwPbRp-TBvaLclKqeg

https://cq.x7cq.vip/ · 2026-10-04 02:58

References:

Neosurf e-voucher casino australia https://cq.x7cq.vip/home.php?mod=space&uid=9696865

payid withdrawal online pokies · 2026-10-04 05:21

References:

1 minimum deposit casino australia payid http://xuetao365.com/home.php?mod=space&uid=733744

neosurf free spins no deposit australia · 2026-10-04 05:27

References:

Play pokies with neosurf australia https://lslv168.com/home.php?mod=space&uid=2891101

neosurf casino faq australia · 2026-10-04 11:15

References:

Neosurf no verification casino australia http://www.fumankong1.cc/home.php?mod=space&uid=972509

https://telegra.ph/ · 2026-10-04 11:19

References:

Neosurf casino australia review https://telegra.ph/Buy-Neosurf-Vouchers-Online-Codes-from-10-10-03

www.qingdaomop.com · 2026-10-04 16:04

References:

Neosurf casino instant withdrawal australia http://www.qingdaomop.com/?271427

https://androidonly.com/user/cokefan8/ · 2026-10-04 16:26

References:

Neosurf legal casinos australia https://androidonly.com/user/cokefan8/

https://undrtone.com/studylead5 · 2026-10-04 19:48

References:

Neosurf $5 deposit casinos https://undrtone.com/studylead5

carwiki.site · 2026-10-05 01:17

References:

Legit neosurf casinos australia https://carwiki.site/wiki/Best_Neosurf_Casinos_in_Australia_2026_Bonus_Codes

kuniunet.com · 2026-10-05 19:56

References:

Neosurf live casino australia http://kuniunet.com/home.php?mod=space&uid=3360732

neosurf casino withdrawal times · 2026-10-06 02:52

References:

Neosurf casino vip program australia https://www.jjj555.com/home.php?mod=space&uid=2810065

www.akaguide.com · 2026-10-06 07:12

References:

Casinos that accept neosurf australia https://www.akaguide.com/user/canadarail3

http://bbs.88moli.top/ · 2026-10-06 14:51

References:

Neosurf casino no bank account australia http://bbs.88moli.top/home.php?mod=space&uid=122542

发表回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注