[feature] add table valued function framework and numbers table valued function (#10214)

This commit is contained in:
Tiewei Fang
2022-06-28 14:01:57 +08:00
committed by GitHub
parent 2f30c7cf03
commit 17eb8c00d3
28 changed files with 1924 additions and 12 deletions

View File

@ -79,6 +79,7 @@
#include "vec/exec/vselect_node.h"
#include "vec/exec/vsort_node.h"
#include "vec/exec/vtable_function_node.h"
#include "vec/exec/vtable_valued_function_scannode.h"
#include "vec/exec/vunion_node.h"
#include "vec/exprs/vexpr.h"
@ -391,6 +392,7 @@ Status ExecNode::create_node(RuntimeState* state, ObjectPool* pool, const TPlanN
case TPlanNodeType::REPEAT_NODE:
case TPlanNodeType::TABLE_FUNCTION_NODE:
case TPlanNodeType::BROKER_SCAN_NODE:
case TPlanNodeType::TABLE_VALUED_FUNCTION_SCAN_NODE:
break;
default: {
const auto& i = _TPlanNodeType_VALUES_TO_NAMES.find(tnode.node_type);
@ -577,6 +579,15 @@ Status ExecNode::create_node(RuntimeState* state, ObjectPool* pool, const TPlanN
}
return Status::OK();
case TPlanNodeType::TABLE_VALUED_FUNCTION_SCAN_NODE:
if (state->enable_vectorized_exec()) {
*node = pool->add(new vectorized::VTableValuedFunctionScanNode(pool, tnode, descs));
return Status::OK();
} else {
error_msg << "numbers table function only support vectorized execution";
return Status::InternalError(error_msg.str());
}
default:
map<int, const char*>::const_iterator i =
_TPlanNodeType_VALUES_TO_NAMES.find(tnode.node_type);
@ -652,6 +663,7 @@ void ExecNode::collect_scan_nodes(vector<ExecNode*>* nodes) {
collect_nodes(TPlanNodeType::OLAP_SCAN_NODE, nodes);
collect_nodes(TPlanNodeType::BROKER_SCAN_NODE, nodes);
collect_nodes(TPlanNodeType::ES_HTTP_SCAN_NODE, nodes);
collect_nodes(TPlanNodeType::TABLE_VALUED_FUNCTION_SCAN_NODE, nodes);
}
void ExecNode::try_do_aggregate_serde_improve() {