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

SqlAdvisor: scalar sub-query support

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.17.0
    • 1.18.0
    • core
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: