Files
impala/testdata/workloads/functional-query/queries/QueryTest/hdfs-text-scan.test
Juan Yu d1c263402e IMPALA-1973: Fixing crash when uninitialized, empty row is added in HdfsTextScanner
This patch fixes an issue when an uninitialized, empty row is falsely
added to the rowbatch. The uninitialized data inside this row leads
later on to a crash when the null byte is checked together with the
offsets (that contains garbage).

The fix is to not only check for the number of materialized columns, but
as well for the number of materialized partition key columns. Only if both are
empty and the parser has an unfinished tuple, add the empty row.

To accommodate for the last row, check in FinishScanRange() if there is an
unfinished tuple with materialized slots or materialized partition key. Write
the fields if necessary.

Change-Id: I2808cc228e62d048d917d3a6352d869d117597ab
(cherry picked from commit c1795a8b40d10fbb32d9051a0e7de5ebffc8a6bd)
Reviewed-on: http://gerrit.cloudera.org:8080/364
Reviewed-by: Juan Yu <jyu@cloudera.com>
Tested-by: Internal Jenkins
2015-05-05 00:19:12 +00:00

74 lines
1.3 KiB
Plaintext

---- QUERY
select count(*) from functional.table_no_newline
---- RESULTS
5
---- TYPES
BIGINT
====
---- QUERY
select count(col_3) from functional.table_no_newline
---- RESULTS
5
---- TYPES
BIGINT
====
---- QUERY
select count(*) from functional.table_no_newline_part
---- RESULTS
11
---- TYPES
BIGINT
====
---- QUERY
select count(year) from functional.table_no_newline_part
---- RESULTS
11
---- TYPES
BIGINT
====
---- QUERY
select count(year) from functional.table_no_newline_part where year=2015
---- RESULTS
6
---- TYPES
BIGINT
====
---- QUERY
select count(col_3) from functional.table_no_newline_part where year=2015
---- RESULTS
3
---- TYPES
BIGINT
====
---- QUERY
select distinct year from functional.table_no_newline_part order by year
---- RESULTS
2010
2015
---- TYPES
INT
====
---- QUERY
select count(id), count(col_1), count(col_2), count(col_3), count(year), count(month) from functional.table_no_newline_part
---- RESULTS
10,10,9,8,11,11
---- TYPES
BIGINT,BIGINT,BIGINT,BIGINT,BIGINT,BIGINT
====
---- QUERY
select year, count(*) from functional.table_no_newline_part group by year order by year
---- RESULTS
2010,5
2015,6
---- TYPES
INT,BIGINT
====
---- QUERY
select year, count(col_3) from functional.table_no_newline_part group by year order by year
---- RESULTS
2010,5
2015,3
---- TYPES
INT,BIGINT
====