yujun777 opened a new pull request, #69435: URL: https://github.com/apache/doris/pull/69435
### What problem does this PR solve? Trace issue: https://github.com/apache/doris/issues/65418 Problem Summary: IVM assumed every base scan was an OLAP scan: it read `hasChangelog()` and the key model directly, and built the pre-/post-refresh snapshots through OLAP-only methods. That blocks external-table scans (Iceberg/Hive) from participating, and keeps the snapshot entry split between `withPreSnapshot` and `withPostSnapshot`. This change introduces `SupportChangelog`, a scan-level capability that answers: - whether the changelog is enabled for this scan (`isChangelogEnabled`), - whether the changelog contains only appends (`isChangelogAppendOnly`), - how to build a snapshot (`withSnapshot(boolean preSnapshot, BaseTableStream stream)`). `LogicalOlapScan` implements it. `LogicalOlapTableStreamScan` rejects every method, because IVM never uses a stream scan as a base scan. `IvmUtil.validateChangelogEnabled` and `IvmNormalizeDupKeysMTMV` now go through the interface. `rewriteSnapshot` moved from `IvmDeltaRewriter` to `IvmDeltaRewriteHelper`, and the two snapshot methods collapsed into the single `withSnapshot` entry. No behavior change for existing OLAP tables. ### Release note None ### Check List (For Author) - Test: FE UT - LogicalOlapScanTest, IvmDeltaRewriteHelperTest, IvmDeltaRewriterTest, IvmDupDeltaRewriterTest, IvmJoinDeltaHandlerTest, IvmUtilTest, IvmNormalizeUniqKeysMTMVTest: 156 tests, all passed - `mvn -o checkstyle:check -pl fe-core` passed - Behavior changed: No - Does this need documentation: No -- 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]
