Files
impala/testdata/workloads/functional-query/queries/DataErrorsTest/avro-errors.test
Attila Jeges 684a54a89e IMPALA-7368: Change supported year range for DATE values to 1..9999
Before this patch the supported year range for DATE type started with
year 0. This contradicts the ANSI SQL standard that defines the valid
DATE value range to be 0001-01-01 to 9999-12-31.

Change-Id: Iefdf1c036834763f52d44d0c39a25a1f04e41e07
Reviewed-on: http://gerrit.cloudera.org:8080/14349
Reviewed-by: Attila Jeges <attilaj@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2019-10-04 18:36:22 +00:00

77 lines
2.7 KiB
Plaintext

====
---- QUERY
# Read from the corrupt files. We may get partial results.
select * from bad_avro_snap_strings
---- RESULTS: VERIFY_IS_SUPERSET
'valid'
---- TYPES
string
---- ERRORS
row_regex: .*Problem parsing file $NAMENODE/.*
File '$NAMENODE/test-warehouse/bad_avro_snap_strings_avro_snap/truncated_string.avro' is corrupt: truncated data block at offset 155
File '$NAMENODE/test-warehouse/bad_avro_snap_strings_avro_snap/negative_string_len.avro' is corrupt: invalid length -7 at offset 164
File '$NAMENODE/test-warehouse/bad_avro_snap_strings_avro_snap/invalid_union.avro' is corrupt: invalid union value 4 at offset 174 (1 of 2 similar)
====
---- QUERY
# Read from the corrupt files. We may get partial results.
select * from bad_avro_snap_floats
---- RESULTS: VERIFY_IS_SUPERSET
1
---- TYPES
float
---- ERRORS
Problem parsing file $NAMENODE/test-warehouse/bad_avro_snap_floats_avro_snap/truncated_float.avro at 159
File '$NAMENODE/test-warehouse/bad_avro_snap_floats_avro_snap/truncated_float.avro' is corrupt: truncated data block at offset 159
====
---- QUERY
select * from bad_avro_decimal_schema
---- TYPES
string,decimal
---- RESULTS
---- ERRORS
Column 'value': invalid Avro decimal type with precision = '5' scale = '7'
====
---- QUERY
# Out of range DATE values in an avro table.
# Note that when the avro scanner encounters an out of range DATE error a warning is
# emitted and no result rows are returned. This behavior differs from how the parquet
# scanner works but it is consistent with how avro scanner handles similar errors.
select * from bad_avro_date_out_of_range;
---- RESULTS
---- TYPES
DATE
---- ERRORS
Problem parsing file $NAMENODE/test-warehouse/bad_avro_date_out_of_range_avro_snap/out_of_range_date.avro at 204
Avro file '$NAMENODE/test-warehouse/bad_avro_date_out_of_range_avro_snap/out_of_range_date.avro' is corrupt: out of range date value -719530 at offset 204. The valid date range is -719162..2932896 (0001-01-01..9999-12-31).
====
---- QUERY
# Query an avro table created by Hive 2.1.1 containig the following dates:
# 1582-10-04, 1582-10-05, 1582-10-06, 1582-10-15, 1582-10-16.
# Impala will incorrectly read back the dates that precede the introduction of Gregorian
# calendar (1582-10-15).
select * from hive2_bad_avro_date_pre_gregorian;
---- TYPES
DATE
---- RESULTS
1582-10-14
1582-10-15
1582-10-16
1582-10-15
1582-10-16
====
---- QUERY
# Query an avro table created by Hive 3.1.0 containig the following dates:
# 1582-10-04, 1582-10-05, 1582-10-06, 1582-10-15, 1582-10-16.
# Impala will correctly read back all the dates, including those that precede the
# introduction of Gregorian calendar (1582-10-15).
select * from hive3_avro_date_pre_gregorian;
---- TYPES
DATE
---- RESULTS
1582-10-04
1582-10-05
1582-10-06
1582-10-15
1582-10-16
====