[Bug](load) fix core dump on big block load (#13014)

This commit is contained in:
Pxl
2022-10-10 12:38:32 +08:00
committed by GitHub
parent 1cd4e5cec6
commit bdcb600f3d
10 changed files with 88 additions and 45 deletions

View File

@ -17,8 +17,6 @@
#include "vec/exec/vtable_function_node.h"
#include "exprs/expr.h"
#include "exprs/expr_context.h"
#include "exprs/table_function/table_function.h"
#include "exprs/table_function/table_function_factory.h"
#include "vec/exprs/vexpr.h"
@ -109,7 +107,7 @@ Status VTableFunctionNode::get_expanded_block(RuntimeState* state, Block* output
}
}
while (true) {
while (columns[_child_slots.size()]->size() < state->batch_size()) {
RETURN_IF_CANCELLED(state);
RETURN_IF_ERROR(state->check_query_state("VTableFunctionNode, while getting next batch."));
@ -133,7 +131,7 @@ Status VTableFunctionNode::get_expanded_block(RuntimeState* state, Block* output
}
bool skip_child_row = false;
while (true) {
while (columns[_child_slots.size()]->size() < state->batch_size()) {
int idx = _find_last_fn_eos_idx();
if (idx == 0 || skip_child_row) {
// all table functions' results are exhausted, process next child row.
@ -187,10 +185,6 @@ Status VTableFunctionNode::get_expanded_block(RuntimeState* state, Block* output
bool tmp = false;
_fns[_fn_num - 1]->forward(&tmp);
if (columns[_child_slots.size()]->size() >= state->batch_size()) {
break;
}
}
}