[fix](topn) add defensive code in topn opt to avoid crash due to column not in tablet schema

This commit is contained in:
Kang
2023-11-17 07:14:10 -06:00
committed by GitHub
parent c459408580
commit 0a1a6cf02f
2 changed files with 6 additions and 7 deletions

View File

@ -135,11 +135,6 @@ Status RuntimePredicate::update(const Field& value, const String& col_name, bool
std::unique_lock<std::shared_mutex> wlock(_rwlock);
// TODO why null
if (!_tablet_schema) {
return Status::OK();
}
bool updated = false;
if (UNLIKELY(_orderby_extrem.is_null())) {
@ -161,6 +156,10 @@ Status RuntimePredicate::update(const Field& value, const String& col_name, bool
return Status::OK();
}
// TODO defensive code
if (!_tablet_schema || !_tablet_schema->have_column(col_name)) {
return Status::OK();
}
// update _predictate
int32_t col_unique_id = _tablet_schema->column(col_name).unique_id();
const TabletColumn& column = _tablet_schema->column_by_uid(col_unique_id);