Skip to content

Commit

Permalink
Revert "Enhancement/optimize edge all predicate (vesoft-inc#2576)" (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie-Xie committed Apr 10, 2023
1 parent 087b3b0 commit 3a9df7c
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 671 deletions.
8 changes: 2 additions & 6 deletions src/graph/executor/query/TraverseExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ Status TraverseExecutor::buildRequestVids() {
auto vidType = SchemaUtil::propTypeToValueType(metaVidType.get_type());
for (; iter->valid(); iter->next()) {
const auto& vid = src->eval(ctx(iter));
// FIXME(czp): Remove this DCHECK for now, we should check vid type at compile-time
if (vid.type() != vidType) {
return Status::Error("Vid type mismatched.");
}
// DCHECK_EQ(vid.type(), vidType)
// << "Mismatched vid type: " << vid.type() << ", space vid type: " << vidType;
DCHECK_EQ(vid.type(), vidType)
<< "Mismatched vid type: " << vid.type() << ", space vid type: " << vidType;
if (vid.type() == vidType) {
vids_.emplace(vid);
}
Expand Down
4 changes: 1 addition & 3 deletions src/graph/optimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ nebula_add_library(
rule/PushFilterDownInnerJoinRule.cpp
rule/PushFilterDownNodeRule.cpp
rule/PushFilterDownScanVerticesRule.cpp
rule/PushFilterDownTraverseRule.cpp
rule/PushVFilterDownScanVerticesRule.cpp
rule/OptimizeEdgeIndexScanByFilterRule.cpp
rule/OptimizeTagIndexScanByFilterRule.cpp
Expand All @@ -61,9 +60,8 @@ nebula_add_library(
rule/PushLimitDownTraverseRule.cpp
rule/PushLimitDownAppendVerticesRule.cpp
rule/PushLimitDownScanEdgesRule.cpp
rule/PushFilterThroughAppendVerticesRule.cpp
rule/PushFilterDownTraverseRule.cpp
rule/RemoveAppendVerticesBelowJoinRule.cpp
rule/EmbedEdgeAllPredIntoTraverseRule.cpp
rule/PushFilterThroughAppendVerticesRule.cpp
)

Expand Down
220 changes: 0 additions & 220 deletions src/graph/optimizer/rule/EmbedEdgeAllPredIntoTraverseRule.cpp

This file was deleted.

39 changes: 0 additions & 39 deletions src/graph/optimizer/rule/EmbedEdgeAllPredIntoTraverseRule.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/graph/optimizer/rule/GeoPredicateIndexScanBaseRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ StatusOr<TransformResult> GeoPredicateIndexScanBaseRule::transform(
}
TransformResult result;
result.newGroupNodes.emplace_back(optScanNode);
result.eraseAll = true;
result.eraseCurr = true;
return result;
}

Expand Down
40 changes: 0 additions & 40 deletions src/graph/util/ExpressionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,11 +1038,6 @@ void ExpressionUtils::splitFilter(const Expression *expr,

std::vector<Expression *> &operands = logicExpr->operands();
for (auto &operand : operands) {
// TODO(czp): Sink all NOTs to second layer [[Refactor]]
// TODO(czp): If find any not, dont pick this operand for now
if (ExpressionUtils::findAny(operand, {Expression::Kind::kUnaryNot})) {
filterUnpickedPtr->addOperand(operand->clone());
}
if (picker(operand)) {
filterPickedPtr->addOperand(operand->clone());
} else {
Expand Down Expand Up @@ -1708,40 +1703,5 @@ bool ExpressionUtils::isOneStepEdgeProp(const std::string &edgeAlias, const Expr
return graph::RewriteVisitor::transform(expr, matcher, rewriter);
}

// Transform Label Tag property expression like $-.v.player.name to Tag property like player.name
// for more friendly to push down
// \param pool object pool to hold ownership of objects alloacted
// \param node the name of node, i.e. v in pattern (v)
// \param expr the filter expression
/*static*/ Expression *ExpressionUtils::rewriteVertexPropertyFilter(ObjectPool *pool,
const std::string &node,
Expression *expr) {
graph::RewriteVisitor::Matcher matcher = [&node](const Expression *e) -> bool {
if (e->kind() != Expression::Kind::kLabelTagProperty) {
return false;
}
auto *ltpExpr = static_cast<const LabelTagPropertyExpression *>(e);
auto *labelExpr = ltpExpr->label();
DCHECK(labelExpr->kind() == Expression::Kind::kInputProperty ||
labelExpr->kind() == Expression::Kind::kVarProperty);
if (labelExpr->kind() != Expression::Kind::kInputProperty &&
labelExpr->kind() != Expression::Kind::kVarProperty) {
return false;
}
auto *inputExpr = static_cast<const PropertyExpression *>(labelExpr);
if (inputExpr->prop() != node) {
return false;
}
return true;
};
graph::RewriteVisitor::Rewriter rewriter = [pool](const Expression *e) -> Expression * {
DCHECK_EQ(e->kind(), Expression::Kind::kLabelTagProperty);
auto *ltpExpr = static_cast<const LabelTagPropertyExpression *>(e);
auto *tagPropExpr = TagPropertyExpression::make(pool, ltpExpr->sym(), ltpExpr->prop());
return tagPropExpr;
};
return graph::RewriteVisitor::transform(expr, matcher, rewriter);
}

} // namespace graph
} // namespace nebula
4 changes: 0 additions & 4 deletions src/graph/util/ExpressionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ class ExpressionUtils {
static Expression* rewriteEdgePropertyFilter(ObjectPool* pool,
const std::string& edgeAlias,
Expression* expr);

static Expression* rewriteVertexPropertyFilter(ObjectPool* pool,
const std::string& node,
Expression* expr);
};

} // namespace graph
Expand Down
Loading

0 comments on commit 3a9df7c

Please sign in to comment.