walterddr opened a new issue, #11677:
URL: https://github.com/apache/pinot/issues/11677

   several MV validator issues are found
   
   ---
   exception is not thrown
   ---
   
   ```
   explain plan for
   select MAXMV(a.mv) from a join b on a.id = b.id limit 10
   ```
   returns
   ```
   Execution Plan
   LogicalSort(fetch=[10])
     PinotLogicalSortExchange(distribution=[hash], collation=[[]], 
isSortOnSender=[false], isSortOnReceiver=[false])
       LogicalAggregate(group=[{}], agg#0=[MAXMV($0)])
         PinotLogicalExchange(distribution=[hash])
           LogicalAggregate(group=[{}], agg#0=[MAXMV($1)])
             LogicalJoin(condition=[=($0, $2)], joinType=[inner])
               PinotLogicalExchange(distribution=[hash[0]])
                 LogicalProject(id=[$6], mv=[$7])
                   LogicalTableScan(table=[[a]])
               PinotLogicalExchange(distribution=[hash[0]])
                 LogicalProject(id=[$6])
                   LogicalTableScan(table=[[b]])
   ```
   but it should failed on MAXMV($1) aggregate b/c it is not supported
   
   ---
   wrong exception is thrown NO.1
   ---
   
   ```
   explain plan for
   select MAX(arrayToMv(a.mv)) from a join b on a.id = b.id limit 10
   ``` 
   seems to throw the exception:
   ```
   Function 'ArrayToMv' is not supported in PROJECT Leaf Stage
   
org.apache.pinot.query.planner.validation.ArrayToMvValidationVisitor.visitProject(ArrayToMvValidationVisitor.java:99)
   
org.apache.pinot.query.planner.validation.ArrayToMvValidationVisitor.visitProject(ArrayToMvValidationVisitor.java:43)
   
org.apache.pinot.query.planner.plannode.ProjectNode.visit(ProjectNode.java:54)
   
org.apache.pinot.query.planner.validation.ArrayToMvValidationVisitor.lambda$visitMailboxSend$3(ArrayToMvValidationVisitor.java:72)
   ```
   but it is not suppose to be after PROJECT pushdown:
   ```
   Execution Plan
   LogicalSort(fetch=[10])
     PinotLogicalSortExchange(distribution=[hash], collation=[[]], 
isSortOnSender=[false], isSortOnReceiver=[false])
       LogicalAggregate(group=[{}], agg#0=[MAX($0)])
         PinotLogicalExchange(distribution=[hash])
           LogicalAggregate(group=[{}], agg#0=[MAX($1)])
             LogicalJoin(condition=[=($0, $2)], joinType=[inner])
               PinotLogicalExchange(distribution=[hash[0]])
                 LogicalProject(id=[$6], $f0=[ARRAYTOMV($7)])
                   LogicalTableScan(table=[[a]])
               PinotLogicalExchange(distribution=[hash[0]])
                 LogicalProject(id=[$6])
                   LogicalTableScan(table=[[b]])
   ```
   
   ---
   wrong exception is thrown NO.2
   ---
   
   ```
   explain plan for
   select /*+ joinOptions(join_strategy = 'dynamic_broadcast') */ 
     MAX(arrayToMv(a.label_ids)) 
   from github_2 a 
   where a.id IN (select id FROM github_events b)
   ```
   generates the following plan
   ```
   LogicalAggregate(group=[{}], agg#0=[MAX($0)])
     PinotLogicalExchange(distribution=[hash])
       LogicalAggregate(group=[{}], agg#0=[MAX($1)])
         PinotLogicalExchange(distribution=[hash[0]])
           LogicalJoin(condition=[=($0, $8)], joinType=[semi])
             LogicalProject(id=[$6], $f0=[ARRAYTOMV($7)])
               LogicalTableScan(table=[[a]])
             PinotLogicalExchange(distribution=[broadcast], 
relExchangeType=[PIPELINE_BREAKER])
               LogicalTableScan(table=[[b]])
   ```


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