Details
-
Test
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 3.0, Impala 2.12.0
-
None
-
ghx-label-5
Description
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.
> 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