andygrove commented on a change in pull request #8845:
URL: https://github.com/apache/arrow/pull/8845#discussion_r537055905
##########
File path: rust/benchmarks/src/bin/tpch.rs
##########
@@ -145,59 +145,849 @@ async fn benchmark(opt: BenchmarkOpt) -> Result<()> {
fn create_logical_plan(ctx: &mut ExecutionContext, query: usize) ->
Result<LogicalPlan> {
match query {
+
+ // original
+ // 1 => ctx.create_logical_plan(
+ // format!(
+ // "select
+ // l_returnflag,
+ // l_linestatus,
+ // sum(l_quantity) as sum_qty,
+ // sum(l_extendedprice) as sum_base_price,
+ // sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
+ // sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as
sum_charge,
+ // avg(l_quantity) as avg_qty,
+ // avg(l_extendedprice) as avg_price,
+ // avg(l_discount) as avg_disc,
+ // count(*) as count_order
+ // from
+ // lineitem
+ // where
+ // l_shipdate <= date '1998-12-01' - interval '{DELTA}' day (3)
+ // group by
+ // l_returnflag,
+ // l_linestatus
+ // order by
+ // l_returnflag,
+ // l_linestatus;",
+ // DELTA="90").as_ref()
+ // ),
1 => ctx.create_logical_plan(
+ format!(
"select
- l_returnflag,
- l_linestatus,
- sum(l_quantity),
- sum(l_extendedprice),
- sum(l_extendedprice * (1 - l_discount)),
- sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)),
- avg(l_quantity),
- avg(l_extendedprice),
- avg(l_discount),
- count(*)
- from
- lineitem
- where
- l_shipdate <= '1998-12-01'
- group by
- l_returnflag,
- l_linestatus
- order by
- l_returnflag,
- l_linestatus",
+ l_returnflag,
+ l_linestatus,
+ sum(l_quantity) as sum_qty,
+ sum(l_extendedprice) as sum_base_price,
+ sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
+ sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as
sum_charge,
+ avg(l_quantity) as avg_qty,
+ avg(l_extendedprice) as avg_price,
+ avg(l_discount) as avg_disc,
+ count(*) as count_order
+ from
+ lineitem
+ where
+ l_shipdate <= '1998-09-02'
+ group by
+ l_returnflag,
+ l_linestatus
+ order by
+ l_returnflag,
+ l_linestatus;",
+ ).as_ref()
+ ),
+
+ 2 => ctx.create_logical_plan(
+ format!(
+ "select
+ s_acctbal,
+ s_name,
+ n_name,
+ p_partkey,
+ p_mfgr,
+ s_address,
+ s_phone,
+ s_comment
+ from
+ part,
+ supplier,
+ partsupp,
+ nation,
+ region
+ where
+ p_partkey = ps_partkey
+ and s_suppkey = ps_suppkey
+ and p_size = {SIZE}
Review comment:
I think I agree. If we ever wanted to run these queries with different
parameters we would want to use the tools provided by TPC to generate the
queries to a text file. I'm not sure there is value in having them as
parameters here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]