@@ -24,17 +24,15 @@ namespace bustub {
2424
2525/* *
2626 * 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.
3028 */
3129class InsertExecutor : public AbstractExecutor {
3230 public:
3331 /* *
3432 * Construct a new InsertExecutor instance.
3533 * @param exec_ctx The executor context
3634 * @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
3836 */
3937 InsertExecutor (ExecutorContext *exec_ctx, const InsertPlanNode *plan,
4038 std::unique_ptr<AbstractExecutor> &&child_executor);
@@ -43,13 +41,13 @@ class InsertExecutor : public AbstractExecutor {
4341 void Init () override ;
4442
4543 /* *
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)
4947 * @return `true` if a tuple was produced, `false` if there are no more tuples
5048 *
51- * NOTE: InsertExecutor::Next() does not use the `tuple` out-parameter.
5249 * NOTE: InsertExecutor::Next() does not use the `rid` out-parameter.
50+ * NOTE: InsertExecutor::Next() returns true with number of inserted rows produced only once
5351 */
5452 auto Next ([[maybe_unused]] Tuple *tuple, RID *rid) -> bool override ;
5553
0 commit comments