jiaqizho commented on code in PR #1241:
URL: https://github.com/apache/cloudberry/pull/1241#discussion_r2244192355


##########
src/backend/access/aocs/aocsam.c:
##########
@@ -467,6 +472,46 @@ close_cur_scan_seg(AOCSScanDesc scan)
                AppendOnlyBlockDirectory_End_forInsert(scan->blockDirectory);
 }
 
+static void
+aocs_blkdirscan_init(AOCSScanDesc scan)
+{
+       if (scan->aocsfetch == NULL)
+       {
+               int natts = RelationGetNumberOfAttributes(scan->rs_base.rs_rd);
+               scan->proj = palloc(natts * sizeof(*scan->proj));
+               MemSet(scan->proj, true, natts * sizeof(*scan->proj));
+
+               scan->aocsfetch = aocs_fetch_init(scan->rs_base.rs_rd,
+                                                                               
  scan->rs_base.rs_snapshot,
+                                                                               
  scan->appendOnlyMetaDataSnapshot,
+                                                                               
  scan->proj);
+       }
+
+       scan->blkdirscan = palloc0(sizeof(AOBlkDirScanData));
+       AOBlkDirScan_Init(scan->blkdirscan, &scan->aocsfetch->blockDirectory);
+}
+
+static void
+aocs_blkdirscan_finish(AOCSScanDesc scan)
+{
+       AOBlkDirScan_Finish(scan->blkdirscan);
+       pfree(scan->blkdirscan);

Review Comment:
   can move L498-L499 into `AOBlkDirScan_Finish`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org
For additional commands, e-mail: commits-h...@cloudberry.apache.org

Reply via email to