[feature-wip](inverted index) API for inverted index reader and syntax for fulltext match (#14211)

* [feature-wip](inverted index)inverted index api: reader

* [feature-wip](inverted index) Fulltext query syntax with MATCH/MATCH_ALL/MATCH_ALL

* [feature-wip](inverted index) Adapt to index meta

* [enhance] add more metrics

* [enhance] add fulltext match query check for column type and index parser

* [feature-wip](inverted index) Support apply inverted index in compound predicate which except leaf node of and node
This commit is contained in:
YueW
2022-12-30 21:48:14 +08:00
committed by GitHub
parent b23d068281
commit edecc2e706
45 changed files with 1450 additions and 31 deletions

View File

@ -19,6 +19,7 @@
#include <string_view>
#include "common/consts.h"
#include "common/status.h"
#include "exprs/anyval_util.h"
#include "exprs/rpc_fn.h"
@ -125,7 +126,8 @@ bool VectorizedFnCall::fast_execute(FunctionContext* context, Block& block,
size_t input_rows_count) {
auto query_value = block.get_by_position(arguments[1]).to_string(0);
std::string column_name = block.get_by_position(arguments[0]).name;
auto result_column_name = column_name + "_" + _function->get_name() + "_" + query_value;
auto result_column_name = BeConsts::BLOCK_TEMP_COLUMN_PREFIX + column_name + "_" +
_function->get_name() + "_" + query_value;
if (!block.has(result_column_name)) {
return false;
}

View File

@ -45,6 +45,7 @@ using doris::TypeDescriptor;
VExpr::VExpr(const doris::TExprNode& node)
: _node_type(node.node_type),
_opcode(node.__isset.opcode ? node.opcode : TExprOpcode::INVALID_OPCODE),
_type(TypeDescriptor::from_thrift(node.type)),
_fn_context_index(-1),
_prepared(false) {
@ -61,6 +62,7 @@ VExpr::VExpr(const doris::TExprNode& node)
VExpr::VExpr(const VExpr& vexpr)
: _node_type(vexpr._node_type),
_opcode(vexpr._opcode),
_type(vexpr._type),
_data_type(vexpr._data_type),
_children(vexpr._children),
@ -70,7 +72,10 @@ VExpr::VExpr(const VExpr& vexpr)
_prepared(vexpr._prepared) {}
VExpr::VExpr(const TypeDescriptor& type, bool is_slotref, bool is_nullable)
: _type(type), _fn_context_index(-1), _prepared(false) {
: _opcode(TExprOpcode::INVALID_OPCODE),
_type(type),
_fn_context_index(-1),
_prepared(false) {
if (is_slotref) {
_node_type = TExprNodeType::SLOT_REF;
}
@ -130,7 +135,8 @@ Status VExpr::create_expr(doris::ObjectPool* pool, const doris::TExprNode& texpr
case doris::TExprNodeType::ARITHMETIC_EXPR:
case doris::TExprNodeType::BINARY_PRED:
case doris::TExprNodeType::FUNCTION_CALL:
case doris::TExprNodeType::COMPUTE_FUNCTION_CALL: {
case doris::TExprNodeType::COMPUTE_FUNCTION_CALL:
case doris::TExprNodeType::MATCH_PRED: {
*expr = pool->add(new VectorizedFnCall(texpr_node));
break;
}

View File

@ -101,6 +101,8 @@ public:
TExprNodeType::type node_type() const { return _node_type; }
TExprOpcode::type op() const { return _opcode; }
void add_child(VExpr* expr) { _children.push_back(expr); }
static Status create_expr_tree(ObjectPool* pool, const TExpr& texpr, VExprContext** ctx);
@ -203,6 +205,8 @@ protected:
const FunctionBasePtr& function) const;
TExprNodeType::type _node_type;
// Used to check what opcode
TExprOpcode::type _opcode;
TypeDescriptor _type;
DataTypePtr _data_type;
std::vector<VExpr*> _children;