Github user liutang123 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19692#discussion_r150726583
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -137,6 +137,8 @@ object TypeCoercion {
case (DateType, TimestampType) => Some(StringType)
case (StringType, NullType) => Some(StringType)
case (NullType, StringType) => Some(StringType)
+ case (n: NumericType, s: StringType) => Some(DoubleType)
+ case (s: StringType, n: NumericType) => Some(DoubleType)
--- End diff --
Because `select '1.1' >1` returns false, I prefer casting all NumericType
to double like hive.
Therefore, casting decimal to double looks better for me.
But, in our cluster, many users write SQL like `select '1.1' > 1`, this
compatibility brings great difficulties to transferring hive task to spark
task. So, don't we really need to think about casting all NumericType to double?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]