Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minor] Delete some fatals and comment some CHECKs #5439

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/graph/visitor/DeduceTypeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ void DeduceTypeVisitor::visit(UnaryExpression *expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid unary expression kind: " << static_cast<uint8_t>(expr->kind());
std::stringstream ss;
ss << "`" << expr->toString() << "' is invalid unary expression, kind is "
<< static_cast<uint8_t>(expr->kind()) << ".";
Expand Down Expand Up @@ -284,7 +283,6 @@ void DeduceTypeVisitor::visit(ArithmeticExpression *expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid arithmetic expression kind: " << static_cast<uint8_t>(expr->kind());
std::stringstream ss;
ss << "`" << expr->toString() << "' is invalid arithmetic expression, kind is "
<< static_cast<uint8_t>(expr->kind()) << ".";
Expand Down Expand Up @@ -430,7 +428,6 @@ void DeduceTypeVisitor::visit(LogicalExpression *expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid logical expression kind: " << static_cast<uint8_t>(expr->kind());
std::stringstream ss;
ss << "`" << expr->toString() << "' is invalid logical expression, kind is "
<< static_cast<uint8_t>(expr->kind()) << ".";
Expand Down
3 changes: 0 additions & 3 deletions src/graph/visitor/ExtractPropExprVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ void ExtractPropExprVisitor::visit(UnaryExpression* expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid Kind " << expr->kind();
reportError(expr);
}
}
Expand All @@ -109,7 +108,6 @@ void ExtractPropExprVisitor::visitPropertyExpr(PropertyExpression* expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid Kind " << expr->kind();
reportError(expr);
return;
}
Expand Down Expand Up @@ -163,7 +161,6 @@ void ExtractPropExprVisitor::visitVertexEdgePropExpr(PropertyExpression* expr) {
break;
}
default: {
DLOG(FATAL) << "Invalid Kind " << expr->kind();
reportError(expr);
return;
}
Expand Down
10 changes: 7 additions & 3 deletions src/graph/visitor/PrunePropertiesVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ void PrunePropertiesVisitor::visit(Traverse *node) {

void PrunePropertiesVisitor::visitCurrent(Traverse *node) {
auto &colNames = node->colNames();
// The number of output columns of the Traverse operator is at least two(starting point and edge),
// which is by design.
DCHECK_GE(colNames.size(), 2);
auto &nodeAlias = colNames[colNames.size() - 2];
auto &edgeAlias = colNames.back();
Expand All @@ -237,6 +239,8 @@ void PrunePropertiesVisitor::visitCurrent(Traverse *node) {

void PrunePropertiesVisitor::pruneCurrent(Traverse *node) {
auto &colNames = node->colNames();
// The number of output columns of the Traverse operator is at least two(starting point and edge),
// which is by design.
DCHECK_GE(colNames.size(), 2);
auto &nodeAlias = colNames[colNames.size() - 2];
auto &edgeAlias = colNames.back();
Expand Down Expand Up @@ -447,11 +451,11 @@ void PrunePropertiesVisitor::visit(HashJoin *node) {
}

void PrunePropertiesVisitor::visit(CrossJoin *node) {
status_ = pruneMultiBranch(node->dependencies());
status_ = pruneBinaryBranch(node->dependencies());
}

void PrunePropertiesVisitor::visit(Union *node) {
status_ = pruneMultiBranch(node->dependencies());
status_ = pruneBinaryBranch(node->dependencies());
}

void PrunePropertiesVisitor::visit(Unwind *node) {
Expand All @@ -473,7 +477,7 @@ void PrunePropertiesVisitor::visitCurrent(Unwind *node) {
}
}

Status PrunePropertiesVisitor::pruneMultiBranch(std::vector<const PlanNode *> &dependencies) {
Status PrunePropertiesVisitor::pruneBinaryBranch(std::vector<const PlanNode *> &dependencies) {
DCHECK_EQ(dependencies.size(), 2);
auto rightPropsUsed = propsUsed_;
auto *leftDep = dependencies.front();
Expand Down
2 changes: 1 addition & 1 deletion src/graph/visitor/PrunePropertiesVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PrunePropertiesVisitor final : public PlanNodeVisitor {

private:
Status depsPruneProperties(std::vector<const PlanNode *> &dependencies);
Status pruneMultiBranch(std::vector<const PlanNode *> &dependencies);
Status pruneBinaryBranch(std::vector<const PlanNode *> &dependencies);
Status extractPropsFromExpr(const Expression *expr, const std::string &entityAlias = "");

PropertyTracker &propsUsed_;
Expand Down