TPC-DS 提供了 dsqgen 工具用来生成查询语句, 共有 99 条查询语句(每条语句都有商业价值, 可以参考官方说明文档中的介绍).
qgen2 Population Generator (Version 2.8.0)
Copyright Transaction Processing Performance Council (TPC) 2001 - 2018
USAGE: qgen2 [options]
Note: When defined in a parameter file (using -p), parmeters should
use the form below. Each option can also be set from the command
line, using a form of '/param [optional argument]'
Unique anchored substrings of options are also recognized, and
case is ignored, so '/sc' is equivalent to '/SCALE'
General Options
===============
FILE = <s> -- read parameters from file <s>
VERBOSE = [Y|N] -- enable verbose output
HELP = [Y|N] -- display this message
OUTPUT_DIR = <s> -- write query streams into directory <s>
QUIET = [Y|N] -- suppress all output (for scripting)
STREAMS = <n> -- generate <n> query streams/versions
INPUT = <s> -- read template names from <s>
SCALE = <n> -- assume a database of <n> GB
LOG = <s> -- write parameter log to <s>
QUALIFY = [Y|N] -- generate qualification queries in ascending order
Advanced Options
===============
DISTRIBUTIONS = <s> -- read distributions from file <s>
PATH_SEP = <s> -- use <s> to separate path elements
RNGSEED = <n> -- seed the RNG with <n>
RELEASE = [Y|N] -- display QGEN release info
TEMPLATE = <s> -- build queries from template <s> ONLY
COUNT = <n> -- generate <n> versions per stream (used with TEMPLATE)
DEBUG = [Y|N] -- minor debugging outptut
FILTER = [Y|N] -- write generated queries to stdout
DIALECT = <s> -- include query dialect defintions found in <s>.tpl
DIRECTORY = <s> -- look in <s> for templates
其中, RNGSEED 参数可以指定一个随机的种子(默认是Load完成时间), 用来生成一些 SQL 语句中的替换参数.
query7.tpl
Compute the average quantity, list price, discount, and sales price for promotional items sold in stores where the promotion is not offered by mail or a special event. Restrict the results to a specific gender, marital and educational status.
Qualification Substitution Parameters:
YEAR.01=2000
ES.01=College
MS.01=S
GEN.01=M
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
加入交流群
请使用微信扫一扫!