I would expect the aggr for the fact table to happ...
# general
a
I would expect the aggr for the fact table to happen on pinot and then only the mapping of the ids to the values from dim table happen in presto.. Let me know if its not clear and i will post an example.
x
Presto will parse query and generate the plan, if it’s join then aggregate, presto will fetch data from both sides, only predicate push down.
If it’s one table agg then join, it should be simple agg pushdown
You can also do explain on your query to see the presto generated plan and see what’s generated PinotQuery
a
ok let me try this ! Thanks Xiang Fu
Copy code
presto:default> explain select sum(amount) from txn;
                                                                                                                                                                          
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 - Output[_col0] => [sum:double]                                                                                                                                          
         Estimates: {rows: ? (?), cpu: ?, memory: 0.00, network: ?}                                                                                                       
         _col0 := sum                                                                                                                                                     
     - RemoteStreamingExchange[GATHER] => [sum:double]                                                                                                                    
             Estimates: {rows: ? (?), cpu: ?, memory: 0.00, network: ?}                                                                                                   
         - TableScan[TableHandle {connectorId='pinot_quickstart', connectorHandle='PinotTableHandle{connectorId=pinot_quickstart, schemaName=default, tableName=txn, isQue
                 Estimates: {rows: ? (?), cpu: ?, memory: 0.00, network: 0.00}                                                                                            
                 sum := PinotColumnHandle{columnName=sum, dataType=double, type=DERIVED}
hi @User -- What does this mean ?
did this push down the agg?
x
you need to use the right arrow to show the full plan
a
yeah so i tried these two queries --
Copy code
select txName,sa from (select txtype,sum(amount) sa from txn group by txtype) a join txtypes b on a.txtype=b.txtype;

select txName,sum(a.amount) from txn a join txtypes b on a.txtype=b.txtype group by txName;
the first one did the push down (Pinot query had the group by logic)
the second one did not have the group by in PinotQuery..
Does this behavior look accurate to you ?
x
i think so
a
cool.. I understand now.
thank you !
x
this means presto parsed thee query into two plans
join later and join first
👍 1