cloud-fan commented on a change in pull request #35478:
URL: https://github.com/apache/spark/pull/35478#discussion_r803711080



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala
##########
@@ -171,17 +183,23 @@ object AnsiTypeCoercion extends TypeCoercionBase {
 
       // This type coercion system will allow implicit converting String type 
literals as other
       // primitive types, in case of breaking too many existing Spark SQL 
queries.
-      case (StringType, a: AtomicType) if isInputFoldable =>
+      case (StringType, a: AtomicType) =>
         Some(a)
 
       // If the target type is any Numeric type, convert the String type 
literal as Double type.
-      case (StringType, NumericType) if isInputFoldable =>
+      case (StringType, NumericType) =>
         Some(DoubleType)
 
-      // If the target type is any Decimal type, convert the String type 
literal as Double type.
-      case (StringType, DecimalType) if isInputFoldable =>
+      // If the target type is any Decimal type, convert the String type 
literal as the default
+      // Decimal type.
+      case (StringType, DecimalType) =>
         Some(DecimalType.SYSTEM_DEFAULT)
 
+      // If the target type is any Decimal type, convert the String type 
literal as the default

Review comment:
       ```suggestion
         // If the target type is any timestamp type, convert the String type 
literal as the default
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to