mirror of
https://github.com/apache/impala.git
synced 2026-01-19 09:01:38 -05:00
Logging file or table data is a bad idea, and doing it by default is particularly bad. This patch changes HdfsScanNode::LogRowParseError() to log a file and offset only. Testing: See rewritten tests. To support testing this change, we also fix IMPALA-3895, by introducing a canonical string __HDFS_FILENAME__ that all Hadoop filenames in the ERROR output are replaced with before comparing with the expected results. This fixes a number of issues with the old way of matching filenames which purported to be a regex, but really wasn't. In particular, we can now match the rest of an ERROR line after the filename, which was not possible before. In some cases, we don't want to substitute filenames because the ERROR output is looking for a very specific output. In that case we can write: $NAMENODE/<filename> and this patch will not perform _any_ filename substitutions on ERROR sections that contain the $NAMENODE string. Finally, this patch fixes a bug where a test that had an ERRORS section but no RESULTS section would silently pass without testing anything. Change-Id: I5a604f8784a9ff7b4bf878f82ee7f56697df3272 Reviewed-on: http://gerrit.cloudera.org:8080/4020 Reviewed-by: Henry Robinson <henry@cloudera.com> Tested-by: Internal Jenkins
27 lines
1.1 KiB
Plaintext
27 lines
1.1 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
|
|
File '$NAMENODE/test-warehouse/bad_avro_snap_strings_avro_snap/invalid_union.avro' is corrupt: invalid encoded integer at offset 191
|
|
====
|
|
---- 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
|
|
====
|