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 2021/12/01 06:58:33 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #34766: [SPARK-37513][SQL][DOC] Additive expression of date and interval returns different data type between Spark3.2 and Spark3.1

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



##########
File path: docs/sql-migration-guide.md
##########
@@ -133,6 +133,8 @@ license: |
 
   - In Spark 3.2, create/alter view will fail if the input query output columns contain auto-generated alias. This is necessary to make sure the query output column names are stable across different spark versions. To restore the behavior before Spark 3.2, set `spark.sql.legacy.allowAutoGeneratedAliasForView` to `true`.
 
+  - In Spark 3.2, additive expression of date and interval like `date '2011-11-11' + interval 12 hours` will return timestamp. In Spark 3.1 and earlier, the same expression will return date. To restore the behavior before Spark 3.2, you can use `cast` to convert timestamp as date.

Review comment:
       ```suggestion
     - In Spark 3.2, date +/- interval with only day-time fields such as `date '2011-11-11' + interval 12 hours` returns timestamp. In Spark 3.1 and earlier, the same expression returns date. To restore the behavior before Spark 3.2, you can use `cast` to convert timestamp as date.
   ```




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