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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Impala 2.0, Impala 2.1, Impala 2.2
    • Fix Version/s: Impala 2.11.0
    • Component/s: Frontend
    • Labels:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: