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

[jira] [Updated] (SPARK-28137) Data Type Formatting Functions

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

Yuming Wang updated SPARK-28137:
--------------------------------
    Description: 
||Function||Return Type||Description||Example||
|{{to_char(}}{{timestamp}}{{, }}{{text}}{{)}}|{{text}}|convert time stamp to string|{{to_char(current_timestamp, 'HH12:MI:SS')}}|
|{{to_char(}}{{interval}}{{, }}{{text}}{{)}}|{{text}}|convert interval to string|{{to_char(interval '15h 2m 12s', 'HH24:MI:SS')}}|
|{{to_char(}}{{int}}{{, }}{{text}}{{)}}|{{text}}|convert integer to string|{{to_char(125, '999')}}|
|{{to_char}}{{(}}{{double precision}}{{, }}{{text}}{{)}}|{{text}}|convert real/double precision to string|{{to_char(125.8::real, '999D9')}}|
|{{to_char(}}{{numeric}}{{, }}{{text}}{{)}}|{{text}}|convert numeric to string|{{to_char(-125.8, '999D99S')}}|
|{{to_number(}}{{text}}{{, }}{{text}}{{)}}|{{numeric}}|convert string to numeric|{{to_number('12,454.8-', '99G999D9S')}}|


https://www.postgresql.org/docs/12/functions-formatting.html

  was:
||Function||Return Type||Description||Example||
|{{to_char(}}{{timestamp}}{{, }}{{text}}{{)}}|{{text}}|convert time stamp to string|{{to_char(current_timestamp, 'HH12:MI:SS')}}|
|{{to_char(}}{{interval}}{{, }}{{text}}{{)}}|{{text}}|convert interval to string|{{to_char(interval '15h 2m 12s', 'HH24:MI:SS')}}|
|{{to_char(}}{{int}}{{, }}{{text}}{{)}}|{{text}}|convert integer to string|{{to_char(125, '999')}}|
|{{to_char}}{{(}}{{double precision}}{{, }}{{text}}{{)}}|{{text}}|convert real/double precision to string|{{to_char(125.8::real, '999D9')}}|
|{{to_char(}}{{numeric}}{{, }}{{text}}{{)}}|{{text}}|convert numeric to string|{{to_char(-125.8, '999D99S')}}|
|{{to_date(}}{{text}}{{, }}{{text}}{{)}}|{{date}}|convert string to date|{{to_date('05 Dec 2000', 'DD Mon YYYY')}}|
|{{to_number(}}{{text}}{{, }}{{text}}{{)}}|{{numeric}}|convert string to numeric|{{to_number('12,454.8-', '99G999D9S')}}|
|{{to_timestamp(}}{{text}}{{, }}{{text}}{{)}}|{{timestamp with time zone}}|convert string to time stamp|{{to_timestamp('05 Dec 2000', 'DD Mon YYYY')}}|


https://www.postgresql.org/docs/12/functions-formatting.html


> Data Type Formatting Functions
> ------------------------------
>
>                 Key: SPARK-28137
>                 URL: https://issues.apache.org/jira/browse/SPARK-28137
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> ||Function||Return Type||Description||Example||
> |{{to_char(}}{{timestamp}}{{, }}{{text}}{{)}}|{{text}}|convert time stamp to string|{{to_char(current_timestamp, 'HH12:MI:SS')}}|
> |{{to_char(}}{{interval}}{{, }}{{text}}{{)}}|{{text}}|convert interval to string|{{to_char(interval '15h 2m 12s', 'HH24:MI:SS')}}|
> |{{to_char(}}{{int}}{{, }}{{text}}{{)}}|{{text}}|convert integer to string|{{to_char(125, '999')}}|
> |{{to_char}}{{(}}{{double precision}}{{, }}{{text}}{{)}}|{{text}}|convert real/double precision to string|{{to_char(125.8::real, '999D9')}}|
> |{{to_char(}}{{numeric}}{{, }}{{text}}{{)}}|{{text}}|convert numeric to string|{{to_char(-125.8, '999D99S')}}|
> |{{to_number(}}{{text}}{{, }}{{text}}{{)}}|{{numeric}}|convert string to numeric|{{to_number('12,454.8-', '99G999D9S')}}|
> https://www.postgresql.org/docs/12/functions-formatting.html



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