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

AnalysisException: Incompatible return types (appartently cols were reordered internally)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.0
    • Impala 2.0
    • None
    • None

    Description

      Something strange happens with the query below that results in Impala thinking that the query is invalid. It complains about types being incompatible but the columns mentioned in the error are never used together in the query.

      [localhost.localdomain:21000] > 
      SELECT 1 
      FROM alltypesagg t1 
      INNER JOIN alltypesagg t2 ON 
        t2.date_string_col = t1.string_col 
        AND t2.id = t1.day 
      LEFT JOIN alltypesagg t3 ON 
        t3.id = t2.id 
        AND t3.string_col = t2.date_string_col;
      Query: explain SELECT 1 FROM alltypesagg t1 INNER JOIN alltypesagg t2 ON t2.date_string_col = t1.string_col AND t2.id = t1.day LEFT JOIN alltypesagg t3 ON t3.id = t2.id AND t3.string_col = t2.date_string_col
      ERROR: IllegalStateException: com.cloudera.impala.common.AnalysisException: Incompatible return types 'STRING' and 'INT' of exprs 't1.string_col' and 't3.id'.
      CAUSED BY: AnalysisException: Incompatible return types 'STRING' and 'INT' of exprs 't1.string_col' and 't3.id'.
      

      The query runs fine in Postgresql but returns no rows

      functional=# SELECT 1 
      functional-# FROM alltypesagg t1 
      functional-# INNER JOIN alltypesagg t2 ON 
      functional-#   t2.date_string_col = t1.string_col 
      functional-#   AND t2.id = t1.day 
      functional-# LEFT JOIN alltypesagg t3 ON 
      functional-#   t3.id = t2.id 
      functional-#   AND t3.string_col = t2.date_string_col;
       ?column? 
      ----------
      (0 rows)
      

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: