SingleStore数据库(mysql分布式)-装载TPCH数据

一、测试环境

名称版本
操作系统Red Hat Enterprise Linux Server release 7.9 (Maipo)
CPUIntel® Core™ i7-7700HQ CPU @ 2.80GHz
内存5G
TPCH工具2.14.0

二、TPCH工具下载地址

1、TPCH工具官方下载地址

2、百度云盘链接

链接:https://pan.baidu.com/s/1VZHKCrk1JsKWLrpbeanbBg 
提取码:y6sa

三、生成20G测试数据

unzip tpch_dbgen_linux64-2.14.0.zip

cd tpch_dbgen_linux64/

chmod 777 dbgen

[root@xdw0 tpch_dbgen_linux64]# ./dbgen -vf -s 20
TPC-H Population Generator (Version 2.14.0)
Copyright Transaction Processing Performance Council 1994 - 2010
Generating data for suppliers table/
Preloading text ... 100%
done.
Generating data for customers tabledone.
Generating data for orders/lineitem tablesdone.
Generating data for part/partsupplier tablesdone.
Generating data for nation tabledone.
Generating data for region tabledone.

[root@xdw0 tpch_dbgen_linux64]# ll
-rw-r--r--. 1 root root        1180 227 2012 buildall
-rw-r--r--. 1 root root   490806602 52 11:34 customer.tbl
-rwxrwxrwx. 1 root root      124297 227 2012 dbgen
-rw-r--r--. 1 root root       11815 227 2012 dists.dss
-rw-r--r--. 1 root root 15685400985 52 11:34 lineitem.tbl
-rw-r--r--. 1 root root        2224 52 11:34 nation.tbl
-rw-r--r--. 1 root root  3517488366 52 11:34 orders.tbl
-r-sr-S--T. 1 root root  2422915386 52 11:34 partsupp.tbl
-rw-r--r--. 1 root root   487760640 52 11:34 part.tbl
-rw-r--r--. 1 root root         389 52 11:34 region.tbl
-rw-r--r--. 1 root root    28471512 52 11:34 supplier.tbl

[root@xdw0 tpch_dbgen_linux64]# du -sh ../
22G	../

生成的8个tbl文件修改为csv结尾,下面的例子都以lineitem表为例,其他表可以以此为参考。

mv lineitem.tbl lineitem.csv

四、SingleStore建表及管道

--1
CREATE TABLE LINEITEM
(L_ORDERKEY           BIGINT NOT NULL,   
L_PARTKEY            INT NOT NULL, 
L_SUPPKEY            INT NOT NULL,
L_LINENUMBER         INT NOT NULL,
L_QUANTITY           FLOAT NOT NULL,
L_EXTENDEDPRICE      FLOAT NOT NULL,
L_DISCOUNT           FLOAT NOT NULL,
L_TAX                FLOAT NOT NULL,
L_RETURNFLAG         CHAR(1) NOT NULL,
L_LINESTATUS         CHAR(1) NOT NULL, 
L_SHIPDATE           DATE NOT NULL,
L_COMMITDATE         DATE NOT NULL,
L_RECEIPTDATE        DATE NOT NULL,
L_SHIPINSTRUCT       CHAR(25) NOT NULL,
L_SHIPMODE           CHAR(10) NOT NULL, 
L_COMMENT            VARCHAR(44) NOT NULL,
key(L_ORDERKEY,L_LINENUMBER) using clustered columnstore);

--2
SET GLOBAL pipelines_stop_on_error = false;

--3
CREATE PIPELINE LINEITEM_PIP AS LOAD DATA FS '/home/test/tpch/lineitem.csv' INTO TABLE LINEITEM FIELDS TERMINATED BY '|' lines TERMINATED BY '|\n';

--4
START PIPELINE LINEITEM_PIP;

--5
SHOW PIPELINES;
+------------------+---------+-----------+
| Pipelines_in_czg | State   | Scheduled |
+------------------+---------+-----------+
| LINEITEM_PIP     | Running | False     |
+------------------+---------+-----------+
1 row in set (0.00 sec)

--6
select count(*) from LINEITEM;
+-----------+
| count(*)  |
+-----------+
| 119994608 |
+-----------+
1 row in set (0.00 sec)

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值