cloud-fan commented on a change in pull request #27150: SPARK-30471: Fix issue
when comparing String and IntegerType
URL: https://github.com/apache/spark/pull/27150#discussion_r365222172
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
##########
@@ -142,6 +142,8 @@ object TypeCoercion {
case (n: DecimalType, s: StringType) => Some(DoubleType)
case (s: StringType, n: DecimalType) => Some(DoubleType)
+ case (l: StringType, r: IntegerType) => Some(DoubleType)
Review comment:
Decimal(38, 1) doesn't work for `'1.23' = 1`.
I don't think there is perfect solution here. Maybe we should follow pgsql
and force users to add cast, when ansi mode is on.
----------------------------------------------------------------
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]