@@ -24,17 +24,15 @@ namespace bustub {
24
24
25
25
/* *
26
26
* InsertExecutor executes an insert on a table.
27
- *
28
- * Unlike UPDATE and DELETE, inserted values may either be
29
- * embedded in the plan itself or be pulled from a child executor.
27
+ * Inserted values are always pulled from a child executor.
30
28
*/
31
29
class InsertExecutor : public AbstractExecutor {
32
30
public:
33
31
/* *
34
32
* Construct a new InsertExecutor instance.
35
33
* @param exec_ctx The executor context
36
34
* @param plan The insert plan to be executed
37
- * @param child_executor The child executor from which inserted tuples are pulled (may be `nullptr`)
35
+ * @param child_executor The child executor from which inserted tuples are pulled
38
36
*/
39
37
InsertExecutor (ExecutorContext *exec_ctx, const InsertPlanNode *plan,
40
38
std::unique_ptr<AbstractExecutor> &&child_executor);
@@ -43,13 +41,13 @@ class InsertExecutor : public AbstractExecutor {
43
41
void Init () override ;
44
42
45
43
/* *
46
- * Yield the next tuple from the insert .
47
- * @param[out] tuple The next tuple produced by the insert
48
- * @param[out] rid The next tuple RID produced by the insert
44
+ * Yield the number of rows inserted into the table .
45
+ * @param[out] tuple The integer tuple indicating the number of rows inserted into the table
46
+ * @param[out] rid The next tuple RID produced by the insert (ignore, not used)
49
47
* @return `true` if a tuple was produced, `false` if there are no more tuples
50
48
*
51
- * NOTE: InsertExecutor::Next() does not use the `tuple` out-parameter.
52
49
* NOTE: InsertExecutor::Next() does not use the `rid` out-parameter.
50
+ * NOTE: InsertExecutor::Next() returns true with number of inserted rows produced only once
53
51
*/
54
52
auto Next ([[maybe_unused]] Tuple *tuple, RID *rid) -> bool override ;
55
53
0 commit comments