Skip to content

Commit

Permalink
Update tck tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed May 16, 2023
1 parent 783cfda commit e860a25
Show file tree
Hide file tree
Showing 4 changed files with 525 additions and 47 deletions.
11 changes: 7 additions & 4 deletions src/graph/executor/query/IndexScanExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ folly::Future<Status> IndexScanExecutor::indexScan() {
auto filterStr = lookup->queryContext().front().get_filter();
Expression *filter = Expression::decode(qctx()->objPool(), filterStr);
if (filter->kind() != Expression::Kind::kRelEQ && filter->kind() != Expression::Kind::kRelIn) {
return Status::Error("The kind of filter expression is invalid.");
return Status::Error("The kind of filter expression is invalid: %s",
filter->toString().c_str());
}
auto relFilter = static_cast<const RelationalExpression *>(filter);
if (relFilter->right()->kind() != Expression::Kind::kLabel) {
return Status::Error("The kind of expression is not label expression.");
auto right = DCHECK_NOTNULL(relFilter->right());
if (right->kind() != Expression::Kind::kLabel) {
return Status::Error("The kind of expression is not label expression: %s",
right->toString().c_str());
}
const auto &colName = static_cast<const LabelExpression *>(relFilter->right())->name();
const auto &colName = static_cast<const LabelExpression *>(right)->name();
const auto &result = ectx_->getResult(lookup->inputVar());
std::vector<Expression *> ops;
std::unordered_set<Value> unique;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/planner/PlannersRegister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "graph/planner/match/PropIndexSeek.h"
#include "graph/planner/match/ScanSeek.h"
#include "graph/planner/match/StartVidFinder.h"
#include "graph/planner/match/VariableVertexIdSeek.h"
#include "graph/planner/match/VariablePropIndexSeek.h"
#include "graph/planner/match/VariableVertexIdSeek.h"
#include "graph/planner/match/VertexIdSeek.h"
#include "graph/planner/ngql/FetchEdgesPlanner.h"
#include "graph/planner/ngql/FetchVerticesPlanner.h"
Expand Down
8 changes: 6 additions & 2 deletions src/graph/util/OptimizerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ Status OptimizerUtils::createIndexQueryCtx(Expression* filter,
if (!filter) {
// Only filter is nullptr when lookup on tagname
// Degenerate back to tag lookup
NG_RETURN_IF_ERROR(createIndexQueryCtx(iqctx, qctx, node));
return createIndexQueryCtx(iqctx, qctx, node);
}

// items used for optimal index fetch and index scan context optimize.
Expand All @@ -926,7 +926,11 @@ Status OptimizerUtils::createIndexQueryCtx(Expression* filter,
// TODO: refactor index selector logic to avoid this rewriting
auto* newFilter = ExpressionUtils::rewriteParameter(filter, qctx);
NG_RETURN_IF_ERROR(analyzeExpression(newFilter, &items, &kind, node->isEdge(), qctx));
return createIndexQueryCtx(iqctx, kind, items, qctx, node);
auto status = createIndexQueryCtx(iqctx, kind, items, qctx, node);
if (!status.ok()) {
return createIndexQueryCtx(iqctx, qctx, node);
}
return Status::OK();
}

Status OptimizerUtils::createIndexQueryCtx(std::vector<IndexQueryContext>& iqctx,
Expand Down
Loading

0 comments on commit e860a25

Please sign in to comment.