You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tim Armstrong (JIRA)" <ji...@apache.org> on 2018/03/09 01:50:00 UTC
[jira] [Created] (IMPALA-6630) Test casting from timestamp to
string with leading and trailing whitespace
Tim Armstrong created IMPALA-6630:
-------------------------------------
Summary: Test casting from timestamp to string with leading and trailing whitespace
Key: IMPALA-6630
URL: https://issues.apache.org/jira/browse/IMPALA-6630
Project: IMPALA
Issue Type: Test
Components: Backend
Affects Versions: Impala 3.0, Impala 2.12.0
Reporter: Tim Armstrong
Assignee: Vincent Tran
There appears to be an undocumented feature of timestamp casts where leading and trailing whitespace is ignored, at least under some circumstances. This does not seem harmful, but we don't seem to have any test coverage for this behaviour. We should add some tests to ensure that this code path is tested and that we don't accidentally change the behaviour.
{noformat}
> select cast('1999-12-01 01:02:03 \t\r\n' as timestamp);
Query: select cast('1999-12-01 01:02:03 \t\r\n' as timestamp)
Query submitted at: 2018-03-08 17:42:35 (Coordinator: http://tarmstrong-box:25000)
Query progress can be monitored at: http://tarmstrong-box:25000/query_plan?query_id=f545755da7e4f8bd:725fa87b00000000
+-------------------------------------------------+
| cast('1999-12-01 01:02:03 \t\r\n' as timestamp) |
+-------------------------------------------------+
| 1999-12-01 01:02:03 |
+-------------------------------------------------+
[localhost:21000] > select cast(' \t1999-12-01 01:02:03 ' as timestamp);
Query: select cast(' \t1999-12-01 01:02:03 ' as timestamp)
Query submitted at: 2018-03-08 17:46:03 (Coordinator: http://tarmstrong-box:25000)
Query progress can be monitored at: http://tarmstrong-box:25000/query_plan?query_id=4c4082e3364056a7:6a3e830e00000000
+----------------------------------------------+
| cast(' \t1999-12-01 01:02:03 ' as timestamp) |
+----------------------------------------------+
| 1999-12-01 01:02:03 |
+----------------------------------------------+
Fetched 1 row(s) in 0.01s
{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)