Clickhouse 官方测试数据集之ontime

概述:

下载

导入

查询验证数据

运行脚本:

数据全部导入之后按照年份查询数据:
总的行数:
Clickhouse> select count(1) from ontime;

SELECT count(1)
FROM ontime

┌──count(1)─┐
│ 193849243 │
└───────────┘

1 rows in set. Elapsed: 0.020 sec. 
按照10年划分统计:
Clickhouse> select cast(substring(cast(Year as String),1,3) as UInt8) as TY,count(1) from ontime group by TY order by 1 ;

SELECT 
    CAST(substring(CAST(Year, 'String'), 1, 3), 'UInt8') AS TY, 
    count(1)
FROM ontime
GROUP BY TY
ORDER BY 1 ASC

┌──TY─┬─count(1)─┐
│ 198 │ 11555122 │
│ 199 │ 52694390 │
│ 200 │ 65737983 │
│ 201 │ 62031901 │
│ 202 │  1829847 │
└─────┴──────────┘

5 rows in set. Elapsed: 2.376 sec. Processed 193.85 million rows, 387.70 MB (81.59 million rows/s., 163.18 MB/s.) 

按照年份:
Clickhouse> select Year,count(1) from ontime group by Year;

SELECT 
    Year, 
    count(1)
FROM ontime
GROUP BY Year

┌─Year─┬─count(1)─┐
│ 1987 │  1311826 │
│ 1988 │  5202096 │
│ 1989 │  5041200 │
│ 1990 │  5270893 │
│ 1991 │  5076925 │
│ 1992 │  5092157 │
│ 1993 │  5070501 │
│ 1994 │  5180048 │
│ 1995 │  5327435 │
│ 1996 │  5351983 │
│ 1997 │  5411843 │
│ 1998 │  5384721 │
│ 1999 │  5527884 │
│ 2000 │  5683047 │
│ 2001 │  5967780 │
│ 2002 │  5271359 │
│ 2003 │  6488540 │
│ 2004 │  7129270 │
│ 2005 │  7140596 │
│ 2006 │  7141922 │
│ 2007 │  7455458 │
│ 2008 │  7009726 │
│ 2009 │  6450285 │
│ 2010 │  6450117 │
│ 2011 │  6085281 │
│ 2012 │  6096762 │
│ 2013 │  5833089 │
│ 2014 │  5819811 │
│ 2015 │  5819079 │
│ 2016 │  5617658 │
│ 2017 │  5674621 │
│ 2018 │  7213446 │
│ 2019 │  7422037 │
│ 2020 │  1829847 │
└──────┴──────────┘

34 rows in set. Elapsed: 0.363 sec. Processed 193.85 million rows, 387.70 MB (534.25 million rows/s., 1.07 GB/s.) 

 

参考:

https://clickhouse.tech/docs/en/getting-started/example-datasets/ontime/

https://github.com/Percona-Lab/ontime-airline-performance

https://nickmakos.blogspot.ru/2012/08/analyzing-air-traffic-performance-with.html

 

https://blog.csdn.net/m0_37739193/article/details/79612186?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159236041019195188404360%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=159236041019195188404360&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v25-1-79612186.pc_search_back_js&utm_term=clickhouse+ontime

 

 

 

你可能感兴趣的:(Clickhouse)