alamb commented on issue #14608:
URL: https://github.com/apache/datafusion/issues/14608#issuecomment-4031166999

   i think with the current state of `tpchgen-cli` this is now pretty easy to 
run tpch queries with datafusion-cli so I am going to claim this is closed
   
   ```shell
   tpchgen-cli --format=parquet --parts=10
   ```
   
   Then you can just run the queries like this:
   
   ```shell
   andrewlamb@Andrews-MacBook-Pro-3:~/Downloads$ datafusion-cli
   DataFusion CLI v52.1.0
   > 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-09-02'
   group by
       l_returnflag,
       l_linestatus
   order by
       l_returnflag,
       l_linestatus;
   
+--------------+--------------+-------------+-----------------+-------------------+---------------------+-----------+--------------+----------+-------------+
   | l_returnflag | l_linestatus | sum_qty     | sum_base_price  | 
sum_disc_price    | sum_charge          | avg_qty   | avg_price    | avg_disc | 
count_order |
   
+--------------+--------------+-------------+-----------------+-------------------+---------------------+-----------+--------------+----------+-------------+
   | A            | F            | 37734107.00 | 56586554400.73  | 
53758257134.8700  | 55909065222.827692  | 25.522005 | 38273.129734 | 0.049985 | 
1478493     |
   | N            | F            | 991417.00   | 1487504710.38   | 
1413082168.0541   | 1469649223.194375   | 25.516471 | 38284.467760 | 0.050093 | 
38854       |
   | N            | O            | 74476040.00 | 111701729697.74 | 
106118230307.6056 | 110367043872.497010 | 25.502226 | 38249.117988 | 0.049996 | 
2920374     |
   | R            | F            | 37719753.00 | 56568041380.90  | 
53741292684.6040  | 55889619119.831932  | 25.505793 | 38250.854626 | 0.050009 | 
1478870     |
   
+--------------+--------------+-------------+-----------------+-------------------+---------------------+-----------+--------------+----------+-------------+
   4 row(s) fetched.
   Elapsed 0.109 seconds.
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to