Revert #36575, because `VScanner::get_block` will check `DCHECK(block->rows() == 0)`, so block should be cleared when `eof = true`.
This commit is contained in:
@ -704,8 +704,10 @@ void Block::clear_column_data(int column_size) noexcept {
|
||||
}
|
||||
}
|
||||
for (auto& d : data) {
|
||||
DCHECK_EQ(d.column->use_count(), 1) << " " << print_use_count();
|
||||
(*std::move(d.column)).assume_mutable()->clear();
|
||||
if (d.column) {
|
||||
DCHECK_EQ(d.column->use_count(), 1) << " " << print_use_count();
|
||||
(*std::move(d.column)).assume_mutable()->clear();
|
||||
}
|
||||
}
|
||||
row_same_bit.clear();
|
||||
}
|
||||
|
||||
@ -1594,6 +1594,7 @@ Status OrcReader::get_next_block_impl(Block* block, size_t* read_rows, bool* eof
|
||||
} catch (std::exception& e) {
|
||||
std::string _err_msg = e.what();
|
||||
if (_io_ctx && _io_ctx->should_stop && _err_msg == "stop") {
|
||||
block->clear_column_data();
|
||||
*eof = true;
|
||||
*read_rows = 0;
|
||||
return Status::OK();
|
||||
@ -1663,6 +1664,7 @@ Status OrcReader::get_next_block_impl(Block* block, size_t* read_rows, bool* eof
|
||||
} catch (std::exception& e) {
|
||||
std::string _err_msg = e.what();
|
||||
if (_io_ctx && _io_ctx->should_stop && _err_msg == "stop") {
|
||||
block->clear_column_data();
|
||||
*eof = true;
|
||||
*read_rows = 0;
|
||||
return Status::OK();
|
||||
|
||||
@ -525,6 +525,7 @@ Status ParquetReader::get_next_block(Block* block, size_t* read_rows, bool* eof)
|
||||
Status batch_st =
|
||||
_current_group_reader->next_batch(block, _batch_size, read_rows, &_row_group_eof);
|
||||
if (batch_st.is<ErrorCode::END_OF_FILE>()) {
|
||||
block->clear_column_data();
|
||||
_current_group_reader.reset(nullptr);
|
||||
*read_rows = 0;
|
||||
*eof = true;
|
||||
|
||||
Reference in New Issue
Block a user