Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/18853#discussion_r139465565
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -352,11 +374,16 @@ object TypeCoercion {
p.makeCopy(Array(Cast(left, TimestampType), right))
case p @ Equality(left @ TimestampType(), right @ StringType()) =>
p.makeCopy(Array(left, Cast(right, TimestampType)))
-
case p @ BinaryComparison(left, right)
- if findCommonTypeForBinaryComparison(left.dataType,
right.dataType).isDefined =>
+ if !plan.conf.binaryComparisonCompatibleWithHive &&
+ findCommonTypeForBinaryComparison(left.dataType,
right.dataType).isDefined =>
val commonType = findCommonTypeForBinaryComparison(left.dataType,
right.dataType).get
p.makeCopy(Array(castExpr(left, commonType), castExpr(right,
commonType)))
+ case p @ BinaryComparison(left, right)
+ if plan.conf.binaryComparisonCompatibleWithHive &&
--- End diff --
This is hard to maintain and debug. Instead of mixing them together, could
you separate it from the current rule Spark uses?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]