This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new d1ca91c [SPARK-38211][SQL][DOCS] Add SQL migration guide on restoring
loose upcast from string to other types
d1ca91c is described below
commit d1ca91c0c3d0e020fc65db2ec4915b7465626e6b
Author: tianlzhang <[email protected]>
AuthorDate: Tue Feb 15 12:52:37 2022 +0900
[SPARK-38211][SQL][DOCS] Add SQL migration guide on restoring loose upcast
from string to other types
### What changes were proposed in this pull request?
Add doc on restoring loose upcast from string to other types (behavior
before 2.4.1) to SQL migration guide.
### Why are the changes needed?
After [SPARK-24586](https://issues.apache.org/jira/browse/SPARK-24586),
loose upcasting from string to other types are not allowed by default. User can
still set `spark.sql.legacy.looseUpcast=true` to restore old behavior but it's
not documented.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Only doc change.
Closes #35519 from manuzhang/spark-38211.
Authored-by: tianlzhang <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit 78514e3149bc43b2485e4be0ab982601a842600b)
Signed-off-by: Hyukjin Kwon <[email protected]>
---
docs/sql-migration-guide.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/sql-migration-guide.md b/docs/sql-migration-guide.md
index 7a905bf..b3a1e77 100644
--- a/docs/sql-migration-guide.md
+++ b/docs/sql-migration-guide.md
@@ -299,7 +299,7 @@ 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.
+ - 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. To res [...]
## Upgrading from Spark SQL 2.3 to 2.4
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]