Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
fix unionAllEdgeIndexScanRule (#1259)
Browse files Browse the repository at this point in the history
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
  • Loading branch information
jievince and yixinglu committed Jul 15, 2021
1 parent 62010cf commit 7c8c878
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/optimizer/OptimizerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ void OptimizerUtils::copyIndexScanData(const nebula::graph::IndexScan* from,
to->setEmptyResultSet(from->isEmptyResultSet());
to->setSpace(from->space());
to->setReturnCols(from->returnColumns());
to->setIsEdge(from->isEdge());
to->setSchemaId(from->schemaId());
to->setDedup(from->dedup());
to->setOrderBy(from->orderBy());
Expand Down
10 changes: 8 additions & 2 deletions src/optimizer/rule/UnionAllIndexScanBaseRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ bool UnionAllIndexScanBaseRule::match(OptContext* ctx, const MatchedResult& matc
StatusOr<TransformResult> UnionAllIndexScanBaseRule::transform(OptContext* ctx,
const MatchedResult& matched) const {
auto filter = static_cast<const Filter*>(matched.planNode());
auto scan = static_cast<const TagIndexFullScan*>(matched.planNode({0, 0}));
auto node = matched.planNode({0, 0});
auto scan = static_cast<const IndexScan*>(node);

auto metaClient = ctx->qctx()->getMetaClient();
auto status = metaClient->getTagIndexesFromCache(scan->space());
StatusOr<std::vector<std::shared_ptr<meta::cpp2::IndexItem>>> status;
if (node->kind() == graph::PlanNode::Kind::kTagIndexFullScan) {
status = metaClient->getTagIndexesFromCache(scan->space());
} else {
status = metaClient->getEdgeIndexesFromCache(scan->space());
}
NG_RETURN_IF_ERROR(status);
auto indexItems = std::move(status).value();

Expand Down

0 comments on commit 7c8c878

Please sign in to comment.