cloud-fan commented on code in PR #49340: URL: https://github.com/apache/spark/pull/49340#discussion_r1907062737
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala: ########## @@ -103,8 +106,10 @@ object TypeCoercion extends TypeCoercionBase { // [SPARK-50060] If a binary operation contains two collated string types with different // collation IDs, we can't decide which collation ID the result should have. case (st1: StringType, st2: StringType) if st1.collationId != st2.collationId => None - case (st: StringType, t2: AtomicType) if t2 != BinaryType && t2 != BooleanType => Some(st) - case (t1: AtomicType, st: StringType) if t1 != BinaryType && t1 != BooleanType => Some(st) + case (st: StringType, t2: AtomicType) if t2 != BinaryType && t2 != BooleanType && + StringHelper.isPlainString(st) => Some(st) + case (t1: AtomicType, st: StringType) if t1 != BinaryType && t1 != BooleanType && + StringHelper.isPlainString(st) => Some(st) Review Comment: if `col` is varchar type, `if(cond, col, 1)` is not allowed. Is it really what we want? It's a breaking change because previously we rewrite char/varchar to string type and `if(cond, col, 1)` is allowed. -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org