暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

免安装 Clickhouse 体验单表40亿行大数据的方法

alitrack 2021-11-30
1731
ClickHouse 的安装体验很方便,我之前分享了 macOSLinux 以及手机上安装体验的方法,现在再分享几个不用安装就可以体验(学习)的方法。

ClickHouse

Playground

官方提供了 Playground(三个 LTS 版本)方便在线交互学习 Clickhouse

HTTPS & Native

ParameterValue
HTTPS endpointhttps://play-api.clickhouse.com:8443
Native TCP endpointplay-api.clickhouse.tech:9440
Userplayground
Passwordclickhouse

⚠️,Native 的域名是.tech
,官方给的是 .com
,无法访问。

如果你想体验最新版本(master 版本),可以访问这个链接

https://gh-api.clickhouse.tech/

HTTP 和 Native 的访问方法,

ParameterValue
HTTPS endpointhttps://gh-api.clickhouse.tech
Native TCP endpointgh-api.clickhouse.tech
Userplay
Password

Altinity.Cloud

Playground

https://github.demo.trial.altinity.cloud:8443/play

用户名和密码都是 demo,playground 总说密码不正确,未测试成功。

HTTPS & Native

下面的经过测试 OK

ParameterValue
HTTPS endpointhttps://github.demo.trial.altinity.cloud:8443/
Native TCP endpointgithub.demo.trial.altinity.cloud
Userdemo
Passworddemo

这些服务器提供了些大数据,如果本地安装部署都需要大量时间,而且占磁盘空间很大,比如:

  • tripdata:纽约出租车和豪华轿车行程数据(13 亿数据)

  • github_events:GitHub 日志(40 亿行数据)

select
       table,rows,columns.compressed_size,
       columns.uncompressed_size,
       disk_size,engine,bytes_size,latest_modification,primary_keys_size,
       columns.ratio
from (
         select table,
                formatReadableSize(sum(data_uncompressed_bytes))          AS uncompressed_size,
                formatReadableSize(sum(data_compressed_bytes))            AS compressed_size,
                sum(data_compressed_bytes) / sum(data_uncompressed_bytes) AS ratio
         from system.columns
         where database = currentDatabase()
         group by table
         ) columns
         right join (
    select table,
           sum(rows)                                            as rows,
           formatReadableSize(sum(bytes))                       as disk_size,
           any(engine)                                          as engine,
           sum(bytes)                                           as bytes_size,
           max(modification_time)                               as latest_modification,
           formatReadableSize(sum(primary_key_bytes_in_memory)) as primary_keys_size
    from system.parts
    where active and database = currentDatabase()
    group by databasetable
    ) parts on columns.table = parts.table
order by parts.bytes_size desc;

从上面结果可以看出,未压缩前 github_events 有 1.55T,tripdata 也有 116.83G。

参考

  • https://clickhouse.com/docs/en/getting-started/playground/

  • https://preset.io/blog/2021-5-26-clickhouse-superset/

  • https://docs.altinity.com/integrations/clickhouse-and-superset/connect-clickhouse-to-superset/

  • https://altinity.com/blog/connecting-to-altinity-cloud-with-the-clickhouse-web-ui

  • https://github.com/ClickHouse/ClickHouse






欢迎关注公众号

有兴趣加群讨论数据挖掘和分析的朋友可以加我微信(witwall),暗号:入群

也欢迎投稿!


更多Clickhouse原创文章,请搜索公众号,

文章转载自alitrack,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论