cloud-fan commented on a change in pull request #22038: [SPARK-25056][SQL]
Unify the InConversion and BinaryComparison behavior
URL: https://github.com/apache/spark/pull/22038#discussion_r346201514
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
##########
@@ -495,9 +495,12 @@ object TypeCoercion {
i
}
- case i @ In(a, b) if b.exists(_.dataType != a.dataType) =>
- findWiderCommonType(i.children.map(_.dataType)) match {
- case Some(finalDataType) => i.withNewChildren(i.children.map(Cast(_,
finalDataType)))
+ case i @ In(value, list) if list.exists(_.dataType != value.dataType) =>
+ findWiderCommonType(list.map(_.dataType)) match {
Review comment:
are you sure this is the behavior of binary comparison? It seems we should
call `findTightestCommonType` and then `findCommonTypeForBinaryComparison`
----------------------------------------------------------------
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]