小编que*_*ark的帖子

DBeaver - Clickhouse - SQL 错误 [159] .. 读取超时

在 1,3b 行数据库上运行查询时,我收到“读取超时”消息。

这不是将推文中的主题标签分组在一起的特定高级查询:

SELECT case when match(hashtag, 
            '[Cc]orona.*|COVID.*|[Cc]ovid.*|[Cc]oVID_19.*|[Cc]orvid19.*|COVD19.*|CORONA.*|KILLTHEVI.*|SARSCoV.*|ChineseVi.*|WuhanVir.*|ChinaVir.*|[Vv]irus.*|
            [Qq]uarantine|[Pp]andemic.*|[Cc]linical[Tt]rial.*|FlattenTheCurve.*|SocialDistancing.*|StayHome.*|StayTheFHome.*|StayAtHome.*|stopthespread.*|
            SafeHands.*|WashYourHands.*|SelfIsolation.*')                           then 'COVID19' 
            when match(hashtag, '[Jj]anta[Cc]urfew.*|[Jj]anata[Cc]urfew.*')         then 'JantaCurfew'
            when match(hashtag, 'Bhula.*')                                          then 'Bhula'
            when match(hashtag, '[Ss]t[Pp]atrick.*|HappyStPatrick')                 then 'StPatricks day'
            when match(hashtag, '[Cc]hina.*')                                       then 'China'
            when match(hashtag, '[Ii]taly.*')                                       then 'Italy'
            when match(hashtag, '[Ii]ran.*')                                        then 'Iran'
            when match(hashtag, '[Ii]ndia.*')                                       then 'India'
            when match(hashtag, '[Hh]appy[Mm]others[Dd]ay.*|[Mm]others[Dd]ay.*')    then 'MothersDay'
            else hashtag END
            as Hashtag,
  SUM(CASE WHEN created >= '2020-05-14 00:00:00' AND created <= '2020-03-14 23:59:59' THEN 1 END) "May 14th'20",
  SUM(CASE WHEN created >= '2020-05-13 …
Run Code Online (Sandbox Code Playgroud)

dbeaver clickhouse

9
推荐指数
1
解决办法
3万
查看次数

Clickhouse - “单个 INSERT 块的分区过多”

在将复制的 MySQL 数据库重新加载到 Clickhouse 期间,使用“clickhouse-mysql”我遇到了“单个 INSERT 块的分区过多”,并且似乎无法进行。

到目前为止,我尝试过的一些事情:

  1. 将“max_partitions_per_insert_block”设置为零,看看它是否能够通过。
  2. 使用 --mempool-max-rows 为 5000、10.000 和 20.000,以便跳过 100.000 默认加载
  3. 创建表时使用 PARTITION BY toYYYYMMDD(created)

Clickhouse 表的创建方式与自动创建(--create-table)的方式非常相似,但它确实错过了一些 NULLABLE 类型:

CREATE TABLE DB.DB__main (
`id` Int64,
 `user_id` Int64,
 `screenname` String,
 `created` DateTime,
 `tweet_id` Int64,
 `tweet` String,
 `retweet_count` Nullable(Int32),
 `mediastatus` Nullable(String),
 `country` Nullable(String),
 `countrycode` Nullable(String),
 `city` Nullable(String),
 `latitude0` Nullable(String),
 `longitude0` Nullable(String),
 `latitude1` Nullable(String),
 `longitude1` Nullable(String),
 `latitude2` Nullable(String),
 `longitude2` Nullable(String),
 `latitude3` Nullable(String),
 `longitude3` Nullable(String),
 `datetime` DateTime,
 `datetime_update` Nullable(DateTime),
 `status` Nullable(String),
 `div0` Nullable(String),
 `div1` Nullable(String),
 `div2` Nullable(Int64),
 `datasource` …
Run Code Online (Sandbox Code Playgroud)

insert clickhouse

4
推荐指数
1
解决办法
7955
查看次数

标签 统计

clickhouse ×2

dbeaver ×1

insert ×1