Rich-T-kid commented on PR #23187:
URL: https://github.com/apache/datafusion/pull/23187#issuecomment-5193826956

   I ran TPCH Q4 against main and these were my results
   
   
   ```
   tpchgen-cli -s 10 --tables orders --format=parquet
   ```
   main 
   ```
   datafusion-cli -c "
   SELECT o_orderpriority, count(*) AS order_count
   FROM 'orders.parquet'
   WHERE o_orderdate >= date '1993-07-01'
     AND o_orderdate < date '1993-10-01'
     AND EXISTS (
       SELECT 1 FROM 'lineitem.parquet'
       WHERE l_orderkey = o_orderkey AND l_commitdate < l_receiptdate
     )
   GROUP BY o_orderpriority
   ORDER BY o_orderpriority;
   "
   
   DataFusion CLI v54.0.0
   +-----------------+-------------+
   | o_orderpriority | order_count |
   +-----------------+-------------+
   | 1-URGENT        | 105214      |
   | 2-HIGH          | 104821      |
   | 3-MEDIUM        | 105227      |
   | 4-NOT SPECIFIED | 105422      |
   | 5-LOW           | 105356      |
   +-----------------+-------------+
   5 row(s) fetched. 
   Elapsed 0.161 seconds.
   
   ```
   
   cast the columns to dictionary using
   ```
   datafusion-cli -c "
   COPY (
     SELECT o_orderkey, o_orderdate,
       arrow_cast(o_orderpriority, 'Dictionary(Int32, Utf8)') AS o_orderpriority
     FROM 'orders.parquet'
   ) TO 'orders_dict.parquet';
   "
   ```
   
   **this branch**
   ```
   datafusion-cli -c "
   SELECT o_orderpriority, count(*) AS order_count
   FROM 'orders_dict.parquet'
   WHERE o_orderdate >= date '1993-07-01'
     AND o_orderdate < date '1993-10-01'
     AND EXISTS (
       SELECT 1 FROM 'lineitem.parquet'
       WHERE l_orderkey = o_orderkey AND l_commitdate < l_receiptdate
     )
   GROUP BY o_orderpriority
   ORDER BY o_orderpriority;
   "
   
   DataFusion CLI v54.0.0
   +-----------------+-------------+
   | o_orderpriority | order_count |
   +-----------------+-------------+
   | 1-URGENT        | 105214      |
   | 2-HIGH          | 104821      |
   | 3-MEDIUM        | 105227      |
   | 4-NOT SPECIFIED | 105422      |
   | 5-LOW           | 105356      |
   +-----------------+-------------+
   5 row(s) fetched. 
   Elapsed 0.095 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