-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6159a4
commit ace38f7
Showing
13 changed files
with
157 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/include/planner/logical_plan/logical_operator/logical_node_label_filter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include "base_logical_operator.h" | ||
|
||
namespace kuzu { | ||
namespace planner { | ||
|
||
class LogicalNodeLabelFilter : public LogicalOperator { | ||
public: | ||
LogicalNodeLabelFilter(std::shared_ptr<binder::Expression> nodeID, | ||
std::unordered_set<common::table_id_t> tableIDSet, std::shared_ptr<LogicalOperator> child) | ||
: LogicalOperator{LogicalOperatorType::NODE_LABEL_FILTER, std::move(child)}, | ||
nodeID{std::move(nodeID)}, tableIDSet{std::move(tableIDSet)} {} | ||
|
||
inline void computeFactorizedSchema() final { copyChildSchema(0); } | ||
inline void computeFlatSchema() final { copyChildSchema(0); } | ||
|
||
inline std::string getExpressionsForPrinting() const final { return nodeID->toString(); } | ||
|
||
inline std::shared_ptr<binder::Expression> getNodeID() const { return nodeID; } | ||
inline std::unordered_set<common::table_id_t> getTableIDSet() const { return tableIDSet; } | ||
|
||
std::unique_ptr<LogicalOperator> copy() final { | ||
return std::make_unique<LogicalNodeLabelFilter>(nodeID, tableIDSet, children[0]->copy()); | ||
} | ||
|
||
private: | ||
std::shared_ptr<binder::Expression> nodeID; | ||
std::unordered_set<common::table_id_t> tableIDSet; | ||
}; | ||
|
||
} // namespace planner | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "planner/logical_plan/logical_operator/logical_node_label_filter.h" | ||
#include "processor/mapper/plan_mapper.h" | ||
#include "processor/operator/filter.h" | ||
|
||
using namespace kuzu::planner; | ||
|
||
namespace kuzu { | ||
namespace processor { | ||
|
||
std::unique_ptr<PhysicalOperator> PlanMapper::mapLogicalNodeLabelFilterToPhysical( | ||
LogicalOperator* logicalOperator) { | ||
auto logicalLabelFilter = (LogicalNodeLabelFilter*)logicalOperator; | ||
auto prevOperator = mapLogicalOperatorToPhysical(logicalOperator->getChild(0)); | ||
auto schema = logicalOperator->getSchema(); | ||
auto nbrNodeVectorPos = DataPos(schema->getExpressionPos(*logicalLabelFilter->getNodeID())); | ||
auto filterInfo = std::make_unique<NodeLabelFilterInfo>( | ||
nbrNodeVectorPos, logicalLabelFilter->getTableIDSet()); | ||
return std::make_unique<NodeLabelFiler>(std::move(filterInfo), std::move(prevOperator), | ||
getOperatorID(), logicalLabelFilter->getExpressionsForPrinting()); | ||
} | ||
|
||
} // namespace processor | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters