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_r290052428
 
 

 ##########
 File path: ql/src/test/results/clientpositive/perf/spark/query80.q.out
 ##########
 @@ -782,7 +782,7 @@ STAGE PLANS:
                     1 Map 33
                   Statistics: Num rows: 231917759 Data size: 31534108438 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col15 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
+                    expressions: _col15 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (CAST( 0 AS 
decimal(7,2))) END (type: decimal(7,2)), (_col6 - CASE WHEN (_col10 is not 
null) THEN (_col10) ELSE (CAST( 0 AS decimal(7,2))) END) (type: decimal(8,2))
 
 Review comment:
   change to 7,2 is due to the `_col9`'s type which is decimal(7,2). The whole 
expression's type is determined to be decimal(8,2) for some reason, but this 
change is in line with previous logic where even though internal type was 
decimal(12,2) whole case expr was decimal(13,2). In short type inference looks 
to be more tight now.

----------------------------------------------------------------
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