-
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.
Merge pull request #1114 from kuzudb/unlabeled-query
Unlabeled query
- Loading branch information
Showing
22 changed files
with
213 additions
and
116 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
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,34 @@ | ||
#pragma once | ||
|
||
#include "expression.h" | ||
|
||
namespace kuzu { | ||
namespace binder { | ||
|
||
class NodeOrRelExpression : public Expression { | ||
public: | ||
NodeOrRelExpression( | ||
DataTypeID dataTypeID, const string& uniqueName, vector<table_id_t> tableIDs) | ||
: Expression{VARIABLE, dataTypeID, uniqueName}, tableIDs{std::move(tableIDs)} {} | ||
|
||
inline void addTableIDs(const vector<table_id_t>& tableIDsToAdd) { | ||
auto tableIDsMap = unordered_set<table_id_t>(tableIDs.begin(), tableIDs.end()); | ||
for (auto tableID : tableIDsToAdd) { | ||
if (!tableIDsMap.contains(tableID)) { | ||
tableIDs.push_back(tableID); | ||
} | ||
} | ||
} | ||
inline bool isMultiLabeled() const { return tableIDs.size() > 1; } | ||
inline vector<table_id_t> getTableIDs() const { return tableIDs; } | ||
inline table_id_t getSingleTableID() const { | ||
assert(tableIDs.size() == 1); | ||
return tableIDs[0]; | ||
} | ||
|
||
protected: | ||
vector<table_id_t> tableIDs; | ||
}; | ||
|
||
} // 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
Oops, something went wrong.