You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/09/02 12:41:57 UTC

[GitHub] [druid] pjain1 opened a new issue, #13019: Query planning fails for metadata query with ARRAY_AGG

pjain1 opened a new issue, #13019:
URL: https://github.com/apache/druid/issues/13019

   Below query for grouping all Druid datasources column names in array fails in calcite planning. 
   
   ```
   SELECT TABLE_NAME, ARRAY_AGG(COLUMN_NAME) from INFORMATION_SCHEMA.COLUMNS GROUP BY TABLE_NAME
   ```
   Exception -
   ```
   2022-09-02T12:37:06,748 WARN [sql[fd61bf40-b133-4127-b2d2-cd9a109e2f9d]] org.apache.druid.sql.calcite.planner.DruidPlanner - Cannot build plan for query. Please check Broker logs for more details. (org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough rules to produce a node with desired properties: convention=BINDABLE, sort=[]. All the inputs have relevant nodes, however the cost is still infinite.
   Root: rel#989:Subset#2.BINDABLE.[]
   Original rel:
   LogicalAggregate(subset=[rel#989:Subset#2.BINDABLE.[]], group=[{0}], EXPR$1=[ARRAY_AGG($1)]): rowcount = 10.0, cumulative cost = {11.25 rows, 0.0 cpu, 0.0 io}, id = 987
     LogicalProject(subset=[rel#986:Subset#1.NONE.[]], TABLE_NAME=[$2], COLUMN_NAME=[$3]): rowcount = 100.0, cumulative cost = {100.0 rows, 200.0 cpu, 0.0 io}, id = 985
       LogicalTableScan(subset=[rel#984:Subset#0.NONE.[]], table=[[INFORMATION_SCHEMA, COLUMNS]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 968
   )
   ```
   
   ### Affected Version
   
   All
   
   ### Steps to reproduce
   
   Run the query in the console and you will get the error in broker log.
   


-- 
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: commits-unsubscribe@druid.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] gianm commented on issue #13019: Query planning fails for metadata query with ARRAY_AGG

Posted by GitBox <gi...@apache.org>.
gianm commented on issue #13019:
URL: https://github.com/apache/druid/issues/13019#issuecomment-1238873533

   Ah, yeah. That's because system tables (`sys` and `INFORMATION_SCHEMA`) run using Calcite's interpreter, not the Druid query engine, so Druid-specific SQL extensions doesn't work on them. That includes not just `ARRAY_AGG`, but also most `TIME_*` functions, sketch functions, etc.
   
   We'll want to fix this at some point by making system table queries run through Druid's regular query engine. Perhaps this means expressing them as `inline` datasources, or perhaps it means creating new datasource types that correspond to these system tables.


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org