Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4307

For partitioned table , if where statement is 'const string equals const string', the query will throw MismatchedTokenException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.10.0
    • None
    • Query Processor
    • None

    Description

      For example:
      create table srcpart (key string, value string) partitioned by (ds string, hr string);
      hive>explain select * from srcpart where 'test'='test2';
      BR.recoverFromMismatchedToken
      FAILED: Error in semantic analysis: MetaException(message:Error parsing partition filter : MismatchedTokenException(9!=8))

      For views there's a potentially dangerous:
      For Example:
      create view v_test_table ( id, key, type, dt) as
      select id, key ,type dt from
      ( select id ,key , 'apple' as type , dt
      from src_test_table
      where dt='20130326′
      ) t;

      The following three query statements will work well:
      explain select * from v_test_table where id='123' ;
      explain select * from v_test_table where key='123' ;
      explain select * from v_test_table where dt='20130326' ;

      But the following query will fail :
      explain select * from v_test_table where type='orange' ;
      BR.recoverFromMismatchedToken
      FAILED: Error in semantic analysis: MetaException(message:Error parsing partition filter : MismatchedTokenException(9!=8))

      Attachments

        1. HIVE-4307-1.patch
          2 kB
          caofangkun

        Activity

          People

            Unassigned Unassigned
            caofangkun caofangkun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: