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

Allow AS after parenthesized JOIN

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In CALCITE-35, we added support for parenthesized join, for example

      SELECT a.x, b.y, c.z FROM a CROSS JOIN (b CROSS JOIN c)
      

      but the SQL standard and PostgreSQL go further, and allow you to add an alias:

      SELECT a.x, d.y, d.z FROM a CROSS JOIN (b CROSS JOIN c) AS d
      

      Note that the second query has "AS d" at the end, and "b.y, c.z" in the SELECT clause has changed to "d.y, d.z". The "d" alias obscures the "b" and "c" aliases, so "b.y, c.z" would no longer be valid. (If "y" and "z" are not unique in "d", the new query would be invalid too.)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: