Attila Jeges has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14665 )

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


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/14665/2/be/src/runtime/datetime-iso-sql-format-tokenizer.cc
File be/src/runtime/datetime-iso-sql-format-tokenizer.cc:

http://gerrit.cloudera.org:8080/#/c/14665/2/be/src/runtime/datetime-iso-sql-format-tokenizer.cc@246
PS2, Line 246: strncmp(*current_pos, "FX", 2)
Not this change, but i think this should be strncasecmp(..) instead. Format 
tokens should be case insesnitive, right?


http://gerrit.cloudera.org:8080/#/c/14665/2/fe/src/main/java/org/apache/impala/analysis/CastExpr.java
File fe/src/main/java/org/apache/impala/analysis/CastExpr.java:

http://gerrit.cloudera.org:8080/#/c/14665/2/fe/src/main/java/org/apache/impala/analysis/CastExpr.java@209
PS2, Line 209: formatClause = " FORMAT '" + castFormat_ + "'";
This still needs to be fixed:

impala> select cast("2010-'02'01" as date FORMAT "YYYY-'MM'DD");
+-----------------------------------------------------+
| cast('2010-\'02\'01' as date format 'yyyy-'mm'dd')  |
+-----------------------------------------------------+
| 2010-02-01                                          |
+-----------------------------------------------------+

The escaping of apostrophes in the FORMAT string in the header is incorrect.



--
To view, visit http://gerrit.cloudera.org:8080/14665
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3310abfa6f3ccbbe4c437846c6dd05791153e6f7
Gerrit-Change-Number: 14665
Gerrit-PatchSet: 2
Gerrit-Owner: Gabor Kaszab <gaborkas...@cloudera.com>
Gerrit-Reviewer: Anonymous Coward (536)
Gerrit-Reviewer: Attila Jeges <atti...@cloudera.com>
Gerrit-Reviewer: Gabor Kaszab <gaborkas...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Norbert Luksa <norbert.lu...@cloudera.com>
Gerrit-Comment-Date: Mon, 18 Nov 2019 11:32:22 +0000
Gerrit-HasComments: Yes

Reply via email to