Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1300

Unioning queries with subqueries could be supported

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.0
    • Impala 2.1
    • None
    • None

    Description

      The query below is rejected in analysis but could be allowed

      Query: 
        select COUNT(*) FROM alltypestiny WHERE int_col = (SELECT 1) 
      UNION 
        SELECT int_col FROM alltypestiny
      ERROR: AnalysisException: Unsupported statement containing subqueries: SELECT count(*) FROM functional.alltypestiny WHERE int_col = (SELECT 1) UNION SELECT int_col FROM functional.alltypestiny
      

      is the same as

      Query: 
        select count(*) 
        FROM functional.alltypestiny 
        LEFT SEMI JOIN (SELECT 1 `$c$1`) `$a$1` ON int_col = `$a$1`.`$c$1` 
      UNION 
        SELECT int_col FROM functional.alltypestiny
      +----------+
      | count(*) |
      +----------+
      | 4        |
      | 1        |
      | 0        |
      +----------+
      

      Attachments

        Activity

          People

            dtsirogiannis Dimitris Tsirogiannis
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: