Skip to content
Snippets Groups Projects
Unverified Commit a12d3c34 authored by bright-starry-sky's avatar bright-starry-sky Committed by GitHub
Browse files

Fulltext integration (#415)

* fulltext

* remove create ft index

* fixed memory leaks

* Resolved conflict

* Resolve conflict

* addressed yee's comments
parent 94471bc6
No related branches found
No related tags found
No related merge requests found
Showing
with 548 additions and 6 deletions
......@@ -28,6 +28,7 @@ SET(CONTEXT_TEST_LIBS
$<TARGET_OBJECTS:common_process_obj>
$<TARGET_OBJECTS:common_time_utils_obj>
$<TARGET_OBJECTS:common_graph_obj>
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
$<TARGET_OBJECTS:util_obj>
$<TARGET_OBJECTS:context_obj>
$<TARGET_OBJECTS:expr_visitor_obj>
......
......@@ -58,6 +58,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:common_conf_obj>
$<TARGET_OBJECTS:common_time_utils_obj>
$<TARGET_OBJECTS:common_graph_obj>
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
LIBRARIES
proxygenhttpserver
proxygenlib
......
......@@ -65,6 +65,9 @@ nebula_add_library(
admin/ConfigExecutor.cpp
admin/GroupExecutor.cpp
admin/ZoneExecutor.cpp
admin/ShowTSClientsExecutor.cpp
admin/SignInTSServiceExecutor.cpp
admin/SignOutTSServiceExecutor.cpp
)
nebula_add_subdirectory(test)
......@@ -38,6 +38,9 @@
#include "executor/admin/GroupExecutor.h"
#include "executor/admin/ZoneExecutor.h"
#include "executor/admin/ShowStatsExecutor.h"
#include "executor/admin/ShowTSClientsExecutor.h"
#include "executor/admin/SignInTSServiceExecutor.h"
#include "executor/admin/SignOutTSServiceExecutor.h"
#include "executor/algo/BFSShortestPathExecutor.h"
#include "executor/algo/ProduceSemiShortestPathExecutor.h"
#include "executor/algo/ConjunctPathExecutor.h"
......@@ -449,6 +452,15 @@ Executor *Executor::makeExecutor(QueryContext *qctx, const PlanNode *node) {
case PlanNode::Kind::kShowStats: {
return pool->add(new ShowStatsExecutor(node, qctx));
}
case PlanNode::Kind::kShowTSClients: {
return pool->add(new ShowTSClientsExecutor(node, qctx));
}
case PlanNode::Kind::kSignInTSService: {
return pool->add(new SignInTSServiceExecutor(node, qctx));
}
case PlanNode::Kind::kSignOutTSService: {
return pool->add(new SignOutTSServiceExecutor(node, qctx));
}
case PlanNode::Kind::kUnknown: {
LOG(FATAL) << "Unknown plan node kind " << static_cast<int32_t>(node->kind());
break;
......
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "common/interface/gen-cpp2/meta_types.h"
#include "context/QueryContext.h"
#include "executor/admin/ShowTSClientsExecutor.h"
#include "planner/Admin.h"
#include "service/PermissionManager.h"
namespace nebula {
namespace graph {
folly::Future<Status> ShowTSClientsExecutor::execute() {
SCOPED_TIMER(&execTime_);
return showTSClients();
}
folly::Future<Status> ShowTSClientsExecutor::showTSClients() {
return qctx()
->getMetaClient()
->listFTClients()
.via(runner())
.then([this](auto &&resp) {
if (!resp.ok()) {
LOG(ERROR) << resp.status();
return resp.status();
}
auto value = std::move(resp).value();
DataSet v({"Host", "Port"});
for (const auto &client : value) {
nebula::Row r({client.host.host, client.host.port});
v.emplace_back(std::move(r));
}
return finish(std::move(v));
});
}
} // namespace graph
} // namespace nebula
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#ifndef EXECUTOR_ADMIN_SHOW_TS_CLIENTS_EXECUTOR_H_
#define EXECUTOR_ADMIN_SHOW_TS_CLIENTS_EXECUTOR_H_
#include "executor/Executor.h"
namespace nebula {
namespace graph {
class ShowTSClientsExecutor final : public Executor {
public:
ShowTSClientsExecutor(const PlanNode *node, QueryContext *qctx)
: Executor("ShowTSClientsExecutor", node, qctx) {}
folly::Future<Status> execute() override;
private:
folly::Future<Status> showTSClients();
};
} // namespace graph
} // namespace nebula
#endif // EXECUTOR_ADMIN_SHOW_TS_CLIENTS_EXECUTOR_H_
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "executor/admin/SignInTSServiceExecutor.h"
#include "planner/Admin.h"
namespace nebula {
namespace graph {
folly::Future<Status> SignInTSServiceExecutor::execute() {
SCOPED_TIMER(&execTime_);
return signInTSService();
}
folly::Future<Status> SignInTSServiceExecutor::signInTSService() {
auto *siNode = asNode<SignInTSService>(node());
return qctx()->getMetaClient()->signInFTService(siNode->type(), siNode->clients())
.via(runner())
.then([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
return Status::Error("Sign in text service failed!");
}
return Status::OK();
});
}
} // namespace graph
} // namespace nebula
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#ifndef EXECUTOR_ADMIN_SIGNINTSSERVICEEXECUTOR_H_
#define EXECUTOR_ADMIN_SIGNINTSSERVICEEXECUTOR_H_
#include "executor/Executor.h"
namespace nebula {
namespace graph {
class SignInTSServiceExecutor final : public Executor {
public:
SignInTSServiceExecutor(const PlanNode *node, QueryContext *qctx)
: Executor("SignInTSServiceExecutor", node, qctx) {}
folly::Future<Status> execute() override;
private:
folly::Future<Status> signInTSService();
};
} // namespace graph
} // namespace nebula
#endif // EXECUTOR_ADMIN_SIGNINTSSERVICEEXECUTOR_H_
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "executor/admin/SignOutTSServiceExecutor.h"
#include "planner/Admin.h"
namespace nebula {
namespace graph {
folly::Future<Status> SignOutTSServiceExecutor::execute() {
SCOPED_TIMER(&execTime_);
return signOutTSService();
}
folly::Future<Status> SignOutTSServiceExecutor::signOutTSService() {
return qctx()->getMetaClient()->signOutFTService()
.via(runner())
.then([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
return Status::Error("Sign out text service failed!");
}
return Status::OK();
});
}
} // namespace graph
} // namespace nebula
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#ifndef EXECUTOR_ADMIN_SIGNOUTTSSERVICEEXECUTOR_H_
#define EXECUTOR_ADMIN_SIGNOUTTSSERVICEEXECUTOR_H_
#include "executor/Executor.h"
namespace nebula {
namespace graph {
class SignOutTSServiceExecutor final : public Executor {
public:
SignOutTSServiceExecutor(const PlanNode *node, QueryContext *qctx)
: Executor("SignInTSServiceExecutor", node, qctx) {}
folly::Future<Status> execute() override;
private:
folly::Future<Status> signOutTSService();
};
} // namespace graph
} // namespace nebula
#endif // EXECUTOR_ADMIN_SIGNOUTTSSERVICEEXECUTOR_H_
......@@ -23,6 +23,10 @@ folly::Future<Status> IndexScanExecutor::execute() {
folly::Future<Status> IndexScanExecutor::indexScan() {
GraphStorageClient* storageClient = qctx_->getStorageClient();
auto *lookup = asNode<IndexScan>(node());
if (lookup->isEmptyResultSet()) {
DataSet dataSet({"dummy"});
return finish(ResultBuilder().value(Value(std::move(dataSet))).finish());
}
return storageClient->lookupIndex(lookup->space(),
*lookup->queryContext(),
lookup->isEdge(),
......
......@@ -32,6 +32,7 @@ SET(EXEC_QUERY_TEST_OBJS
$<TARGET_OBJECTS:common_encryption_obj>
$<TARGET_OBJECTS:common_http_client_obj>
$<TARGET_OBJECTS:common_time_utils_obj>
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
$<TARGET_OBJECTS:session_obj>
$<TARGET_OBJECTS:graph_flags_obj>
$<TARGET_OBJECTS:parser_obj>
......
......@@ -30,6 +30,10 @@ const Pattern& IndexScanRule::pattern() const {
StatusOr<OptRule::TransformResult> IndexScanRule::transform(graph::QueryContext* qctx,
const MatchedResult& matched) const {
auto groupNode = matched.node;
if (isEmptyResultSet(groupNode)) {
return TransformResult::noTransform();
}
auto filter = filterExpr(groupNode);
IndexQueryCtx iqctx = std::make_unique<std::vector<IndexQueryContext>>();
if (filter == nullptr) {
......@@ -174,7 +178,7 @@ Status IndexScanRule::appendIQCtx(const IndexItem& index,
#define CHECK_BOUND_VALUE(v, name) \
do { \
if (v == Value::kNullBadType) { \
if (v == Value::kNullBadType) { \
LOG(ERROR) << "Get bound value error. field : " << name; \
return Status::Error("Get bound value error. field : %s", name.c_str()); \
} \
......@@ -605,5 +609,9 @@ IndexScanRule::findIndexForRangeScan(const std::vector<IndexItem>& indexes,
return priorityIdxs;
}
bool IndexScanRule::isEmptyResultSet(const OptGroupNode *groupNode) const {
auto in = static_cast<const IndexScan *>(groupNode->node());
return in->isEmptyResultSet();
}
} // namespace opt
} // namespace nebula
......@@ -177,6 +177,8 @@ private:
std::vector<IndexItem> findIndexForRangeScan(const std::vector<IndexItem>& indexes,
const FilterItems& items) const;
bool isEmptyResultSet(const OptGroupNode *groupNode) const;
};
} // namespace opt
......
......@@ -30,6 +30,7 @@ set(OPTIMIZER_TEST_LIB
$<TARGET_OBJECTS:common_agg_function_obj>
$<TARGET_OBJECTS:common_time_utils_obj>
$<TARGET_OBJECTS:common_graph_obj>
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
$<TARGET_OBJECTS:idgenerator_obj>
$<TARGET_OBJECTS:expr_visitor_obj>
$<TARGET_OBJECTS:session_obj>
......
......@@ -208,4 +208,39 @@ std::string ShowStatsSentence::toString() const {
return folly::stringPrintf("SHOW STATS");
}
std::string ShowTSClientsSentence::toString() const {
return "SHOW TEXT SEARCH CLIENTS";
}
std::string SignInTextServiceSentence::toString() const {
std::string buf;
buf.reserve(256);
buf += "SIGN IN TEXT SERVICE ";
for (auto &client : clients_->clients()) {
buf += "(";
buf += client.get_host().host;
buf += ":";
buf += std::to_string(client.get_host().port);
if (client.__isset.user && !client.get_user()->empty()) {
buf += ", \"";
buf += *client.get_user();
buf += "\"";
}
if (client.__isset.pwd && !client.get_pwd()->empty()) {
buf += ", \"";
buf += *client.get_pwd();
buf += "\"";
}
buf += ")";
buf += ",";
}
if (!buf.empty()) {
buf.resize(buf.size() - 1);
}
return buf;
}
std::string SignOutTextServiceSentence::toString() const {
return "SIGN OUT TEXT SERVICE";
}
} // namespace nebula
......@@ -585,6 +585,60 @@ public:
std::string toString() const override;
};
class TSClientList final {
public:
void addClient(nebula::meta::cpp2::FTClient *client) {
clients_.emplace_back(client);
}
std::string toString() const;
std::vector<nebula::meta::cpp2::FTClient> clients() const {
std::vector<nebula::meta::cpp2::FTClient> result;
result.reserve(clients_.size());
for (auto &client : clients_) {
result.emplace_back(*client);
}
return result;
}
private:
std::vector<std::unique_ptr<nebula::meta::cpp2::FTClient>> clients_;
};
class ShowTSClientsSentence final : public Sentence {
public:
ShowTSClientsSentence() {
kind_ = Kind::kShowTSClients;
}
std::string toString() const override;
};
class SignInTextServiceSentence final : public Sentence {
public:
explicit SignInTextServiceSentence(TSClientList *clients) {
kind_ = Kind::kSignInTSService;
clients_.reset(clients);
}
std::string toString() const override;
TSClientList* clients() const {
return clients_.get();
}
private:
std::unique_ptr<TSClientList> clients_;
};
class SignOutTextServiceSentence final : public Sentence {
public:
SignOutTextServiceSentence() {
kind_ = Kind::kSignOutTSService;
}
std::string toString() const override;
};
} // namespace nebula
#endif // PARSER_ADMINSENTENCES_H_
......@@ -19,6 +19,7 @@
#include "common/expression/UUIDExpression.h"
#include "common/expression/LabelExpression.h"
#include "common/interface/gen-cpp2/meta_types.h"
#include "common/expression/TextSearchExpression.h"
namespace nebula {
......@@ -77,6 +78,7 @@ public:
kShowGroups,
kShowZones,
kShowStats,
kShowTSClients,
kDeleteVertices,
kDeleteEdges,
kLookup,
......@@ -122,6 +124,8 @@ public:
kAddListener,
kRemoveListener,
kShowListener,
kSignInTSService,
kSignOutTSService,
};
Kind kind() const {
......
......@@ -21,6 +21,7 @@
#include "common/expression/LabelAttributeExpression.h"
#include "common/expression/VariableExpression.h"
#include "common/expression/CaseExpression.h"
#include "common/expression/TextSearchExpression.h"
#include "util/SchemaUtil.h"
namespace nebula {
......@@ -67,6 +68,7 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
nebula::OverEdges *over_edges;
nebula::OverClause *over_clause;
nebula::WhereClause *where_clause;
nebula::WhereClause *lookup_where_clause;
nebula::WhenClause *when_clause;
nebula::YieldClause *yield_clause;
nebula::YieldColumns *yield_columns;
......@@ -121,6 +123,11 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
nebula::meta::cpp2::IndexFieldDef *index_field;
nebula::IndexFieldList *index_field_list;
CaseList *case_list;
nebula::TextSearchArgument *text_search_argument;
nebula::TextSearchArgument *base_text_search_argument;
nebula::TextSearchArgument *fuzzy_text_search_argument;
nebula::meta::cpp2::FTClient *text_search_client_item;
nebula::TSClientList *text_search_client_list;
}
/* destructors */
......@@ -163,6 +170,8 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
%token KW_CASE KW_THEN KW_ELSE KW_END
%token KW_GROUP KW_ZONE KW_GROUPS KW_ZONES KW_INTO
%token KW_LISTENER KW_ELASTICSEARCH
%token KW_AUTO KW_FUZZY KW_PREFIX KW_REGEXP KW_WILDCARD
%token KW_TEXT KW_SEARCH KW_CLIENTS KW_SIGN KW_SERVICE KW_TEXT_SEARCH
/* symbols */
%token L_PAREN R_PAREN L_BRACKET R_BRACKET L_BRACE R_BRACE COMMA
......@@ -197,6 +206,7 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
%type <expr> attribute_expression
%type <expr> case_expression
%type <expr> compound_expression
%type <expr> text_search_expression
%type <argument_list> argument_list opt_argument_list
%type <type> type_spec
%type <step_clause> step_clause
......@@ -206,6 +216,7 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
%type <over_edges> over_edges
%type <over_clause> over_clause
%type <where_clause> where_clause
%type <lookup_where_clause> lookup_where_clause
%type <when_clause> when_clause
%type <yield_clause> yield_clause
%type <yield_columns> yield_columns
......@@ -265,6 +276,11 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
%type <match_clause_list> reading_clauses reading_with_clause reading_with_clauses
%type <match_step_range> match_step_range
%type <order_factors> match_order_by
%type <text_search_argument> text_search_argument
%type <base_text_search_argument> base_text_search_argument
%type <fuzzy_text_search_argument> fuzzy_text_search_argument
%type <text_search_client_item> text_search_client_item
%type <text_search_client_list> text_search_client_list
%type <intval> legal_integer unary_integer rank port job_concurrency
......@@ -321,6 +337,7 @@ static constexpr size_t MAX_ABS_INTEGER = 9223372036854775808ULL;
%type <seq_sentences> seq_sentences
%type <explain_sentence> explain_sentence
%type <sentences> sentences
%type <sentence> sign_in_text_search_service_sentence sign_out_text_search_service_sentence
%type <boolval> opt_if_not_exists
%type <boolval> opt_if_exists
......@@ -450,6 +467,17 @@ unreserved_keyword
| KW_ELASTICSEARCH { $$ = new std::string("elasticsearch"); }
| KW_STATS { $$ = new std::string("stats"); }
| KW_STATUS { $$ = new std::string("status"); }
| KW_AUTO { $$ = new std::string("auto"); }
| KW_FUZZY { $$ = new std::string("fuzzy"); }
| KW_PREFIX { $$ = new std::string("prefix"); }
| KW_REGEXP { $$ = new std::string("regexp"); }
| KW_WILDCARD { $$ = new std::string("wildcard"); }
| KW_TEXT { $$ = new std::string("text"); }
| KW_SEARCH { $$ = new std::string("search"); }
| KW_CLIENTS { $$ = new std::string("clients"); }
| KW_SIGN { $$ = new std::string("sign"); }
| KW_SERVICE { $$ = new std::string("service"); }
| KW_TEXT_SEARCH { $$ = new std::string("text_search"); }
;
agg_function
......@@ -1347,8 +1375,187 @@ match_limit
}
;
text_search_client_item
: L_PAREN host_item R_PAREN {
$$ = new nebula::meta::cpp2::FTClient();
$$->set_host(*$2);
delete $2;
}
| L_PAREN host_item COMMA STRING COMMA STRING R_PAREN {
$$ = new nebula::meta::cpp2::FTClient();
$$->set_host(*$2);
$$->set_user(*$4);
$$->set_pwd(*$6);
delete $2;
delete $4;
delete $6;
}
;
text_search_client_list
: text_search_client_item {
$$ = new TSClientList();
$$->addClient($1);
}
| text_search_client_list COMMA text_search_client_item {
$$ = $1;
$$->addClient($3);
}
| text_search_client_list COMMA {
$$ = $1;
}
;
sign_in_text_search_service_sentence
: KW_SIGN KW_IN KW_TEXT KW_SERVICE text_search_client_list {
$$ = new SignInTextServiceSentence($5);
}
;
sign_out_text_search_service_sentence
: KW_SIGN KW_OUT KW_TEXT KW_SERVICE {
$$ = new SignOutTextServiceSentence();
}
;
base_text_search_argument
: name_label DOT name_label COMMA STRING {
auto arg = new TextSearchArgument($1, $3, $5);
$$ = arg;
}
;
fuzzy_text_search_argument
: base_text_search_argument COMMA KW_AUTO COMMA KW_AND {
$$ = $1;
$$->setFuzziness(-1);
$$->setOP(new std::string("and"));
}
| base_text_search_argument COMMA KW_AUTO COMMA KW_OR {
$$ = $1;
$$->setFuzziness(-1);
$$->setOP(new std::string("or"));
}
| base_text_search_argument COMMA legal_integer COMMA KW_AND {
if ($3 != 0 && $3 != 1 && $3 != 2) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
$$ = $1;
$$->setFuzziness($3);
$$->setOP(new std::string("and"));
}
| base_text_search_argument COMMA legal_integer COMMA KW_OR {
if ($3 != 0 && $3 != 1 && $3 != 2) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
$$ = $1;
$$->setFuzziness($3);
$$->setOP(new std::string("or"));
}
text_search_argument
: base_text_search_argument {
$$ = $1;
}
| fuzzy_text_search_argument {
$$ = $1;
}
| base_text_search_argument COMMA legal_integer {
if ($3 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
$$ = $1;
$$->setLimit($3);
}
| base_text_search_argument COMMA legal_integer COMMA legal_integer {
if ($3 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
if ($5 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@5, "Out of range:");
}
$$ = $1;
$$->setLimit($3);
$$->setTimeout($5);
}
| fuzzy_text_search_argument COMMA legal_integer {
if ($3 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
$$ = $1;
$$->setLimit($3);
}
| fuzzy_text_search_argument COMMA legal_integer COMMA legal_integer {
if ($3 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@3, "Out of range:");
}
if ($5 < 1) {
delete $1;
throw nebula::GraphParser::syntax_error(@5, "Out of range:");
}
$$ = $1;
$$->setLimit($3);
$$->setTimeout($5);
}
;
text_search_expression
: KW_PREFIX L_PAREN text_search_argument R_PAREN {
if ($3->op() != nullptr) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
if ($3->fuzziness() != -2) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
$$ = new TextSearchExpression(Expression::Kind::kTSPrefix, $3);
}
| KW_WILDCARD L_PAREN text_search_argument R_PAREN {
if ($3->op() != nullptr) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
if ($3->fuzziness() != -2) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
$$ = new TextSearchExpression(Expression::Kind::kTSWildcard, $3);
}
| KW_REGEXP L_PAREN text_search_argument R_PAREN {
if ($3->op() != nullptr) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
if ($3->fuzziness() != -2) {
delete $3;
throw nebula::GraphParser::syntax_error(@3, "argument error:");
}
$$ = new TextSearchExpression(Expression::Kind::kTSRegexp, $3);
}
| KW_FUZZY L_PAREN text_search_argument R_PAREN {
$$ = new TextSearchExpression(Expression::Kind::kTSFuzzy, $3);
}
;
// TODO : unfiy the text_search_expression into expression in the future
// The current version only support independent text_search_expression for lookup_sentence
lookup_where_clause
: %empty { $$ = nullptr; }
| KW_WHERE text_search_expression { $$ = new WhereClause($2); }
| KW_WHERE expression { $$ = new WhereClause($2); }
;
lookup_sentence
: KW_LOOKUP KW_ON name_label where_clause yield_clause {
: KW_LOOKUP KW_ON name_label lookup_where_clause yield_clause {
auto sentence = new LookupSentence($3);
sentence->setWhereClause($4);
sentence->setYieldClause($5);
......@@ -2383,6 +2590,9 @@ show_sentence
| KW_SHOW KW_STATS {
$$ = new ShowStatsSentence();
}
| KW_SHOW KW_TEXT KW_SEARCH KW_CLIENTS {
$$ = new ShowTSClientsSentence();
}
;
config_module_enum
......@@ -2720,7 +2930,6 @@ maintain_sentence
| add_host_into_zone_sentence { $$ = $1; }
| drop_host_from_zone_sentence { $$ = $1; }
| show_sentence { $$ = $1; }
;
| create_user_sentence { $$ = $1; }
| alter_user_sentence { $$ = $1; }
| drop_user_sentence { $$ = $1; }
......@@ -2730,11 +2939,13 @@ maintain_sentence
| get_config_sentence { $$ = $1; }
| set_config_sentence { $$ = $1; }
| balance_sentence { $$ = $1; }
| create_snapshot_sentence { $$ = $1; };
| drop_snapshot_sentence { $$ = $1; };
| add_listener_sentence { $$ = $1; }
| remove_listener_sentence { $$ = $1; }
| list_listener_sentence { $$ = $1; }
| create_snapshot_sentence { $$ = $1; }
| drop_snapshot_sentence { $$ = $1; }
| sign_in_text_search_service_sentence { $$ = $1; }
| sign_out_text_search_service_sentence { $$ = $1; }
;
return_sentence
......
......@@ -222,7 +222,17 @@ IP_OCTET ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])
"INTO" { return TokenType::KW_INTO; }
"LISTENER" { return TokenType::KW_LISTENER; }
"ELASTICSEARCH" { return TokenType::KW_ELASTICSEARCH; }
"AUTO" { return TokenType::KW_AUTO; }
"FUZZY" { return TokenType::KW_FUZZY; }
"PREFIX" { return TokenType::KW_PREFIX; }
"REGEXP" { return TokenType::KW_REGEXP; }
"WILDCARD" { return TokenType::KW_WILDCARD; }
"TEXT" { return TokenType::KW_TEXT; }
"SEARCH" { return TokenType::KW_SEARCH; }
"CLIENTS" { return TokenType::KW_CLIENTS; }
"SIGN" { return TokenType::KW_SIGN; }
"SERVICE" { return TokenType::KW_SERVICE; }
"TEXT_SEARCH" { return TokenType::KW_TEXT_SEARCH; }
"TRUE" { yylval->boolval = true; return TokenType::BOOL; }
"FALSE" { yylval->boolval = false; return TokenType::BOOL; }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment