yjhjstz commented on code in PR #1241: URL: https://github.com/apache/cloudberry/pull/1241#discussion_r2244267716
########## 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)); Review Comment: fixed 6f018ed5e77ae38702af397a360bb9f77ffb7231 ########## src/backend/access/aocs/aocsam.c: ########## @@ -592,23 +638,37 @@ aocs_beginscan_internal(Relation relation, scan->columnScanInfo.ds = NULL; + if ((flags & SO_TYPE_ANALYZE) != 0) + { + scan->segfirstrow = 0; + scan->targrow = 0; + } + GetAppendOnlyEntryAttributes(RelationGetRelid(relation), NULL, NULL, &scan->checksum, NULL); GetAppendOnlyEntryAuxOids(relation, - NULL, NULL, NULL, + NULL, &blkdirrelid, NULL, &visimaprelid, &visimapidxid); if (scan->total_seg != 0) + { AppendOnlyVisimap_Init(&scan->visibilityMap, visimaprelid, visimapidxid, AccessShareLock, appendOnlyMetaDataSnapshot); + if ((flags & SO_TYPE_ANALYZE) != 0) Review Comment: fixed 6f018ed5e77ae38702af397a360bb9f77ffb7231 -- 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