Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-20690

Subqueries in FROM should have alias names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • SQL
    • None

    Description

      We add missing attributes into Filter in Analyzer. But we shouldn't do it through subqueries like this:

      select 1 from  (select 1 from onerow t1 LIMIT 1) where  t1.c1=1
      

      This query works in current codebase. However, the outside where clause shouldn't be able to refer t1.c1 attribute.

      The root cause is we allow subqueries in FROM have no alias names previously, it is confusing and isn't supported by various databases such as MySQL, Postgres, Oracle. We shouldn't support it too.

      Attachments

        Issue Links

          Activity

            People

              viirya L. C. Hsieh
              viirya L. C. Hsieh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: