mirror of
https://github.com/apache/impala.git
synced 2025-12-30 12:02:10 -05:00
This change allows casting of a string in 'lazy' date/time format to timestamp. The supported lazy date formats are: yyyy-[M]M-[d]d yyyy-[M]M-[d]d [H]H:[m]m:[s]s[.SSSSSSSSS] [H]H:[m]m:[s]s[.SSSSSSSSS] We will incur a SCAN performance penalty (approximately 1/2 TotalReadThroughput) when the string is in one of these lazy date/time format. Testing: Benchmarked the performance consequence by executing this SQL on a private build over 3.8 billion rows: select min(cast (time_string as timestamp)) from private.impala_5315 Added tests for valid and invalid date/time format strings in expr-test.cc to be inline with existing tests for CAST() function. Added end-to-end tests into exprs.test and select-lazy-timestamp.test to exercise the new function within the context of a query. Added tests to exercise the leading and trailing white space trimming behaviour in default and lazy date/time string format (IMPALA-6630). Change-Id: Ib9a184a09d7e7783f04d47588537612c2ecec28f Reviewed-on: http://gerrit.cloudera.org:8080/7009 Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com> Tested-by: Impala Public Jenkins
174 B
174 B
| 1 | 2001-1-2 |
|---|---|
| 2 | 2001-1-02 |
| 3 | 2001-01-2 |
| 4 | 1:6:8 |
| 5 | 01:6:8 |
| 6 | 1:06:8 |
| 7 | 1:6:08 |
| 8 | 1:6:8.123456789101112 |
| 9 | 1:6:8.123456789 |
| 10 | 1:6:8.12345 |
| 11 | 2001-1-2 1:6:8 |
| 12 | 2001-1-2 1:6:8.123456 |
| 13 | 2001-1-2 1:6:8.123456789101112 |