spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Stratton (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-16384) FROM_UNIXTIME reports incorrect days
Date Tue, 05 Jul 2016 20:20:11 GMT
Frank Stratton created SPARK-16384:
--------------------------------------

             Summary: FROM_UNIXTIME reports incorrect days
                 Key: SPARK-16384
                 URL: https://issues.apache.org/jira/browse/SPARK-16384
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.6.2, 1.6.1, 2.0.0
            Reporter: Frank Stratton


Timestamps between 2015-12-27 and 2015-12-31 are reported in the incorrect year (2016-12-*):

{quote}
results = sqlContext.sql("SELECT FROM_UNIXTIME(1451088000, 'YYYY-MM-dd')")   # 2015-12-27
print results.collect()

results = sqlContext.sql("SELECT FROM_UNIXTIME(1451174400, 'YYYY-MM-dd')")   # 2015-12-27
print results.collect()

results = sqlContext.sql("SELECT FROM_UNIXTIME(1451260800, 'YYYY-MM-dd')")   # 2015-12-28
print results.collect()

results = sqlContext.sql("SELECT FROM_UNIXTIME(1451347200, 'YYYY-MM-dd')")   # 2015-12-29
print results.collect()
{quote}

outputs:

{quote}
[Row(_c0=u'2015-12-26')]
[Row(_c0=u'2016-12-27')]
[Row(_c0=u'2016-12-28')]
[Row(_c0=u'2016-12-29')]
{quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message