[ 
https://issues.apache.org/jira/browse/HIVE-12328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14988307#comment-14988307
 ] 

Thejas M Nair commented on HIVE-12328:
--------------------------------------

But there seems like a bigger problem here, than just improper error message. 
The column code is there in both LHS and RHS. It should have complained about 
ambigous column in this case. (fyi, i was trying to use the "join .. using " 
syntax, but used " on " instead ).

The join expression looks broken, the "keys" under " Map Join Operator" is 
empty -
{code}
0: jdbc:hive2://localhost:10000/default> explain select * from sample_07 a join 
sample_07 b on (code);
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
|                                                                               
                            Explain                                             
                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
| Plan not optimized by CBO.                                                    
                                                                                
                                                              |
|                                                                               
                                                                                
                                                              |
| Vertex dependency in root stage                                               
                                                                                
                                                              |
| Map 1 <- Map 2 (BROADCAST_EDGE)                                               
                                                                                
                                                              |
|                                                                               
                                                                                
                                                              |
| Stage-0                                                                       
                                                                                
                                                              |
|    Fetch Operator                                                             
                                                                                
                                                              |
|       limit:-1                                                                
                                                                                
                                                              |
|       Stage-1                                                                 
                                                                                
                                                              |
|          Map 1                                                                
                                                                                
                                                              |
|          File Output Operator [FS_84]                                         
                                                                                
                                                              |
|             compressed:false                                                  
                                                                                
                                                              |
|             Statistics:Num rows: 243 Data size: 50660 Basic stats: COMPLETE 
Column stats: NONE                                                              
                                                                |
|             
table:{"serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe","input 
format:":"org.apache.hadoop.mapred.TextInputFormat","output 
format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat"}  |
|             Select Operator [SEL_83]                                          
                                                                                
                                                              |
|                
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                                                                                
                                          |
|                Statistics:Num rows: 243 Data size: 50660 Basic stats: 
COMPLETE Column stats: NONE                                                     
                                                                      |
|                Map Join Operator [MAPJOIN_86]                                 
                                                                                
                                                              |
|                |  condition map:[{"":"Inner Join 0 to 1"}]                    
                                                                                
                                                              |
|                |  keys:{}                                                     
                                                                                
                                                              |
|                |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col7","_col8","_col9","_col10"]
                                                                                
                                      |
|                |  Statistics:Num rows: 243 Data size: 50660 Basic stats: 
COMPLETE Column stats: NONE                                                     
                                                                   |
|                |<-Map 2 [BROADCAST_EDGE]                                      
                                                                                
                                                              |
|                |  Reduce Output Operator [RS_81]                              
                                                                                
                                                              |
|                |     sort order:                                              
                                                                                
                                                              |
|                |     Statistics:Num rows: 110 Data size: 22923 Basic stats: 
COMPLETE Column stats: NONE                                                     
                                                                |
|                |     value expressions:code (type: string), description 
(type: string), total_emp (type: int), salary (type: int)                       
                                                                    |
|                |     Filter Operator [FIL_85]                                 
                                                                                
                                                              |
|                |        predicate:code (type: string)                         
                                                                                
                                                              |
|                |        Statistics:Num rows: 110 Data size: 22923 Basic 
stats: COMPLETE Column stats: NONE                                              
                                                                    |
|                |        TableScan [TS_78]                                     
                                                                                
                                                              |
|                |           alias:b                                            
                                                                                
                                                              |
|                |           Statistics:Num rows: 221 Data size: 46055 Basic 
stats: COMPLETE Column stats: NONE                                              
                                                                 |
|                |<-TableScan [TS_77]                                           
                                                                                
                                                              |
|                      alias:a                                                  
                                                                                
                                                              |
|                      Statistics:Num rows: 221 Data size: 46055 Basic stats: 
COMPLETE Column stats: NONE                                                     
                                                                |
|                                                                               
                                                                                
                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
{code}



> Join On clause needs  a semantic check to verify expression is boolean
> ----------------------------------------------------------------------
>
>                 Key: HIVE-12328
>                 URL: https://issues.apache.org/jira/browse/HIVE-12328
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>    Affects Versions: 1.0.0, 1.2.1
>            Reporter: Thejas M Nair
>            Assignee: Pengcheng Xiong
>
> SQL join query fails at query runtime with a poor error message if the 
> expression in the on clause of join is not a boolean.
> Hive should give a proper error message at runtime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to