Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2477

SqlAdvisor: scalar sub-query support

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.17.0
    • Fix Version/s: 1.18.0
    • Component/s: core
    • Labels:
      None

      Description

      select ax^ from (select (select * from dummy) axc from dummy a)

      After simplify:

      SELECT ax _suggest_ FROM ( SELECT ( SELECT * FROM dummy ) axc FROM dummy a ) )

      Note the extra closing brace.

      TL;DR: consumeQuery assumes axc FROM dummy... is a "union-kind of" continuation of a query started in select *....
      The solution is keep advancing in consumeQuery only if known tokens are ahead (e.g. union, intersect, ...)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vladimirsitnikov Vladimir Sitnikov
                Reporter:
                vladimirsitnikov Vladimir Sitnikov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: