[ 
https://issues.apache.org/jira/browse/FLINK-28620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736834#comment-17736834
 ] 

Jark Wu commented on FLINK-28620:
---------------------------------

Thank you for the validation. I will close it then. 

> SQL Client doesn't properly print values of INTERVAL type
> ---------------------------------------------------------
>
>                 Key: FLINK-28620
>                 URL: https://issues.apache.org/jira/browse/FLINK-28620
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Client
>            Reporter: Jark Wu
>            Assignee: Jark Wu
>            Priority: Major
>             Fix For: 1.18.0
>
>
> The display of values of interval type should follow the CAST rules. However, 
> currently, SQL Client prints it using {{Period.toString()}} and 
> {{Duration.toString()}} which is not SQL standard compliant. 
> {code}
> Flink SQL> select interval '9-11' year to month;
> +--------+
> | EXPR$0 |
> +--------+
> |  P119M |
> +--------+
> 1 row in set
> Flink SQL> select cast(interval '9-11' year to month as varchar);
> +--------+
> | EXPR$0 |
> +--------+
> |  +9-11 |
> +--------+
> 1 row in set
> Flink SQL> select interval '2 1:2:3' day to second;
> +-----------+
> |    EXPR$0 |
> +-----------+
> | PT49H2M3S |
> +-----------+
> 1 row in set
> Flink SQL> select cast(interval '2 1:2:3' day to second as varchar);
> +-----------------+
> |          EXPR$0 |
> +-----------------+
> | +2 01:02:03.000 |
> +-----------------+
> 1 row in set
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to