nishantmonu51 opened a new issue #10559:
URL: https://github.com/apache/druid/issues/10559


   ### Description
   
   Below query throws a planner exception - 
   ```
   SELECT * FROM 
   (
     SELECT "channel", count(*) as c
     from wikipedia
     group by 1 
     ORDER BY 2 desc
     limit 10
   ) 
   where "channel" = '#en.wikipedia'
   ```
   
   From the druid broker logs - 
   
   ```
        Suppressed: org.apache.calcite.plan.RelOptPlanner$CannotPlanException: 
There are not enough rules to produce a node with desired properties: 
convention=BINDABLE, sort=[].  │
   │ Root: rel#37119:Subset#10.BINDABLE.[]                                      
                                                                                
                     │
   │ Original rel:                                                              
                                                                                
                     │
   │ LogicalSort(subset=[rel#37068:Subset#5.DRUID.[]], fetch=[100]): rowcount = 
1.5, cumulative cost = {1.5 rows, 12.0 cpu, 0.0 io}, id = 37066                 
                     │
   │   LogicalFilter(subset=[rel#37065:Subset#4.NONE.[1 DESC]], 
condition=[=($0, '#en.wikipedia')]): rowcount = 1.5, cumulative cost = {1.5 
rows, 10.0 cpu, 0.0 io}, id = 37064      │
   │     LogicalSort(subset=[rel#37063:Subset#3.NONE.[1 DESC]], sort0=[$1], 
dir0=[DESC], fetch=[10]): rowcount = 10.0, cumulative cost = {10.0 rows, 
184.2068074395237 cpu, 0.0 io}, │
   │       LogicalAggregate(subset=[rel#37061:Subset#2.NONE.[]], group=[{0}], 
c=[COUNT()]): rowcount = 10.0, cumulative cost = {11.25 rows, 0.0 cpu, 0.0 io}, 
id = 37060             │
   │         LogicalProject(subset=[rel#37059:Subset#1.NONE.[]], channel=[$1]): 
rowcount = 100.0, cumulative cost = {100.0 rows, 100.0 cpu, 0.0 io}, id = 37058 
                     │
   │           LogicalTableScan(subset=[rel#37057:Subset#0.NONE.[]], 
table=[[druid, wikipedia]]): rowcount = 100.0, cumulative cost = {100.0 rows, 
101.0 cpu, 0.0 io}, id = 37019    │
   │ Sets:
   ```
   
   Note - this is a simplified version of a complex query generated by Tableau. 


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

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