turboFei commented on a change in pull request #26485: [SPARK-29860][SQL] Fix dataType mismatch issue for InSubquery. URL: https://github.com/apache/spark/pull/26485#discussion_r353577420
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala ########## @@ -472,9 +472,12 @@ object TypeCoercion { // RHS is the subquery output. val rhs = sub.output - val commonTypes = lhs.zip(rhs).flatMap { case (l, r) => - findCommonTypeForBinaryComparison(l.dataType, r.dataType, conf) - .orElse(findTightestCommonType(l.dataType, r.dataType)) + val commonTypes = lhs.zip(rhs).flatMap { + case (l, r) if !l.dataType.isInstanceOf[DecimalType] && + !r.dataType.isInstanceOf[DecimalType] => + findCommonTypeForBinaryComparison(l.dataType, r.dataType, conf) + .orElse(findTightestCommonType(l.dataType, r.dataType)) + case (l, r) => findWiderTypeForDecimal(l.dataType, r.dataType) Review comment: thanks for your suggestion. To unify the logic of `in` and `inSubquery` mentioned by cloud-fan, I simply call `findWiderTypeForTwo` here. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org