Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Jun 21, 2023
1 parent 08c550f commit 56828dd
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/include/optimizer/acc_hash_join_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HashJoinSIPOptimizer : public LogicalOperatorVisitor {

void visitIntersect(planner::LogicalOperator* op) override;

void visitPathPropertyProbe(planner::LogicalOperator *op) override;
void visitPathPropertyProbe(planner::LogicalOperator* op) override;

bool isProbeSideQualified(planner::LogicalOperator* probeRoot);

Expand Down
2 changes: 1 addition & 1 deletion src/include/optimizer/projection_push_down_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProjectionPushDownOptimizer : public LogicalOperatorVisitor {
private:
void visitOperator(planner::LogicalOperator* op);

void visitPathPropertyProbe(planner::LogicalOperator *op) override;
void visitPathPropertyProbe(planner::LogicalOperator* op) override;
void visitExtend(planner::LogicalOperator* op) override;
void visitAccumulate(planner::LogicalOperator* op) override;
void visitFilter(planner::LogicalOperator* op) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LogicalSemiMasker : public LogicalOperator {
inline std::vector<LogicalOperator*> getOperators() const { return ops; }

inline std::unique_ptr<LogicalOperator> copy() override {
assert(false);
throw common::RuntimeException("LogicalSemiMasker::copy() should not be called.");
}

private:
Expand Down
4 changes: 2 additions & 2 deletions src/include/processor/operator/semi_masker.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class PathSingleTableSemiMasker : public PathSemiMasker {
std::unique_ptr<PhysicalOperator> child, uint32_t id, const std::string& paramsString)
: PathSemiMasker{std::move(info), std::move(child), id, paramsString} {}

bool getNextTuplesInternal(ExecutionContext *context) override;
bool getNextTuplesInternal(ExecutionContext* context) final;

inline std::unique_ptr<PhysicalOperator> clone() final {
return std::make_unique<PathSingleTableSemiMasker>(
Expand All @@ -114,7 +114,7 @@ class PathMultipleTableSemiMasker : public PathSemiMasker {
std::unique_ptr<PhysicalOperator> child, uint32_t id, const std::string& paramsString)
: PathSemiMasker{std::move(info), std::move(child), id, paramsString} {}

bool getNextTuplesInternal(ExecutionContext *context) override;
bool getNextTuplesInternal(ExecutionContext* context) final;

inline std::unique_ptr<PhysicalOperator> clone() final {
return std::make_unique<PathMultipleTableSemiMasker>(
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/acc_hash_join_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void HashJoinSIPOptimizer::visitPathPropertyProbe(planner::LogicalOperator* op)
if (pathPropertyProbe->getSIP() == planner::SidewaysInfoPassing::PROHIBIT_PROBE_TO_BUILD) {
return;
}
if (pathPropertyProbe->getNumChildren() == 1) { // No
if (pathPropertyProbe->getNumChildren() == 1) { // No path being tracked.
return;
}
auto recursiveRel = pathPropertyProbe->getRel();
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/logical_operator_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void LogicalOperatorVisitor::visitOperatorSwitch(planner::LogicalOperator* op) {
} break;
case LogicalOperatorType::PATH_PROPERTY_PROBE: {
visitPathPropertyProbe(op);
} break ;
} break;
case LogicalOperatorType::HASH_JOIN: {
visitHashJoin(op);
} break;
Expand Down
1 change: 1 addition & 0 deletions src/optimizer/projection_push_down_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void ProjectionPushDownOptimizer::visitPathPropertyProbe(planner::LogicalOperato
auto recursiveInfo = rel->getRecursiveInfo();
if (!variablesInUse.contains(rel)) {
recursiveExtend->setJoinType(planner::RecursiveJoinType::TRACK_NONE);
// TODO(Xiyang): we should remove pathPropertyProbe if we don't need to track path
pathPropertyProbe->setChildren(
std::vector<std::shared_ptr<LogicalOperator>>{pathPropertyProbe->getChild(0)});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/planner/join_order/append_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void JoinOrderEnumerator::appendRecursiveExtend(std::shared_ptr<NodeExpression>
// Update cardinality
auto hasAtMostOneNbr = extendHasAtMostOneNbrGuarantee(*rel, *boundNode, direction, catalog);
if (!hasAtMostOneNbr) {
auto group = extend->getSchema()->getGroup(nbrNode->getInternalIDProperty());
auto group = pathPropertyProbe->getSchema()->getGroup(nbrNode->getInternalIDProperty());
group->setMultiplier(extensionRate);
}
plan.setLastOperator(std::move(pathPropertyProbe));
Expand Down
2 changes: 1 addition & 1 deletion src/planner/join_order/append_join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ void JoinOrderEnumerator::appendIntersect(const std::shared_ptr<Expression>& int
}

} // namespace planner
} // namespace kuzu
} // namespace kuzu
4 changes: 2 additions & 2 deletions src/processor/mapper/map_path_property_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ std::unique_ptr<PhysicalOperator> PlanMapper::mapLogicalPathPropertyProbeToPhysi
auto relBuild = std::make_unique<HashJoinBuild>(
std::make_unique<ResultSetDescriptor>(relBuildSchema), relBuildSharedState,
std::move(relBuildInfo), std::move(relBuildPrvOperator), getOperatorID(), "");
// Map recursive join
// Map child
auto prevOperator = mapLogicalOperatorToPhysical(logicalOperator->getChild(0));
// Map probe
auto relDataType = rel->getDataType();
Expand Down Expand Up @@ -90,4 +90,4 @@ std::unique_ptr<PhysicalOperator> PlanMapper::mapLogicalPathPropertyProbeToPhysi
}

} // namespace processor
} // namespace kuzu
} // namespace kuzu
7 changes: 0 additions & 7 deletions src/processor/mapper/map_semi_masker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ std::unique_ptr<PhysicalOperator> PlanMapper::mapLogicalSemiMaskerToPhysical(
tableState->getSemiMask(), 0 /* initial mask idx */);
}
} break;
case PhysicalOperatorType::PATH_PROPERTY_PROBE: {
auto recursiveJoin = (RecursiveJoin*)physicalOp->getChild(0);
for (auto& semiMask : recursiveJoin->getSharedState()->semiMasks) {
auto tableID = semiMask->getNodeTable()->getTableID();
masksPerTable.at(tableID).emplace_back(semiMask.get(), 0 /* initial mask idx */);
}
} break;
case PhysicalOperatorType::RECURSIVE_JOIN: {
auto recursiveJoin = (RecursiveJoin*)physicalOp;
for (auto& semiMask : recursiveJoin->getSharedState()->semiMasks) {
Expand Down
2 changes: 1 addition & 1 deletion src/processor/mapper/plan_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ std::unique_ptr<PhysicalOperator> PlanMapper::mapLogicalOperatorToPhysical(
} break;
case LogicalOperatorType::PATH_PROPERTY_PROBE: {
physicalOperator = mapLogicalPathPropertyProbeToPhysical(logicalOperator.get());
} break ;
} break;
case LogicalOperatorType::FLATTEN: {
physicalOperator = mapLogicalFlattenToPhysical(logicalOperator.get());
} break;
Expand Down

0 comments on commit 56828dd

Please sign in to comment.