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

Allow constant exprs as the left-hand side of an IN subquery

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Impala 2.0, Impala 2.1, Impala 2.2
    • Impala 2.11.0
    • Frontend

    Description

      The following two queries should produce identical results, but this is not the case. Both queries use the functional database.

      This query seems to produce correct results.

      SELECT *
      FROM alltypestiny
      WHERE (smallint_col = double_col) IN (SELECT bool_col FROM alltypesagg)
      

      In this query, we replace (smallint_col = double_col) with TRUE, and Impala throws AnalysisException.

      SELECT *
      FROM alltypestiny
      WHERE TRUE IN (SELECT bool_col FROM alltypesagg)
      

      Workaround
      Wrap the TRUE constant in an inline view. To fix the example above:

      SELECT *
      FROM alltypestiny, (SELECT TRUE tmp) v
      WHERE tmp IN (SELECT bool_col FROM alltypesagg)
      

      Attachments

        Activity

          People

            vukercegovac Vuk Ercegovac
            tarasbob Taras Bobrovytsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: