Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 245 additions & 9 deletions be/src/pipeline/exec/table_function_operator.cpp

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion be/src/pipeline/exec/table_function_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class TableFunctionLocalState MOCK_REMOVE(final) : public PipelineXLocalState<>

MOCK_FUNCTION Status _clone_table_function(RuntimeState* state);

void _copy_output_slots(std::vector<vectorized::MutableColumnPtr>& columns);
void _copy_output_slots(std::vector<vectorized::MutableColumnPtr>& columns,
const TableFunctionOperatorX& p);
bool _roll_table_functions(int last_eos_idx);
// return:
// 0: all fns are eos
Expand All @@ -65,12 +66,19 @@ class TableFunctionLocalState MOCK_REMOVE(final) : public PipelineXLocalState<>
int _find_last_fn_eos_idx() const;
bool _is_inner_and_empty();

Status _get_expanded_block_for_outer_conjuncts(RuntimeState* state,
vectorized::Block* output_block, bool* eos);

std::vector<vectorized::TableFunction*> _fns;
vectorized::VExprContextSPtrs _vfn_ctxs;
vectorized::VExprContextSPtrs _expand_conjuncts_ctxs;
// for table function with outer conjuncts, need to handle those child rows which all expanded rows are filtered out
bool _need_to_handle_outer_conjuncts = false;
int64_t _cur_child_offset = -1;
std::unique_ptr<vectorized::Block> _child_block;
int _current_row_insert_times = 0;
bool _child_eos = false;
DorisVector<bool> _child_rows_has_output;

RuntimeProfile::Counter* _init_function_timer = nullptr;
RuntimeProfile::Counter* _process_rows_timer = nullptr;
Expand Down Expand Up @@ -110,6 +118,7 @@ class TableFunctionOperatorX MOCK_REMOVE(final)
SCOPED_TIMER(local_state._init_function_timer);
RETURN_IF_ERROR(fn->process_init(input_block, state));
}
local_state._child_rows_has_output.resize(input_block->rows(), false);
local_state.process_next_child_row();
return Status::OK();
}
Expand Down Expand Up @@ -150,6 +159,7 @@ class TableFunctionOperatorX MOCK_REMOVE(final)
std::vector<SlotDescriptor*> _output_slots;

vectorized::VExprContextSPtrs _vfn_ctxs;
vectorized::VExprContextSPtrs _expand_conjuncts_ctxs;

std::vector<vectorized::TableFunction*> _fns;
int _fn_num = 0;
Expand Down
Loading
Loading