Skip to content

Commit f531c4d

Browse files
committed
fix
1 parent 7d6d563 commit f531c4d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

be/src/vec/exec/format/parquet/vparquet_group_reader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "runtime/thread_context.h"
4040
#include "runtime/types.h"
4141
#include "schema_desc.h"
42+
#include "vec/columns/column.h"
4243
#include "vec/columns/column_const.h"
4344
#include "vec/columns/column_nothing.h"
4445
#include "vec/columns/column_nullable.h"
@@ -482,9 +483,12 @@ Status RowGroupReader::_do_lazy_read(Block* block, size_t batch_size, size_t* re
482483
{
483484
SCOPED_RAW_TIMER(&_predicate_filter_time);
484485

486+
ColumnPtr tmp_first_column = nullptr;
485487
// generate filter vector
486488
if (_lazy_read_ctx.resize_first_column) {
487489
// VExprContext.execute has an optimization, the filtering is executed when block->rows() > 0
490+
tmp_first_column = block->get_by_position(0).column;
491+
// set first column to pre_read_rows size to pass the block->rows()
488492
block->get_by_position(0).column = ColumnNothing::create(pre_read_rows);
489493
}
490494
result_filter.assign(pre_read_rows, static_cast<unsigned char>(1));
@@ -505,8 +509,7 @@ Status RowGroupReader::_do_lazy_read(Block* block, size_t batch_size, size_t* re
505509
}
506510

507511
if (_lazy_read_ctx.resize_first_column) {
508-
// We have to clean the first column to insert right data.
509-
block->get_by_position(0).column->assume_mutable()->clear();
512+
block->get_by_position(0).column = tmp_first_column;
510513
}
511514
}
512515

0 commit comments

Comments
 (0)