Clickhouse:在选择时拆分输出 [英] Clickhouse: split output on select

查看:26
本文介绍了Clickhouse:在选择时拆分输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Clickhouse 上执行选择,在通过物化视图从 KafkaEngine 表加载的 MergeTree 表上,一个简单的选择显示在 clickhouse-client 中分组的输出:

Performing a select on Clickhouse, on a MergeTree table that is loaded from a KafkaEngine table via a Materialized View, a simple select shows output split in groups in the clickhouse-client:

:) select * from customersVisitors;
SELECT * FROM customersVisitors 

┌────────day─┬─────────createdAt───┬──────────────────_id─┬───────────mSId─┬───────xId──┬─yId─┐
│ 2018-08-17 │ 2018-08-17 11:42:04 │  8761310857292948227 │ DV-1811114459  │ 846817     │ 0   │
│ 2018-08-17 │ 2018-08-17 11:42:04 │ 11444873433837702032 │ DV-2164132903  │ 780066     │ 0   │
└────────────┴─────────────────────┴──────────────────────┴────────────────┴────────────┴─────┘
┌────────day─┬─────────createdAt───┬──────────────────_id─┬───────────────────mSId──┬────────xId─┬─yId─┐
│ 2018-08-17 │ 2018-08-17 10:25:11 │ 14403835623731794748 │ DV-07680633204819271839 │ 307597     │ 0   │
└────────────┴─────────────────────┴──────────────────────┴─────────────────────────┴────────────┴─────┘

3 rows in set. Elapsed: 0.013 sec. 

引擎是 ENGINE = MergeTree(day, (mSId, xId, day), 8192)

为什么输出显示分成两组?

Why does the output appear splitted in two groups?

推荐答案

如果我没记错的话,当数据来自不同的块时,输出是分开的,也经常导致在不同的线程中处理.如果您想摆脱它,请将您的查询包装在外部选择

If I'm not mistaken, the output is split when the data came from different blocks, also often it leads to being processed in different threads. If you want to get rid of it, wrap your query in outer select

select * from (...)

这篇关于Clickhouse:在选择时拆分输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆