You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/14 10:23:32 UTC

[GitHub] [spark] manuzhang commented on a change in pull request #21586: [SPARK-24586][SQL] Upcast should not allow casting from string to other types

manuzhang commented on a change in pull request #21586:
URL: https://github.com/apache/spark/pull/21586#discussion_r805696840



##########
File path: docs/sql-migration-guide-upgrade.md
##########
@@ -138,6 +138,8 @@ license: |
     need to specify a value with units like "30s" now, to avoid being interpreted as milliseconds; otherwise, 
     the extremely short interval that results will likely cause applications to fail.
 
+  - When turning a Dataset to another Dataset, Spark will up cast the fields in the original Dataset to the type of corresponding fields in the target DataSet. In version 2.4 and earlier, this up cast is not very strict, e.g. `Seq("str").toDS.as[Int]` fails, but `Seq("str").toDS.as[Boolean]` works and throw NPE during execution. In Spark 3.0, the up cast is stricter and turning String into something else is not allowed, i.e. `Seq("str").toDS.as[Boolean]` will fail during analysis.

Review comment:
       @cloud-fan is it on purpose not to mention setting `spark.sql.legacy.looseUpcast=true` to preserve old behavior?




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org