ablog

不器用で落着きのない技術者のメモ

Amazon Redshift チュートリアルの Star Schema Benchmark のサンプルデータを増幅する

Redshift の Tutorial: Tuning Table Design の Star Schema Benchmark (SSB) のサンプルデータを増幅した。
f:id:yohei-a:20191222171519p:plain


lineorder に lo_yyyy カラムを追加し、1001年〜2000年までの1,000倍に増幅し、24.8GB を 24.8TB に増幅した。

  • Athena で以下のテーブルを作成する。
CREATE EXTERNAL TABLE `gz_lineorder_partitioned`(
  `lo_orderkey` bigint, 
  `lo_linenumber` bigint, 
  `lo_custkey` bigint, 
  `lo_partkey` bigint, 
  `lo_suppkey` bigint, 
  `lo_orderdate` bigint, 
  `lo_orderpriority` string, 
  `lo_shippriority` bigint, 
  `lo_quantity` bigint, 
  `lo_extendedprice` bigint, 
  `lo_ordertotalprice` bigint, 
  `lo_discount` bigint, 
  `lo_revenue` bigint, 
  `lo_supplycost` bigint, 
  `lo_tax` bigint, 
  `lo_commitdate` bigint, 
  `lo_shipmode` string)
PARTITIONED BY (lo_yyyy bigint)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '|' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  's3://az-gold-data/ssbgz/lineorder_partitioned/'
TBLPROPERTIES ( 
  'areColumnsQuoted'='false', 
  'averageRecordSize'='98', 
  'classification'='csv', 
  'columnsOrdered'='true', 
  'compressionType'='gzip', 
  'delimiter'='|',  
  'typeOfData'='file')