leaves12138 commented on code in PR #8603:
URL: https://github.com/apache/paimon/pull/8603#discussion_r3575246720


##########
paimon-core/src/main/java/org/apache/paimon/table/system/AuditLogTable.java:
##########
@@ -184,12 +187,38 @@ public List<String> primaryKeys() {
 
     @Override
     public SnapshotReader newSnapshotReader() {
-        return new AuditLogDataReader(wrapped.newSnapshotReader());
+        return newSnapshotReader(wrapped);
+    }
+
+    private SnapshotReader newSnapshotReader(FileStoreTable table) {
+        return new AuditLogDataReader(table.newSnapshotReader());
     }
 
     @Override
     public DataTableScan newScan() {
-        return new AuditLogBatchScan(wrapped.newScan());
+        if (wrapped instanceof FallbackReadFileStoreTable) {
+            return ((FallbackReadFileStoreTable) 
wrapped).newScan(this::newScan);

Review Comment:
   Reconstructing the audit-log scan through this function drops specialized 
scan implementations. For a `ChainTableFileStoreTable`, 
`FallbackReadFileStoreTable.newScan(this::newScan)` applies this private 
creator to the fallback `ChainGroupReadTable`, so the fallback scan becomes a 
plain `DataTableBatchScan` instead of `ChainGroupReadTable.newScan()`'s 
`ChainTableBatchScan`. This bypasses the snapshot-anchor and delta-chain 
planning that the previous `AuditLogBatchScan(wrapped.newScan())` preserved. I 
reproduced this with a minimal chain-table setup: the outer fallback scan's 
`fallbackScan` is now `DataTableBatchScan`, not `ChainTableBatchScan`. Please 
preserve the specialized chain scan while disabling indexed splits, and add a 
chain-table audit-log regression test.



-- 
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]

Reply via email to