You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2020/10/29 01:01:33 UTC

[impala] branch master updated: IMPALA-10267: Impala crashes in HdfsScanner::WriteTemplateTuples() with negative num_tuples

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 09fdeb5  IMPALA-10267: Impala crashes in HdfsScanner::WriteTemplateTuples() with negative num_tuples
09fdeb5 is described below

commit 09fdeb56f8aa1638cd1307f0ee83bda023d68b8b
Author: Qifan Chen <qc...@cloudera.com>
AuthorDate: Wed Oct 28 14:16:07 2020 -0400

    IMPALA-10267: Impala crashes in HdfsScanner::WriteTemplateTuples() with negative num_tuples
    
    This fix enhances method HdfsAvroScanner::ProcessRange() with a DCHECK()
    to help catch negative num_tuples. The DCHEK() specifically checks that
    num_records_in_block_ is always greater than record_pos_.
    
    Testing:
    1. Unit testing.
    
    Change-Id: If88fd3aa4c96a69e37d060031f7432d27d069c62
    Reviewed-on: http://gerrit.cloudera.org:8080/16672
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Joe McDonnell <jo...@cloudera.com>
---
 be/src/exec/hdfs-avro-scanner.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/be/src/exec/hdfs-avro-scanner.cc b/be/src/exec/hdfs-avro-scanner.cc
index 7c6ea6d..efd638f 100644
--- a/be/src/exec/hdfs-avro-scanner.cc
+++ b/be/src/exec/hdfs-avro-scanner.cc
@@ -546,6 +546,7 @@ Status HdfsAvroScanner::ProcessRange(RowBatch* row_batch) {
       Tuple* tuple = tuple_;
       TupleRow* tuple_row = row_batch->GetRow(row_batch->AddRow());
       int max_tuples = row_batch->capacity() - row_batch->num_rows();
+      DCHECK_GT(num_records_in_block_, record_pos_);
       max_tuples = min<int64_t>(max_tuples, num_records_in_block_ - record_pos_);
       int num_to_commit;
       if (scan_node_->materialized_slots().empty()) {