-
Notifications
You must be signed in to change notification settings - Fork 503
Porting Logical Operators
This is originally from PR #232.
Bring over logical and physical operators from Peloton. These objects are direct inputs to the optimizer. These objects are constructed by the binder from parser expressions.
The original operators are in:
- https://github.com/cmu-db/peloton/blob/master/src/include/optimizer/operators.h
- https://github.com/cmu-db/peloton/blob/master/src/optimizer/operators.cpp
The physical operators have been ported over already. The ones that remain are some logical operators. They are:
- LogicalFilter
- LogicalProjection
- LogicalDependentJoin
- LogicalMarkJoin
- LogicalSingleJoin
- LogicalInnerJoin
- LogicalLeftJoin
- LogicalRightJoin
- LogicalOuterJoin
- LogicalSemiJoin
- LogicalAggregateAndGroupBy
- LogicalInsertSelect
- LogicalInsert
- LogicalMarkJoin
- LogicalDependentJoin
- LogicalSIngleJoin
- LogicalInnerJoin
- LogicalLeftJoin
- LogicalRightJoin
- LogicalOuterJoin
- LogicalSemiJoin
- LogicalAggregateAndGroupBy
- LogicalInsert
- LogicalInsertSelect
- LogicalDelete
- LogicalUpdate
- LogicalLimit
- LogicalDistinct
- LogicalExportExternalFile
Clone my repository git clone git@github.com:wenxuanqiu/terrier.git
Then modify only src/include/operators.h
and src/include/operators.cpp
. Find the operator you want to work on, then do the following:
- Copy the corresponding Peloton operator over. Currently, all the operators that Peloton had are in
src/include/operator.h
, but notsrc/include/operator.cpp
. - Make it compile by changing a number of things:
- expression::AbstractExpression -> parser::AbstractionExpression
-
hash_t
->common::hash_t
- string reference to value
std::string &
->std::string
then usestd::move
in constructor definition (operator.cpp) - replace
std::shared_ptr<catalog::TableCatalogEntry>
target_table withcatalog::db_oid_t database_oid
,catalog::namespace_oid_t namespace_oid
,catalog::table_oid_t table_oid
- vector reference to lvalue:
std::vector<std::shared_ptr<expression::AbstractExpression>> &columns
->std::vector<std::shared_ptr<parser::AbstractExpression>> &&columns
then usestd::move
in constructor definition (operator.cpp) - other case by case changes
- Make the class members private and append '_' suffix to indicate that
- Add oxygen comments
- Implement the constructor, Hash, and operator in operators.cpp. Some examples are in the file.
- Fix remaining clang-tidy problems that show up due to
check clang-tidy
- Commit the change
We need DDL statements such as CREATE and DROP to have operators as well. So we need to create them, some of them might have logical and physical versions. For example, LogicalCreateIndex
vs. CreateBwTreeIndex
, CreateHashIndex
, CreateAVLIndex
. These operators must have the same interface as the existing operators.
Carnegie Mellon Database Group Website