[ https://issues.apache.org/jira/browse/HIVE-14251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15386015#comment-15386015 ]
Aihua Xu commented on HIVE-14251: --------------------------------- Thanks for reviewing. Originally I thought of reusing, but later I decided not to and gave a new name to completely differentiate from implicitConvertible(). implicitConvertible() is used in the data comparison and isCommonTypeOf() is used in union all operator. In fact, they could have different behaviors, I guess, not only for string and double, but for any types from different groups, seems they may or may have opposite result. e.g., for void and string, I'm not sure what should return for comparison; but for union, seems reasonable to return string. If it's numeric types, like int, double, then both should return double. Right now I only changed the union behavior of string and double and haven't touched the others. I feel we need to evaluate them as well but I will defer when we have the complains. > Union All of different types resolves to incorrect data > ------------------------------------------------------- > > Key: HIVE-14251 > URL: https://issues.apache.org/jira/browse/HIVE-14251 > Project: Hive > Issue Type: Bug > Components: Query Planning > Affects Versions: 2.0.0 > Reporter: Aihua Xu > Assignee: Aihua Xu > Attachments: HIVE-14251.1.patch > > > create table src(c1 date, c2 int, c3 double); > insert into src values ('2016-01-01',5,1.25); > select * from > (select c1 from src union all > select c2 from src union all > select c3 from src) t; > It will return NULL for the c1 values. Seems the common data type is resolved > to the last c3 which is double. -- This message was sent by Atlassian JIRA (v6.3.4#6332)