vineetgarg02 commented on a change in pull request #656: HIVE-21742 : 
Vectorization: CASE result type casting
URL: https://github.com/apache/hive/pull/656#discussion_r290017784
 
 

 ##########
 File path: ql/src/test/results/clientpositive/infer_join_preds.q.out
 ##########
 @@ -1187,7 +1187,7 @@ STAGE PLANS:
               predicate: prid is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 668 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
-                expressions: idp_warehouse_id (type: bigint), prid (type: 
bigint), concat(CAST( CASE WHEN (prid is null) THEN (1) ELSE (prid) END AS 
STRING), ',', CASE WHEN (prtimesheetid is null) THEN (1) ELSE (prtimesheetid) 
END, ',', CASE WHEN (prassignmentid is null) THEN (1) ELSE (prassignmentid) 
END, ',', CASE WHEN (prchargecodeid is null) THEN (1) ELSE (prchargecodeid) 
END, ',', CASE WHEN (prtypecodeid is null) THEN ('') ELSE (CAST( prtypecodeid 
AS STRING)) END, ',', CASE WHEN (practsum is null) THEN (1) ELSE (practsum) 
END, ',', CASE WHEN (prsequence is null) THEN (1) ELSE (prsequence) END, ',', 
CASE WHEN (length(prmodby) is null) THEN ('') ELSE (prmodby) END, ',', CASE 
WHEN (prmodtime is null) THEN (TIMESTAMP'2017-12-08 00:00:00') ELSE (prmodtime) 
END, ',', CASE WHEN (prrmexported is null) THEN (1) ELSE (prrmexported) END, 
',', CASE WHEN (prrmckdel is null) THEN (1) ELSE (prrmckdel) END, ',', CASE 
WHEN (slice_status is null) THEN (1) ELSE (slice_status) END, ',', CASE WHEN 
(role_id is null) THEN (1) ELSE (role_id) END, ',', CASE WHEN 
(length(user_lov1) is null) THEN ('') ELSE (user_lov1) END, ',', CASE WHEN 
(length(user_lov2) is null) THEN ('') ELSE (user_lov2) END, ',', CASE WHEN 
(incident_id is null) THEN (1) ELSE (incident_id) END, ',', CASE WHEN 
(incident_investment_id is null) THEN (1) ELSE (incident_investment_id) END, 
',', CASE WHEN (odf_ss_actuals is null) THEN (1) ELSE (odf_ss_actuals) END) 
(type: string)
+                expressions: idp_warehouse_id (type: bigint), prid (type: 
bigint), concat(CAST( CASE WHEN (prid is null) THEN (1L) ELSE (prid) END AS 
STRING), ',', CASE WHEN (prtimesheetid is null) THEN (1L) ELSE (prtimesheetid) 
END, ',', CASE WHEN (prassignmentid is null) THEN (1L) ELSE (prassignmentid) 
END, ',', CASE WHEN (prchargecodeid is null) THEN (1L) ELSE (prchargecodeid) 
END, ',', CASE WHEN (prtypecodeid is null) THEN ('') ELSE (CAST( prtypecodeid 
AS STRING)) END, ',', CASE WHEN (practsum is null) THEN (CAST( 1 AS 
decimal(38,20))) ELSE (practsum) END, ',', CASE WHEN (prsequence is null) THEN 
(1L) ELSE (prsequence) END, ',', CASE WHEN (length(prmodby) is null) THEN ('') 
ELSE (CAST( prmodby AS STRING)) END, ',', CASE WHEN (prmodtime is null) THEN 
(TIMESTAMP'2017-12-08 00:00:00') ELSE (prmodtime) END, ',', CASE WHEN 
(prrmexported is null) THEN (1L) ELSE (prrmexported) END, ',', CASE WHEN 
(prrmckdel is null) THEN (1L) ELSE (prrmckdel) END, ',', CASE WHEN 
(slice_status is null) THEN (1) ELSE (slice_status) END, ',', CASE WHEN 
(role_id is null) THEN (1L) ELSE (role_id) END, ',', CASE WHEN 
(length(user_lov1) is null) THEN ('') ELSE (CAST( user_lov1 AS STRING)) END, 
',', CASE WHEN (length(user_lov2) is null) THEN ('') ELSE (CAST( user_lov2 AS 
STRING)) END, ',', CASE WHEN (incident_id is null) THEN (1L) ELSE (incident_id) 
END, ',', CASE WHEN (incident_investment_id is null) THEN (1L) ELSE 
(incident_investment_id) END, ',', CASE WHEN (odf_ss_actuals is null) THEN (1L) 
ELSE (odf_ss_actuals) END) (type: string)
 
 Review comment:
   Yes. The type of whole case expression is determined to be `bigint` as a 
result `1` is cast to long.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to