TsukiokaKogane commented on code in PR #63850:
URL: https://github.com/apache/doris/pull/63850#discussion_r3388191604


##########
be/src/storage/iterator/block_reader.cpp:
##########
@@ -74,6 +77,302 @@ Status BlockReader::next_block_with_aggregation(Block* 
block, bool* eof) {
     return res;
 }
 
+Status BlockReader::_ensure_binlog_column_pos(const Block& src_block) {

Review Comment:
   fixed



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/TableStreamManager.java:
##########
@@ -97,7 +128,129 @@ public Set<Long> getTableStreamIds(DatabaseIf db) {
         return result;
     }
 
-    public void fillTableStreamValuesMetadataResult(List<TRow> dataBatch) {
+    public void cleanupStalePartitionOffsets() {
+        List<Long> staleDbIds = new ArrayList<>();
+        List<Pair<Long, Long>> staleStreamIds = new ArrayList<>();
+        List<PruneTableStreamPartitionOffsetInfo.Entry> pruneEntries = new 
ArrayList<>();
+        for (Map.Entry<Long, Set<Long>> entry : copyDbStreamMap().entrySet()) {
+            Optional<Database> db = 
Env.getCurrentInternalCatalog().getDb(entry.getKey());
+            if (!db.isPresent()) {
+                staleDbIds.add(entry.getKey());
+                continue;
+            }
+            for (Long tableId : entry.getValue()) {
+                Optional<Table> table = db.get().getTable(tableId);
+                if (!table.isPresent()) {
+                    staleStreamIds.add(Pair.of(db.get().getId(), tableId));
+                    continue;
+                }
+                if (!(table.get() instanceof OlapTableStream)) {
+                    staleStreamIds.add(Pair.of(db.get().getId(), tableId));
+                    continue;
+                }
+                cleanupStalePartitionOffsets((OlapTableStream) 
table.get()).ifPresent(pruneEntries::add);
+            }
+        }
+        removeStaleDbAndStream(staleDbIds, staleStreamIds);

Review Comment:
   fixed



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to