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

Change subject: IMPALA-8704: ISO:SQL:2016 datetime patterns - Milestone 2
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/14291/3/tests/query_test/test_cast_with_format.py
File tests/query_test/test_cast_with_format.py:

http://gerrit.cloudera.org:8080/#/c/14291/3/tests/query_test/test_cast_with_format.py@724
PS3, Line 724: format 'YYYY-"some \ text"MM-DD')
I'm confused about the usage of backslash in this format string and the format 
string in L727.

Is it used for a literal backslash character or for escaping the space 
character that follows it?

1. For instance a slightly modified select:

select cast("1985- some  text12-05" as date format 'YYYY-"some \ text"MM-DD');

Returns : 1985-12-05
Which makes me think that the backslash in the format string escapes the space.

2. On the other hand the select in L726

select cast(cast("1985-12-06" as date) as string format 'YYYY-"some \ 
text"MM-DD')

Returns: 1985-some \ text12-06
Which makes me think that the backslash in the format string is supposed to be 
taken literally.


http://gerrit.cloudera.org:8080/#/c/14291/3/tests/query_test/test_cast_with_format.py@730
PS3, Line 730: '
Probably the apostrophe can be removed for clarity. I assume the - separator in 
the format string matches -' in the input string.


http://gerrit.cloudera.org:8080/#/c/14291/3/tests/query_test/test_cast_with_format.py@731
PS3, Line 731: YYYY-"\some text"MM-DD')
Again, the backslash is used here to escape the s character right?

However the backslash in the format string in L714 is interpreted literally.

It could be interesting to try running these with Hive and check how it handles 
backslashes.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I30d2f6656054371476aaa8bd0d51f572b9369855
Gerrit-Change-Number: 14291
Gerrit-PatchSet: 3
Gerrit-Owner: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Attila Jeges <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Comment-Date: Thu, 03 Oct 2019 15:15:20 +0000
Gerrit-HasComments: Yes

Reply via email to