[Chore](top-n) check runtime predicate inited when scan operator open (#32140)

check runtime predicate inited when scan operator open
This commit is contained in:
Pxl
2024-03-12 22:39:58 +08:00
committed by yiguolei
parent 5da7cd0fba
commit fa111c371b
2 changed files with 3 additions and 1 deletions

View File

@ -578,6 +578,8 @@ void TabletReader::_init_conditions_param_except_leafnode_of_andnode(
for (int id : read_params.topn_filter_source_node_ids) {
auto& runtime_predicate =
read_params.runtime_state->get_query_ctx()->get_runtime_predicate(id);
DCHECK(runtime_predicate.inited())
<< "runtime predicate not inited, source_node_id=" << id;
runtime_predicate.set_tablet_schema(_tablet_schema);
}
}

View File

@ -53,7 +53,7 @@ public:
void set_tablet_schema(TabletSchemaSPtr tablet_schema) {
std::unique_lock<std::shared_mutex> wlock(_rwlock);
if (_tablet_schema) {
if (_tablet_schema || !_inited) {
return;
}
_tablet_schema = tablet_schema;