Skip to content

[Stream][Binlog] Override scan-state comparison for OlapStreamScan #65878

Description

@yujun777

Description

While reviewing PR #65472, I found that LogicalOlapTableStreamScan has stream-specific state that is relevant to scan equivalence, especially StreamReadMode (INCREMENTAL, SNAPSHOT, and RESET). The class includes readMode in equals(), but it does not provide a stream-specific hasSameScanState() override.

After PR #65472 makes scan-state comparison relevant to plan rewrites such as PullUpJoinFromUnionAll, two stream scans may be compared through the generic OLAP scan-state logic without explicitly checking stream-specific state. If scans with different stream read modes are treated as equivalent, a rewrite could reuse or merge a scan with different stream semantics.

Requested follow-up

Please add an override for hasSameScanState() in LogicalOlapTableStreamScan (or the corresponding OlapStreamScan abstraction) and include all stream-specific state that affects execution. Add FE unit tests covering:

  • equal stream scans with the same read mode;
  • different read modes;
  • any selected-partition or stream-lowering state that must participate in scan equivalence.

This is a source-level follow-up to PR #65472. The direct stream/binlog runtime impact still needs an end-to-end reproduction; this issue is opened to ensure the missing override and its contract are resolved explicitly.

上面这个PR 会先pick 到4.1 分支,但是4.1分支现在不支持stream, 所以要等后面4.1支持了stream之后, 再单独pick stream scan的overrite 到4.1 分支上

Related tracking issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions