[
https://issues.apache.org/jira/browse/FLINK-24414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17439207#comment-17439207
]
Marios Trivyzas commented on FLINK-24414:
-----------------------------------------
Oracle:
{noformat}
select CAST(CAST(12.3456 AS DECIMAL(20,10)) AS VARCHAR(20)) FROM DUAL;{noformat}
{noformat}
12.3456{noformat}
Postgres:
{noformat}
postgres=# select 12.3456::decimal(20,10)::varchar(20);
varchar
---------------
12.3456000000
(1 row){noformat}
MySQL:
{noformat}
select CAST(CAST(12.3456 AS DECIMAL(20,10)) AS CHAR(20));
12.3456000000
{noformat}
> Casting a decimal to a String doesn't do left zero padding
> ----------------------------------------------------------
>
> Key: FLINK-24414
> URL: https://issues.apache.org/jira/browse/FLINK-24414
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: Marios Trivyzas
> Priority: Major
>
> *CAST(a AS STRING)* where *a* is a *DECIMAL(5.3)* with value *9.87* results in
> *9.870* so we only get right 0 padding to fill in the fractional digits.
>
> Postgres and Oracle also don't do left zero padding.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)