kangpinghuang commented on a change in pull request #1200: Merge refactor code
into master
URL: https://github.com/apache/incubator-doris/pull/1200#discussion_r288477460
##########
File path: be/src/olap/olap_cond.cpp
##########
@@ -555,30 +556,30 @@ bool CondColumn::eval(const BloomFilter& bf) const {
}
OLAPStatus Conditions::append_condition(const TCondition& tcond) {
- int32_t index = _table->get_field_index(tcond.column_name);
+ int32_t index = _get_field_index(tcond.column_name);
if (index < 0) {
- OLAP_LOG_WARNING("fail to get field index, name is invalid. [index=%d;
field_name=%s]",
- index,
- tcond.column_name.c_str());
+ LOG(WARNING) << "fail to get field index, name is invalid. index=" <<
index
+ << ", field_name=" << tcond.column_name;
return OLAP_ERR_INPUT_PARAMETER_ERROR;
}
// Skip column which is non-key, or whose type is string or float
- const FieldInfo& fi = _table->tablet_schema()[index];
- if (fi.type == OLAP_FIELD_TYPE_DOUBLE || fi.type == OLAP_FIELD_TYPE_FLOAT)
{
+ const TabletColumn& column = _schema->column(index);
+ if (column.type() == OLAP_FIELD_TYPE_DOUBLE
+ || column.type() == OLAP_FIELD_TYPE_FLOAT) {
return OLAP_SUCCESS;
}
CondColumn* cond_col = nullptr;
auto it = _columns.find(index);
if (it == _columns.end()) {
- cond_col = new CondColumn(_table, index);
+ cond_col = new CondColumn(*_schema, index);
Review comment:
```suggestion
cond_col = new(std::nothrow) CondColumn(*_schema, index);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]