Skip to content

Commit

Permalink
[chore](topn-opt) remove redundant check for fetch phase
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Jun 21, 2024
1 parent 0cff539 commit 15e948c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions be/src/exec/rowid_fetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ Status RowIDFetcher::fetch(const vectorized::ColumnPtr& column_row_ids,
std::vector<PRowLocation> rows_locs;
rows_locs.reserve(rows_locs.size());
RETURN_IF_ERROR(_merge_rpc_results(mget_req, resps, cntls, res_block, &rows_locs));
if (rows_locs.size() != res_block->rows() || rows_locs.size() != column_row_ids->size()) {
return Status::InternalError("Miss matched return row loc count {}, expected {}, input {}",
rows_locs.size(), res_block->rows(), column_row_ids->size());
}
// Final sort by row_ids sequence, since row_ids is already sorted if need
std::map<GlobalRowLoacation, size_t> positions;
for (size_t i = 0; i < rows_locs.size(); ++i) {
Expand All @@ -255,12 +251,12 @@ Status RowIDFetcher::fetch(const vectorized::ColumnPtr& column_row_ids,
reinterpret_cast<const GlobalRowLoacation*>(column_row_ids->get_data_at(i).data);
permutation.push_back(positions[*location]);
}
// Check row consistency
RETURN_IF_CATCH_EXCEPTION(res_block->check_number_of_rows());
for (size_t i = 0; i < res_block->columns(); ++i) {
res_block->get_by_position(i).column =
res_block->get_by_position(i).column->permute(permutation, permutation.size());
}
// Check row consistency
RETURN_IF_CATCH_EXCEPTION(res_block->check_number_of_rows());
// shrink for char type
std::vector<size_t> char_type_idx;
for (size_t i = 0; i < _fetch_option.desc->slots().size(); i++) {
Expand Down

0 comments on commit 15e948c

Please sign in to comment.