You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2019/03/02 12:27:00 UTC

[jira] [Assigned] (SPARK-27031) Avoid double formatting in timestampToString

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

Apache Spark reassigned SPARK-27031:
------------------------------------

    Assignee:     (was: Apache Spark)

> Avoid double formatting in timestampToString
> --------------------------------------------
>
>                 Key: SPARK-27031
>                 URL: https://issues.apache.org/jira/browse/SPARK-27031
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Maxim Gekk
>            Priority: Minor
>
> The method DateTimeUtils.timestampToString performs converting of its input to string twice:
> - First time by converting microseconds to java.sql.Timestamp and toString: https://github.com/apache/spark/blob/8e5f9995cad409799f3646b3d03761a771ea1664/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala#L103
> - Second time by using provided formatter: https://github.com/apache/spark/blob/8e5f9995cad409799f3646b3d03761a771ea1664/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala#L104
> This could be avoided by using specialised TimestampFormatter. 



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