You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2020/05/22 13:03:11 UTC

[spark] branch master updated: [SPARK-31790][DOCS] cast(long as timestamp) show different result between Hive and Spark

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 892b600  [SPARK-31790][DOCS] cast(long as timestamp) show different result between Hive and Spark
892b600 is described below

commit 892b600ce3a579ea4acabf8ff378c19830a7d89c
Author: GuoPhilipse <gu...@126.com>
AuthorDate: Fri May 22 22:01:38 2020 +0900

    [SPARK-31790][DOCS] cast(long as timestamp) show different result between Hive and Spark
    
    ### What changes were proposed in this pull request?
    add docs for sql migration-guide
    
    ### Why are the changes needed?
    let user know more about the cast scenarios in which Hive and Spark generate different results
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    no need to test
    
    Closes #28605 from GuoPhilipse/spark-docs.
    
    Lead-authored-by: GuoPhilipse <gu...@126.com>
    Co-authored-by: GuoPhilipse <46...@users.noreply.github.com>
    Signed-off-by: HyukjinKwon <gu...@apache.org>
---
 docs/sql-migration-guide.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/sql-migration-guide.md b/docs/sql-migration-guide.md
index 96f2c5d..2272c90 100644
--- a/docs/sql-migration-guide.md
+++ b/docs/sql-migration-guide.md
@@ -961,3 +961,4 @@ Below are the scenarios in which Hive and Spark generate different results:
 * `SQRT(n)` If n < 0, Hive returns null, Spark SQL returns NaN.
 * `ACOS(n)` If n < -1 or n > 1, Hive returns null, Spark SQL returns NaN.
 * `ASIN(n)` If n < -1 or n > 1, Hive returns null, Spark SQL returns NaN.
+* `CAST(n AS TIMESTAMP)` If n is integral numbers, Hive treats n as milliseconds, Spark SQL treats n as seconds.


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