Files
impala/testdata/workloads/functional-query/queries/QueryTest/dateless_timestamp_parquet.test
Adam Tamas 1bafb7bd29 IMPALA-9531: Dropped support for dateless timestamps
Removed the support for dateless timestamps.
During dateless timestamp casts if the format doesn't contain
date part we get an error during tokenization of the format.
If the input str doesn't contain a date part then we get null result.

Examples:
select cast('01:02:59' as timestamp);
This will come back as NULL value.

select to_timestamp('01:01:01', 'HH:mm:ss');
select cast('01:02:59' as timestamp format 'HH12:MI:SS');
select cast('12 AM' as timestamp FORMAT 'AM.HH12');
These will come back with a parsing errors.

Casting from a table will generate similar results.

Testing:
Modified the previous tests related to dateless timestamps.
Added test to read fromtables which are still containing dateless
timestamps and covered timestamp to string path when no date tokens
are requested in the output string.

Change-Id: I48c49bf027cc4b917849b3d58518facba372b322
Reviewed-on: http://gerrit.cloudera.org:8080/15866
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Gabor Kaszab <gaborkaszab@cloudera.com>
2020-07-08 19:32:15 +00:00

26 lines
653 B
Plaintext

====
---- QUERY
SET abort_on_error=1;
SELECT * FROM $DATABASE.timestamp_table;
---- TYPES
TIMESTAMP
---- CATCH
timestamp_table/dateless_timestamps.parq' column 't' contains an out of range timestamp. The valid date range is 1400-01-01..9999-12-31.
====
---- QUERY
SET abort_on_error=0;
SELECT * FROM $DATABASE.timestamp_table;
---- TYPES
TIMESTAMP
---- RESULTS
1996-04-22 10:00:00.432100000
1996-04-22 10:00:00.432100000
1996-04-22 10:00:00
1996-04-22 10:00:00
1996-04-22 00:00:00
NULL
NULL
---- ERRORS
Parquet file '__HDFS_FILENAME__' column 't' contains an out of range timestamp. The valid date range is 1400-01-01..9999-12-31. (1 of 2 similar)
====