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 b3bbf83 commit 64f9e06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion be/src/exec/csv_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Status CsvScanNode::prepare(RuntimeState* state) {
_hll_column_num++;
}

// NOTE: not all the columns in '_cond_cols' is exist in table schema
// NOTE: not all the columns in '_columns' is exist in table schema
if (_columns.end() != std::find(_columns.begin(), _columns.end(), column_name)) {
_column_slot_map[column_name] = slot;
} else {
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/csv_scan_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class CsvScanNode : public ScanNode {
std::vector<std::string> _unspecified_columns;
std::vector<std::string> _default_values;

// Map one-for-one to '_cond_cols' in the same order
// Map one-for-one to '_columns' in the same order
std::vector<SlotDescriptor*> _column_slot_vec;
std::vector<TColumnType> _column_type_vec;
// Map one-for-one to '_unspecified_columns' in the same order
Expand Down
8 changes: 4 additions & 4 deletions be/src/olap/olap_cond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,8 @@ bool Conditions::delete_conditions_eval(const RowCursor& row) const {
return false;
}

for (auto& each_cond : _cond_cols) {
if (_cond_column_is_key_or_duplicate(each_cond.second) && !each_cond.second->eval(row)) {
for (const auto& cond_col : _cond_cols) {
if (_cond_column_is_key_or_duplicate(cond_col.second) && !cond_col.second->eval(row)) {
return false;
}
}
Expand All @@ -1026,7 +1026,7 @@ bool Conditions::rowset_pruning_filter(const std::vector<KeyRange>& zone_maps) c
// ZoneMap will store min/max of rowset.
// The function is to filter rowset using ZoneMaps
// and query predicates.
for (auto& cond_col : _cond_cols) {
for (const auto& cond_col : _cond_cols) {
if (_cond_column_is_key_or_duplicate(cond_col.second)) {
if (cond_col.first < zone_maps.size() &&
!cond_col.second->eval(zone_maps.at(cond_col.first))) {
Expand Down Expand Up @@ -1058,7 +1058,7 @@ int Conditions::delete_pruning_filter(const std::vector<KeyRange>& zone_maps) co
* this is base on the assumption that the delete condition
* is only about key field, not about value field except the storage model is duplicate.
*/
if (!_cond_column_is_key_or_duplicate(cond_col.second) || cond_col.first > zone_maps.size()) {
if (_cond_column_is_key_or_duplicate(cond_col.second) && cond_col.first > zone_maps.size()) {
LOG(WARNING) << "where condition not equal column statistics size. "
<< "cond_id=" << cond_col.first << ", zone_map_size=" << zone_maps.size();
del_partial_satisfied = true;
Expand Down
2 changes: 0 additions & 2 deletions be/src/olap/olap_cond.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ struct Cond {

OLAPStatus init(const TCondition& tcond, const TabletColumn& column);

// 'other' may be invalid after intersection
OLAPStatus intersection_cond(const Cond& other);

OLAPStatus union_cond(const Cond& other);
Expand Down Expand Up @@ -202,7 +201,6 @@ class Conditions {
private:
const TabletSchema* _schema = nullptr;

// TODO(yingchun): DELETE FROM xx WHERE col1 IN (a) AND col2 IN (b)
// CondColumns in _cond_cols are in 'AND' relationship
CondColumns _cond_cols; // list of condition column

Expand Down

0 comments on commit 64f9e06

Please sign in to comment.