Hive
  1. Hive
  2. HIVE-4307

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      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))

        Activity

        Hide
        caofangkun added a comment -

        Navis Well .This is indeed fixed in trunk.

        Show
        caofangkun added a comment - Navis Well .This is indeed fixed in trunk.
        Hide
        Navis added a comment -

        caofangkun Sorry for stupid answer. And I think this is fixed in trunk by HIVE-701 or others. Cannot reproduce the failure.

        Show
        Navis added a comment - caofangkun Sorry for stupid answer. And I think this is fixed in trunk by HIVE-701 or others. Cannot reproduce the failure.
        Hide
        caofangkun added a comment -

        Navis if quotation marks is wrong then should throw Parse Error
        hive (default)> explain select * from srcpart where 'test' = 'test’;
        [2013-04-08 14:38:58]: Compile Start
        FAILED: Parse Error: line 1:51 character '<EOF>' not supported here
        line 1:50 character '’' not supported here

        [2013-04-08 14:38:58]: Compile End

        Show
        caofangkun added a comment - Navis if quotation marks is wrong then should throw Parse Error hive (default)> explain select * from srcpart where 'test' = 'test’; [2013-04-08 14:38:58] : Compile Start FAILED: Parse Error: line 1:51 character '<EOF>' not supported here line 1:50 character '’' not supported here [2013-04-08 14:38:58] : Compile End
        Show
        caofangkun added a comment - https://reviews.apache.org/r/10334/
        Hide
        Navis added a comment -

        should be 'test2' not 'test2′

        Show
        Navis added a comment - should be 'test2' not 'test2′

          People

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

            Dates

            • Created:
              Updated:

              Development