You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/12/03 21:28:00 UTC

[jira] [Commented] (IMPALA-9131) Use single quotes when printing out FORMAT clause within CAST.

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

ASF subversion and git services commented on IMPALA-9131:
---------------------------------------------------------

Commit 1dc729f2b27da46671cd33903b2ef52a0ae29ebe in impala's branch refs/heads/master from Gabor Kaszab
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=1dc729f ]

IMPALA-9131: Use single quotes around FORMAT clause in CAST

When running a CAST(..FORMAT..) query then the header of the output
shows the value of the FORMAT clause surrounded by double quotes.
However, the SQL way is to use single quotes for strings so this
patch changes the printout from using double quotes to use single
quotes instead.
Additionally, this fixes a bug where it wasn't possible to have a
single quote separator in a format string that was itself surrounded
by single quotes. As a fix the single quote separator can be escaped
by a backslash in this case.
Another additional fix to make the FX modifier case-insensitive.

Change-Id: I3310abfa6f3ccbbe4c437846c6dd05791153e6f7
Reviewed-on: http://gerrit.cloudera.org:8080/14665
Reviewed-by: Attila Jeges <at...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Use single quotes when printing out FORMAT clause within CAST.
> --------------------------------------------------------------
>
>                 Key: IMPALA-9131
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9131
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.3.0
>            Reporter: Gabor Kaszab
>            Assignee: Gabor Kaszab
>            Priority: Major
>
> Here the content of the FORMAT clause is surrounded by double quotes. 
> {code:java}
> select cast('2016/10/10' as date format 'YYYY/MM/DD');
> +------------------------------------------------+
> | cast('2016/10/10' as date format "yyyy/mm/dd") |
> +------------------------------------------------+
> | 2016-10-10                                     |
> +------------------------------------------------+
> {code}
> In order to follow SQL standards this should be surrounded by single quotes regardless of how the user gave the FORMAT clause.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org