欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

TPC-DS生成数据

程序员文章站 2023-12-25 12:24:09
下载依赖 yum -y install gcc gcc-c++ libstdc++-devel bison byacc flex 解压zip [root@localhost te...

下载依赖

yum -y install gcc gcc-c++ libstdc++-devel bison byacc flex


解压zip

[root@localhost test]# unzip 2d1cd9ff-67dd-4626-a26f-2ac09cb92d8f-tpc-ds-tool.zip 

[root@localhost test]# ls
2d1cd9ff-67dd-4626-a26f-2ac09cb92d8f-tpc-ds-tool.zip  v2.7.0
[root@localhost test]# cd v2.7.0/
[root@localhost v2.7.0]# ls
answer_sets  query_templates  specification  tools
EULA.txt     query_variants   tests
[root@localhost v2.7.0]# cd tools/
[root@localhost tools]# make

#可以先输入./dsdgen -help 查看相关用法
#下面语句表示生成1G数据到/tmp/目录下
[root@localhost tools]# ./dsdgen -scale 1 -dir /tmp/
dsdgen Population Generator (Version 2.7.0)
Copyright Transaction Processing Performance Council (TPC) 2001 - 2017
Warning: This scale factor is valid for QUALIFICATION ONLY

#等待一段时间后,可以查看生成的数据
[root@localhost tools]# ls /tmp/
call_center.dat       customer_demographics.dat   inventory.dat     store.dat          web_returns.dat
catalog_page.dat      data                        item.dat          store_returns.dat  web_sales.dat
catalog_returns.dat   date_dim.dat                ks-script-Ygt989  store_sales.dat    web_site.dat
catalog_sales.dat     dbgen_version.dat           promotion.dat     time_dim.dat       yum.log
customer_address.dat  household_demographics.dat  reason.dat        warehouse.dat
customer.dat          income_band.dat             ship_mode.dat     web_page.dat

#查看生成数据的具体内容
[root@localhost tools]# cat /tmp/reason.dat 
1|AAAAAAAABAAAAAAA|Package was damaged|
2|AAAAAAAACAAAAAAA|Stopped working|
3|AAAAAAAADAAAAAAA|Did not get it on time|
4|AAAAAAAAEAAAAAAA|Not the product that was ordred|
5|AAAAAAAAFAAAAAAA|Parts missing|
6|AAAAAAAAGAAAAAAA|Does not work with a product that I have|
7|AAAAAAAAHAAAAAAA|Gift exchange|
8|AAAAAAAAIAAAAAAA|Did not like the color|
9|AAAAAAAAJAAAAAAA|Did not like the model|
10|AAAAAAAAKAAAAAAA|Did not like the make|
11|AAAAAAAALAAAAAAA|Did not like the warranty|
12|AAAAAAAAMAAAAAAA|No service location in my area|
13|AAAAAAAANAAAAAAA|Found a better price in a store|
14|AAAAAAAAOAAAAAAA|Found a better extended warranty in a store|
15|AAAAAAAAPAAAAAAA|Not working any more|
16|AAAAAAAAABAAAAAA|Did not fit|
17|AAAAAAAABBAAAAAA|Wrong size|
18|AAAAAAAACBAAAAAA|Lost my job|
19|AAAAAAAADBAAAAAA|unauthoized purchase|
20|AAAAAAAAEBAAAAAA|duplicate purchase|
21|AAAAAAAAFBAAAAAA|its is a boy|
22|AAAAAAAAGBAAAAAA|it is a girl|
23|AAAAAAAAHBAAAAAA|reason 23|
24|AAAAAAAAIBAAAAAA|reason 24|
25|AAAAAAAAJBAAAAAA|reason 25|
26|AAAAAAAAKBAAAAAA|reason 26|
27|AAAAAAAALBAAAAAA|reason 27|
28|AAAAAAAAMBAAAAAA|reason 28|
29|AAAAAAAANBAAAAAA|reason 29|
30|AAAAAAAAOBAAAAAA|reason 31|
31|AAAAAAAAPBAAAAAA|reason 31|
32|AAAAAAAAACAAAAAA|reason 32|
33|AAAAAAAABCAAAAAA|reason 33|
34|AAAAAAAACCAAAAAA|reason 34|
35|AAAAAAAADCAAAAAA|reason 35|

之后,更改参数大小即可生成你想要生成数据。

上一篇:

下一篇: