alamb commented on code in PR #4199:
URL: https://github.com/apache/arrow-datafusion/pull/4199#discussion_r1023072260


##########
benchmarks/expected-plans/q6.txt:
##########
@@ -1,6 +1,4 @@
 Projection: SUM(lineitem.l_extendedprice * lineitem.l_discount) AS revenue
   Aggregate: groupBy=[[]], aggr=[[SUM(lineitem.l_extendedprice * 
lineitem.l_discount)]]
-    Projection: lineitem.l_extendedprice, lineitem.l_discount
-      Filter: lineitem.l_shipdate >= Date32("8766") AND lineitem.l_shipdate < 
Date32("9131") AND CAST(lineitem.l_discount AS Decimal128(30, 
15))lineitem.l_discount >= Decimal128(Some(49999999999999),30,15) AND 
CAST(lineitem.l_discount AS Decimal128(30, 15))lineitem.l_discount <= 
Decimal128(Some(69999999999999),30,15) AND lineitem.l_quantity < 
Decimal128(Some(2400),15,2)
-        Projection: CAST(lineitem.l_discount AS Decimal128(30, 15)) AS 
CAST(lineitem.l_discount AS Decimal128(30, 15))lineitem.l_discount, 
lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, 
lineitem.l_shipdate
-          TableScan: lineitem projection=[l_quantity, l_extendedprice, 
l_discount, l_shipdate]
\ No newline at end of file
+    Filter: lineitem.l_shipdate >= Date32("8766") AND lineitem.l_shipdate < 
Date32("9131") AND lineitem.l_discount >= Decimal128(Some(5),15,2) AND 
lineitem.l_discount <= Decimal128(Some(7),15,2) AND lineitem.l_quantity < 
Decimal128(Some(2400),15,2)

Review Comment:
   This plan has improved -- the projections are gone and the exprs are simpler
   
   I believe the improvement stem from better casting support in Arrow, but I 
can't honestly find the specific improvement in 
https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md#2700-2022-11-11
   
   
   As a reminder the query is
   ```sql
   select
       sum(l_extendedprice * l_discount) as revenue
   from
       lineitem
   where
           l_shipdate >= date '1994-01-01'
     and l_shipdate < date '1995-01-01'
     and l_discount between 0.06 - 0.01 and 0.06 + 0.01
     and l_quantity < 24;
   ```
   
   



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

Reply via email to