-
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
e704660
commit 5e2c8e3
Showing
30 changed files
with
256 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "binder/binder.h" | ||
#include "binder/bound_explain.h" | ||
#include "parser/explain_statement.h" | ||
|
||
namespace kuzu { | ||
namespace binder { | ||
|
||
std::unique_ptr<BoundStatement> Binder::bindExplain(const parser::Statement& statement) { | ||
auto& explainStatement = (parser::ExplainStatement&)statement; | ||
auto boundStatementToExplain = bind(*explainStatement.getStatementToExplain()); | ||
return std::make_unique<BoundExplain>(std::move(boundStatementToExplain)); | ||
} | ||
|
||
} // namespace binder | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "binder/bound_statement.h" | ||
|
||
namespace kuzu { | ||
namespace binder { | ||
|
||
class BoundExplain : public BoundStatement { | ||
public: | ||
explicit BoundExplain(std::unique_ptr<BoundStatement> statementToExplain) | ||
: BoundStatement{common::StatementType::EXPLAIN, | ||
BoundStatementResult::createSingleStringColumnResult()}, | ||
statementToExplain{std::move(statementToExplain)} {} | ||
|
||
inline BoundStatement* getStatementToExplain() const { return statementToExplain.get(); } | ||
|
||
private: | ||
std::unique_ptr<BoundStatement> statementToExplain; | ||
}; | ||
|
||
} // namespace binder | ||
} // 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,21 @@ | ||
#pragma once | ||
|
||
#include "parser/statement.h" | ||
|
||
namespace kuzu { | ||
namespace parser { | ||
|
||
class ExplainStatement : public Statement { | ||
public: | ||
explicit ExplainStatement(std::unique_ptr<Statement> statementToExplain) | ||
: Statement{common::StatementType::EXPLAIN}, statementToExplain{ | ||
std::move(statementToExplain)} {} | ||
|
||
inline Statement* getStatementToExplain() const { return statementToExplain.get(); } | ||
|
||
private: | ||
std::unique_ptr<Statement> statementToExplain; | ||
}; | ||
|
||
} // namespace parser | ||
} // 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
33 changes: 33 additions & 0 deletions
33
src/include/planner/logical_plan/logical_operator/logical_explain.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 LogicalExplain : public LogicalOperator { | ||
public: | ||
LogicalExplain(std::shared_ptr<LogicalOperator> child, | ||
std::shared_ptr<binder::Expression> outputExpression) | ||
: LogicalOperator{LogicalOperatorType::EXPLAIN, child}, outputExpression{ | ||
std::move(outputExpression)} {} | ||
|
||
void computeFactorizedSchema() override; | ||
void computeFlatSchema() override; | ||
|
||
inline std::shared_ptr<binder::Expression> getOutputExpression() const { | ||
return outputExpression; | ||
} | ||
|
||
inline std::string getExpressionsForPrinting() const override { return "Explain"; } | ||
|
||
inline std::unique_ptr<LogicalOperator> copy() override { | ||
return std::make_unique<LogicalExplain>(children[0], outputExpression); | ||
} | ||
|
||
protected: | ||
std::shared_ptr<binder::Expression> outputExpression; | ||
}; | ||
|
||
} // 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
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
Oops, something went wrong.