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

Yuming Wang updated SPARK-28516:
--------------------------------
    Description: 
Currently, Spark does not have support for `to_char`. PgSQL, however, 
[does|[https://www.postgresql.org/docs/12/functions-formatting.html]]:

Query example: 
{code:sql}
SELECT to_char(SUM(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 
FOLLOWING),'999999999999999999999D9')
{code}


||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')}}|


  was:
Currently, Spark does not have support for `to_char`. PgSQL, however, 
[does|[https://www.postgresql.org/docs/9.6/functions-formatting.html]]:

Query example: 

 SELECT to_char(SUM(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 
FOLLOWING),'999999999999999999999D9')


> Data Type Formatting Functions: `to_char`
> -----------------------------------------
>
>                 Key: SPARK-28516
>                 URL: https://issues.apache.org/jira/browse/SPARK-28516
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Dylan Guedes
>            Priority: Major
>
> Currently, Spark does not have support for `to_char`. PgSQL, however, 
> [does|[https://www.postgresql.org/docs/12/functions-formatting.html]]:
> Query example: 
> {code:sql}
> SELECT to_char(SUM(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 
> FOLLOWING),'999999999999999999999D9')
> {code}
> ||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')}}|



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to