You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "David Thomasson (JIRA)" <ji...@apache.org> on 2019/01/01 21:07:00 UTC

[jira] [Updated] (SPARK-26515) SQL date_format function for 2018-12-30 returns 2019 date

     [ https://issues.apache.org/jira/browse/SPARK-26515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Thomasson updated SPARK-26515:
------------------------------------
    Description: 
When running a query that formats the date '*2018*-12-30 03:16:04' to 'YYYY-MM-dd HH' the value returned is *2019*-12-30 03.

 

'*2018*-12-31 03:16:04' returns *2019*-12-31 03

'*2018*-12-29 03:16:04' has no issues.

'*2019*-12-29 03:16:04'  returns *2020*-12-31 03

'*2017*-12-30 03:16:04' has no issues.

 

Example:

sqlContext.sql("SELECT date_format('2018-12-30 03:16:04', 'YYYY-MM-dd HH') FROM example_df limit 1" ).show()

 

 

 

  was:
When running a query that formats the date '*2018*-12-30 03:16:04' to 'YYYY-MM-dd HH' the value returned is *2019*-12-30 03.

 

'*2018*-12-*31* 03:16:04' returns *2019*-12-31 03

'*2018*-12-*29* 03:16:04' has no issues.

'*2019*-12-*29* 03:16:04'  returns *2020*-12-31 03

'*2017*-12-*30* 03:16:04' has no issues.

 

Example:

sqlContext.sql("SELECT date_format('2018-12-30 03:16:04', 'YYYY-MM-dd HH') FROM example_df limit 1" ).show()

 

 

 


> SQL date_format function for 2018-12-30 returns 2019 date
> ---------------------------------------------------------
>
>                 Key: SPARK-26515
>                 URL: https://issues.apache.org/jira/browse/SPARK-26515
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>         Environment: Ran in Zeppelin 0.8.0 with Spark 2.4.0
>            Reporter: David Thomasson
>            Priority: Major
>
> When running a query that formats the date '*2018*-12-30 03:16:04' to 'YYYY-MM-dd HH' the value returned is *2019*-12-30 03.
>  
> '*2018*-12-31 03:16:04' returns *2019*-12-31 03
> '*2018*-12-29 03:16:04' has no issues.
> '*2019*-12-29 03:16:04'  returns *2020*-12-31 03
> '*2017*-12-30 03:16:04' has no issues.
>  
> Example:
> sqlContext.sql("SELECT date_format('2018-12-30 03:16:04', 'YYYY-MM-dd HH') FROM example_df limit 1" ).show()
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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