-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(primer): S25 P0 starter code (#795)
* p0 starter code + tests Signed-off-by: Yuchen Liang <[email protected]> * ensure header Signed-off-by: Yuchen Liang <[email protected]> * fix header Signed-off-by: Yuchen Liang <[email protected]> * fix lint Signed-off-by: Yuchen Liang <[email protected]> * reserve before emplace loop Signed-off-by: Yuchen Liang <[email protected]> * amend check-public-ci-tests Signed-off-by: Yuchen Liang <[email protected]> * use simulated geometric process; update check-integrity test Signed-off-by: Yuchen Liang <[email protected]> --------- Signed-off-by: Yuchen Liang <[email protected]>
- Loading branch information
Showing
9 changed files
with
800 additions
and
127 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 |
---|---|---|
@@ -1,44 +1,44 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// aggregation_executor.cpp | ||
// | ||
// Identification: src/execution/aggregation_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <memory> | ||
#include <vector> | ||
|
||
#include "execution/executors/aggregation_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new AggregationExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The insert plan to be executed | ||
* @param child_executor The child executor from which inserted tuples are pulled (may be `nullptr`) | ||
*/ | ||
AggregationExecutor::AggregationExecutor(ExecutorContext *exec_ctx, const AggregationPlanNode *plan, | ||
std::unique_ptr<AbstractExecutor> &&child_executor) | ||
: AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the aggregation */ | ||
void AggregationExecutor::Init() {} | ||
|
||
/** | ||
* Yield the next tuple from the insert. | ||
* @param[out] tuple The next tuple produced by the aggregation | ||
* @param[out] rid The next tuple RID produced by the aggregation | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
*/ | ||
auto AggregationExecutor::Next(Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
/** Do not use or remove this function, otherwise you will get zero points. */ | ||
auto AggregationExecutor::GetChildExecutor() const -> const AbstractExecutor * { return child_executor_.get(); } | ||
|
||
} // namespace bustub | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// aggregation_executor.cpp | ||
// | ||
// Identification: src/execution/aggregation_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <memory> | ||
#include <vector> | ||
|
||
#include "execution/executors/aggregation_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new AggregationExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The insert plan to be executed | ||
* @param child_executor The child executor from which inserted tuples are pulled (may be `nullptr`) | ||
*/ | ||
AggregationExecutor::AggregationExecutor(ExecutorContext *exec_ctx, const AggregationPlanNode *plan, | ||
std::unique_ptr<AbstractExecutor> &&child_executor) | ||
: AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the aggregation */ | ||
void AggregationExecutor::Init() {} | ||
|
||
/** | ||
* Yield the next tuple from the insert. | ||
* @param[out] tuple The next tuple produced by the aggregation | ||
* @param[out] rid The next tuple RID produced by the aggregation | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
*/ | ||
auto AggregationExecutor::Next(Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
/** Do not use or remove this function, otherwise you will get zero points. */ | ||
auto AggregationExecutor::GetChildExecutor() const -> const AbstractExecutor * { return child_executor_.get(); } | ||
|
||
} // namespace bustub |
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 |
---|---|---|
@@ -1,43 +1,43 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// insert_executor.cpp | ||
// | ||
// Identification: src/execution/insert_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <memory> | ||
|
||
#include "execution/executors/insert_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new InsertExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The insert plan to be executed | ||
* @param child_executor The child executor from which inserted tuples are pulled | ||
*/ | ||
InsertExecutor::InsertExecutor(ExecutorContext *exec_ctx, const InsertPlanNode *plan, | ||
std::unique_ptr<AbstractExecutor> &&child_executor) | ||
: AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the insert */ | ||
void InsertExecutor::Init() { throw NotImplementedException("InsertExecutor is not implemented"); } | ||
|
||
/** | ||
* Yield the number of rows inserted into the table. | ||
* @param[out] tuple The integer tuple indicating the number of rows inserted into the table | ||
* @param[out] rid The next tuple RID produced by the insert (ignore, not used) | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
* | ||
* NOTE: InsertExecutor::Next() does not use the `rid` out-parameter. | ||
* NOTE: InsertExecutor::Next() returns true with number of inserted rows produced only once. | ||
*/ | ||
auto InsertExecutor::Next([[maybe_unused]] Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
} // namespace bustub | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// insert_executor.cpp | ||
// | ||
// Identification: src/execution/insert_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <memory> | ||
|
||
#include "execution/executors/insert_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new InsertExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The insert plan to be executed | ||
* @param child_executor The child executor from which inserted tuples are pulled | ||
*/ | ||
InsertExecutor::InsertExecutor(ExecutorContext *exec_ctx, const InsertPlanNode *plan, | ||
std::unique_ptr<AbstractExecutor> &&child_executor) | ||
: AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the insert */ | ||
void InsertExecutor::Init() { throw NotImplementedException("InsertExecutor is not implemented"); } | ||
|
||
/** | ||
* Yield the number of rows inserted into the table. | ||
* @param[out] tuple The integer tuple indicating the number of rows inserted into the table | ||
* @param[out] rid The next tuple RID produced by the insert (ignore, not used) | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
* | ||
* NOTE: InsertExecutor::Next() does not use the `rid` out-parameter. | ||
* NOTE: InsertExecutor::Next() returns true with number of inserted rows produced only once. | ||
*/ | ||
auto InsertExecutor::Next([[maybe_unused]] Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
} // namespace bustub |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// seq_scan_executor.cpp | ||
// | ||
// Identification: src/execution/seq_scan_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "execution/executors/seq_scan_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new SeqScanExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The sequential scan plan to be executed | ||
*/ | ||
SeqScanExecutor::SeqScanExecutor(ExecutorContext *exec_ctx, const SeqScanPlanNode *plan) : AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the sequential scan */ | ||
void SeqScanExecutor::Init() { throw NotImplementedException("SeqScanExecutor is not implemented"); } | ||
|
||
/** | ||
* Yield the next tuple from the sequential scan. | ||
* @param[out] tuple The next tuple produced by the scan | ||
* @param[out] rid The next tuple RID produced by the scan | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
*/ | ||
auto SeqScanExecutor::Next(Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
} // namespace bustub | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// BusTub | ||
// | ||
// seq_scan_executor.cpp | ||
// | ||
// Identification: src/execution/seq_scan_executor.cpp | ||
// | ||
// Copyright (c) 2015-2025, Carnegie Mellon University Database Group | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "execution/executors/seq_scan_executor.h" | ||
|
||
namespace bustub { | ||
|
||
/** | ||
* Construct a new SeqScanExecutor instance. | ||
* @param exec_ctx The executor context | ||
* @param plan The sequential scan plan to be executed | ||
*/ | ||
SeqScanExecutor::SeqScanExecutor(ExecutorContext *exec_ctx, const SeqScanPlanNode *plan) : AbstractExecutor(exec_ctx) {} | ||
|
||
/** Initialize the sequential scan */ | ||
void SeqScanExecutor::Init() { throw NotImplementedException("SeqScanExecutor is not implemented"); } | ||
|
||
/** | ||
* Yield the next tuple from the sequential scan. | ||
* @param[out] tuple The next tuple produced by the scan | ||
* @param[out] rid The next tuple RID produced by the scan | ||
* @return `true` if a tuple was produced, `false` if there are no more tuples | ||
*/ | ||
auto SeqScanExecutor::Next(Tuple *tuple, RID *rid) -> bool { return false; } | ||
|
||
} // namespace bustub |
Oops, something went wrong.