You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "tls-applied (via GitHub)" <gi...@apache.org> on 2024/06/05 22:10:49 UTC

[I] Query with JSON_QUERY/JSON_VALUE using parameters across a join fails to be planned (druid)

tls-applied opened a new issue, #16560:
URL: https://github.com/apache/druid/issues/16560

   ### Description
   Sample query:
   ```sql
   SELECT
     JSON_VALUE(a.data, b.path)
   FROM (
       VALUES
         (PARSE_JSON('{"x": 1}'))
     ) a(data)
     CROSS JOIN (
       VALUES
         ('$.x')
     ) b(path)
   ```
   Relevant errors:
   ```
   2024-06-05T21:36:40,185 WARN [sql[67983b92-e41d-4933-be2e-a172b0f43148]] org.apache.druid.sql.calcite.planner.QueryHandler - Query not supported. Please check Broker logs for additional details. SQL was: SELECT
     JSON_VALUE(a.data, b.path)
   FROM
     (
       VALUES
         (PARSE_JSON('{"x": 1}'))
     ) a(data)
     CROSS JOIN (
       VALUES
         ('$.x')
     ) b(path)
   LIMIT 11 (org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough rules to produce a node with desired properties: convention=DRUID, sort=[].
   Missing conversion is LogicalSort[convention: NONE -> DRUID]
   There is 1 empty subset: rel#53574:Subset#5.DRUID.[], the relevant part of the original plan is as follows
   53572:LogicalSort(fetch=[11])
     53570:LogicalProject(subset=[rel#53571:Subset#4.NONE.[]], EXPR$0=[CAST(JSON_VALUE_VARCHAR($0, $1)):VARCHAR(2000)])
       53568:LogicalJoin(subset=[rel#53569:Subset#3.NONE.[]], condition=[true], joinType=[inner])
         53565:LogicalProject(subset=[rel#53566:Subset#1.NONE.[]], EXPR$0=[PARSE_JSON('{"x": 1}')])
           53537:LogicalValues(subset=[rel#53564:Subset#0.NONE.[0]], tuples=[[{ 0 }]])
         53539:LogicalValues(subset=[rel#53567:Subset#2.NONE.[0]], tuples=[[{ '$.x' }]])
   
   Root: rel#53574:Subset#5.DRUID.[]
   Original rel:
   LogicalSort(subset=[rel#53574:Subset#5.DRUID.[]], fetch=[11]): rowcount = 1.0, cumulative cost = {1.0 rows, 4.0 cpu, 0.0 io}, id = 53572
     LogicalProject(subset=[rel#53571:Subset#4.NONE.[]], EXPR$0=[CAST(JSON_VALUE_VARCHAR($0, $1)):VARCHAR(2000)]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 53570
       LogicalJoin(subset=[rel#53569:Subset#3.NONE.[]], condition=[true], joinType=[inner]): rowcount = 1.0, cumulative cost = {1.0 rows, 0.0 cpu, 0.0 io}, id = 53568
         LogicalProject(subset=[rel#53566:Subset#1.NONE.[]], EXPR$0=[PARSE_JSON('{"x": 1}')]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 53565
           LogicalValues(subset=[rel#53564:Subset#0.NONE.[0]], tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 53537
         LogicalValues(subset=[rel#53567:Subset#2.NONE.[0]], tuples=[[{ '$.x' }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 53539
   )
   ```
   Is this expected to fail and is there a way to work around it?
   
   ### Affected Version
   26.0.0


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


Re: [I] Query with JSON_QUERY/JSON_VALUE using parameters across a join fails to be planned (druid)

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #16560: Query with JSON_QUERY/JSON_VALUE using parameters across a join fails to be planned
URL: https://github.com/apache/druid/issues/16560


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


Re: [I] Query with JSON_QUERY/JSON_VALUE using parameters across a join fails to be planned (druid)

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #16560:
URL: https://github.com/apache/druid/issues/16560#issuecomment-2791249860

   This issue has been closed due to lack of activity. If you think that
   is incorrect, or the issue requires additional review, you can revive the issue at
   any time.


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


Re: [I] Query with JSON_QUERY/JSON_VALUE using parameters across a join fails to be planned (druid)

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #16560:
URL: https://github.com/apache/druid/issues/16560#issuecomment-2719427740

   This issue has been marked as stale due to 280 days of inactivity.
   It will be closed in 4 weeks if no further activity occurs. If this issue is still
   relevant, please simply write any comment. Even if closed, you can still revive the
   issue at any time or discuss it on the dev@druid.apache.org list.
   Thank you for your contributions.


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