Rajkumar Singh created HIVE-22353:
-------------------------------------

             Summary: Hive JDBC Storage Handler: Simple query fail with " 
Invalid table alias or column reference"
                 Key: HIVE-22353
                 URL: https://issues.apache.org/jira/browse/HIVE-22353
             Project: Hive
          Issue Type: Bug
          Components: Hive
            Reporter: Rajkumar Singh


Steps To Repro:
{code:java}
// show create table (Hive) 
CREATE EXTERNAL TABLE `hive_visitors`(        
      `col1` bigint COMMENT 'from deserializer',       
      `col2` timestamp COMMENT 'from deserializer')    
    ROW FORMAT SERDE                                   
      'org.apache.hive.storage.jdbc.JdbcSerDe'         
    STORED BY                                          
      'org.apache.hive.storage.jdbc.JdbcStorageHandler'  
    WITH SERDEPROPERTIES (                             
      'serialization.format'='1')                      
    TBLPROPERTIES (                                    
      'bucketing_version'='2',                         
      'hive.sql.database.type'='MYSQL',                
      'hive.sql.dbcp.maxActive'='1',                   
      'hive.sql.dbcp.password'='hive',             
      'hive.sql.dbcp.username'='hive',             
      'hive.sql.jdbc.driver'='com.mysql.jdbc.Driver',  
      'hive.sql.jdbc.url'='jdbc:mysql://hostname/test',  
      'hive.sql.table'='visitors',           
      'transient_lastDdlTime'='1554910389') 

// MySql Table
CREATE TABLE `visitors` (
`id` bigint(20) unsigned NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
)

// Hive Query

 select * from hive_visitors where col2='2018-10-15';

Error: Error while compiling statement: FAILED: SemanticException [Error 
10004]: Line 1:34 Invalid table alias or column reference 'col2': (possible 
column names are: id, date) (state=42000,code=10004)
{code}
col2 is a valid column reference for the hive table, In some old version I was 
able to run the query referencing the hive column but it broken now.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to