You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "caofangkun (JIRA)" <ji...@apache.org> on 2013/06/06 08:38:20 UTC

[jira] [Created] (HIVE-4671) When HiveQL WHERE clause is a constant value or a single column name , it should be handled in reason

caofangkun created HIVE-4671:
--------------------------------

             Summary: When HiveQL WHERE clause  is a constant value or a single column name , it should be  handled in reason
                 Key: HIVE-4671
                 URL: https://issues.apache.org/jira/browse/HIVE-4671
             Project: Hive
          Issue Type: Bug
          Components: Query Processor
    Affects Versions: 0.12.0
            Reporter: caofangkun
            Assignee: caofangkun
            Priority: Minor


User can specify any condition using WHERE clause. 
This clause is used to compare given value with the field value available in Hive table .
Generally speaking WHERE condition should be key-value pairs like `column_name = 'const value'  and ....` .
But the followwing three statements shoud also be handled in reason.

Statement One: WHERE condition is a boolean value 
the following two queries work well but should optimized as non-MR fetching
SELECT * FROM src WHERE true; 
SELECT * FROM src WHERE false; 

Statement One: WHERE condition is a single constat value
the following two queries will generate RunTime ClassCastException 
Should this to be optimized as "if Integer not equal to 0 then TRUE else FALSE " ?
SELECT * FROM src WHERE 1; 
SELECT * FROM src WHERE 0; 
SELECT * FROM src WHERE -1; 

Statement One: WHERE condition is a single column name
the following two query will generate RunTime ClassCastException  too .
Should this to be optimized as SemanticException ? 
SELECT * FROM src WHERE key;




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira