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

Impala error 'IllegalStateException: constructed predicate failed analysis:' when selecting from a Hive view and predicate operands are not comparable types

    XMLWordPrintableJSON

Details

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

    Description

      This always happens for views created in Hive, but doesn't seem to impact views created in Impala. I need to look into the code to understand better why this is. This is a regression for v1.2.1.

      Repro:

      -- In Hive
      create view test_hive as select * from alltypes;
      
      -- In Impala:
      select * from test_hive, functional.alltypes where test_hive.string_col = alltypes.int_col;
      -- RESULT:
      ERROR: AnalysisException: null
      CAUSED BY: IllegalStateException: constructed predicate failed analysis: test_hive.string_col = alltypes.int_col
      

      There are multiple problems going on here.
      1) We shouldn't be failing with an IllegalStateException
      2) No information on why the "predicate failed analysis" is given because the predicate's AnalysisException is not included as the cause of the IllegalStateException. If this is fixed it's easy to see the reason is because the operands are not compatible.
      3) Hive appears to have a bug in which it always gives partition columns a 'STRING' column type in a view. This is a separate issue, but because of this bug this is a problem that can be hit very easily. This is a regression from v1.2.1 - I believe the recent planner changes made this predicate validation more restrictive causing these problems. I will impact most people using hive views with Impala on tables with non-string partition key columns:

      -- In Hive (alltypes has int partition keys)
      create view hive_view as select * from functional.alltypes
      
      -- In Impala (this will fail since hive_view.year will be STRING instead of INT)
      select * from hive_view limit 1;
      

      Attachments

        Activity

          People

            marcelk Marcel Kinard
            lskuff Lenni Kuff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: