Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 25, 2020
1 parent 1faa8fd commit ad6d981
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ set(BUILD_SHARED_LIBS OFF)

if (${MAKE_TEST} STREQUAL "ON")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -DGTEST_USE_OWN_TR1_TUPLE=0")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
add_definitions(-DBE_TEST)
endif ()

Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/olap_cond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ int Cond::eval_cost() const {
return 2 * operand_field->field_size();
case OP_IN:
case OP_NOT_IN:
return 3 * operand_set->size() * (*operand_set.begin())->field_size();
return 3 * operand_set.size() * (*operand_set.begin())->field_size();
default:
return 0;
}
Expand Down
17 changes: 9 additions & 8 deletions be/src/olap/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,11 @@ OLAPStatus Reader::_init_return_columns(const ReaderParams& read_params) {
if (!_delete_handler.empty() && read_params.aggregation) {
set<uint32_t> column_set(_return_columns.begin(), _return_columns.end());
for (const auto& conds : _delete_handler.get_delete_conditions()) {
for (const auto& cond_column : conds.del_cond->columns()) {
if (column_set.find(cond_column.first) == column_set.end()) {
column_set.insert(cond_column.first);
_return_columns.push_back(cond_column.first);
for (const auto& cond_column : conds.del_cond->sorted_conds()) {
auto cid = cond_column->col_index();
if (column_set.find(cid) == column_set.end()) {
column_set.insert(cid);
_return_columns.push_back(cid);
}
}
}
Expand Down Expand Up @@ -837,14 +838,14 @@ ColumnPredicate* Reader::_parse_to_predicate(const TCondition& condition) {

void Reader::_init_load_bf_columns(const ReaderParams& read_params) {
// add all columns with condition to _load_bf_columns
for (const auto& cond_column : _conditions.columns()) {
if (!_tablet->tablet_schema().column(cond_column.first).is_bf_column()) {
for (const auto& cond_column : _conditions.sorted_conds()) {
if (!_tablet->tablet_schema().column(cond_column->col_index()).is_bf_column()) {
continue;
}
for (const auto& cond : cond_column.second->conds()) {
for (const auto& cond : cond_column->conds()) {
if (cond->op == OP_EQ ||
(cond->op == OP_IN && cond->operand_set.size() < MAX_OP_IN_FIELD_NUM)) {
_load_bf_columns.insert(cond_column.first);
_load_bf_columns.insert(cond_column->col_index());
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions be/src/olap/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct ReaderParams {

class Reader {
public:
Reader() = default;
Reader();
~Reader();

// Initialize Reader with tablet, data version and fetch range.
Expand Down Expand Up @@ -115,8 +115,8 @@ class Reader {

std::string range;
std::string end_range;
std::vector<RowCursor*> start_keys; // TODO(yingchun): should be a cell?
std::vector<RowCursor*> end_keys; // TODO(yingchun): should be a cell?
std::vector<RowCursor*> start_keys;
std::vector<RowCursor*> end_keys;
};

friend class CollectIterator;
Expand Down Expand Up @@ -160,10 +160,11 @@ class Reader {
std::shared_ptr<MemTracker> _tracker;
std::unique_ptr<MemPool> _predicate_mem_pool;
std::set<uint32_t> _load_bf_columns;
std::vector<uint32_t> _return_columns; // TODO(yingchun): use set?
std::vector<uint32_t> _return_columns;
std::vector<uint32_t> _seek_columns;

TabletSharedPtr _tablet;
std::vector<RowsetReaderSharedPtr> _rs_readers;
RowsetReaderContext _reader_context;
KeysParam _keys_param;
std::vector<bool> _is_lower_keys_included;
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/rowset/segment_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ OLAPStatus SegmentReader::_pick_delete_row_groups(uint32_t first_block, uint32_t
continue;
}
StreamIndexReader* index_reader = _indices[unique_column_id];
int del_ret = i.second->del_eval(index_reader->entry(j).column_statistic().pair());
int del_ret = col_cond->del_eval(index_reader->entry(j).column_statistic().pair());
if (DEL_SATISFIED == del_ret) {
continue;
} else if (DEL_PARTIAL_SATISFIED == del_ret) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Status SegmentIterator::_get_row_ranges_from_conditions(RowRanges* condition_row
}
RowRanges single_delete_condition_row_ranges = RowRanges::create_single(num_rows());
RETURN_IF_ERROR(_column_iterators[cid]->get_row_ranges_by_zone_map(
column_cond, delete_column_condition.second,
column_cond, delete_column_condition,
&single_delete_condition_row_ranges));
RowRanges::ranges_union(delete_condition_row_ranges, single_delete_condition_row_ranges,
&delete_condition_row_ranges);
Expand Down
1 change: 0 additions & 1 deletion be/test/olap/timestamped_version_tracker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ TEST_F(TestTimestampedVersionTracker, get_stale_version_path_json_doc) {
auto time_zone = cctz::local_time_zone();
auto tp = std::chrono::system_clock::now();
auto time_zone_str = cctz::format("%z", tp, time_zone);
std::cout << "time_zone.name: " << time_zone.name() << std::endl;

std::string expect_result = R"([
{
Expand Down

0 comments on commit ad6d981

Please sign in to comment.