This is an automated email from the ASF dual-hosted git repository.
wenchen pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new 5198c0c [SPARK-35581][SPARK-36567][SQL][DOCS][FOLLOWUP] Update the
SQL migration guide about foldable special datetime values
5198c0c is described below
commit 5198c0c3163dadac1a8eab5c4dc46fd5bb508e35
Author: Max Gekk <[email protected]>
AuthorDate: Thu Aug 26 10:02:00 2021 +0800
[SPARK-35581][SPARK-36567][SQL][DOCS][FOLLOWUP] Update the SQL migration
guide about foldable special datetime values
### What changes were proposed in this pull request?
In the PR, I propose to update an existing item in the SQL migration guide,
and mention that Spark 3.2 supports foldable special datetime values as well.
<img width="1292" alt="Screenshot 2021-08-25 at 23 29 51"
src="https://user-images.githubusercontent.com/1580697/130860184-27f0ba56-6c2d-4a5a-91a8-195f2f8aa5da.png">
### Why are the changes needed?
To inform users about actual Spark SQL behavior introduced by
https://github.com/apache/spark/pull/33816
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
By generating docs, and checking results manually.
Closes #33840 from MaxGekk/special-datetime-cast-migr-guide.
Authored-by: Max Gekk <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit c4e739fb4bba6a764062a756035a27fdca4f72e5)
Signed-off-by: Wenchen Fan <[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 d2813a8..bdb4fe0 100644
--- a/docs/sql-migration-guide.md
+++ b/docs/sql-migration-guide.md
@@ -93,7 +93,7 @@ license: |
- In Spark 3.2, `CREATE TABLE AS SELECT` with non-empty `LOCATION` will
throw `AnalysisException`. To restore the behavior before Spark 3.2, you can
set `spark.sql.legacy.allowNonEmptyLocationInCTAS` to `true`.
- - In Spark 3.2, special datetime values such as `epoch`, `today`,
`yesterday`, `tomorrow`, and `now` are supported in typed literals only, for
instance, `select timestamp'now'`. In Spark 3.1 and 3.0, such special values
are supported in any casts of strings to dates/timestamps. To keep these
special values as dates/timestamps in Spark 3.1 and 3.0, you should replace
them manually, e.g. `if (c in ('now', 'today'), current_date(), cast(c as
date))`.
+ - In Spark 3.2, special datetime values such as `epoch`, `today`,
`yesterday`, `tomorrow`, and `now` are supported in typed literals or in cast
of foldable strings only, for instance, `select timestamp'now'` or `select
cast('today' as date)`. In Spark 3.1 and 3.0, such special values are supported
in any casts of strings to dates/timestamps. To keep these special values as
dates/timestamps in Spark 3.1 and 3.0, you should replace them manually, e.g.
`if (c in ('now', 'today'), current_ [...]
- In Spark 3.2, `FloatType` is mapped to `FLOAT` in MySQL. Prior to this, it
used to be mapped to `REAL`, which is by default a synonym to `DOUBLE
PRECISION` in MySQL.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]