924060929 commented on PR #67256: URL: https://github.com/apache/doris/pull/67256#issuecomment-5631325724
Could you add a guard harness for the `StatementContext` next-EXECUTE handoff? The focused tests in this PR verify the fields we know about today, but a future non-static field added to `StatementContext` can silently be omitted from `createNextExecuteContext()` and still compile. That is especially risky because a field may need one of three different treatments: carry it to the next execution, start fresh/recompute it per execution, or finalize it before dropping the outgoing context. Ideally, please add a harness that explicitly classifies every non-static `StatementContext` field into those lifecycle categories and fails when a newly added field is unclassified. For example, it could use a reflection-based field-name registry or an equivalent explicit contract. Important carried/resource fields should additionally have behavior assertions: carried state survives context replacement, fresh state does not survive, and owned resources are finalized exactly once. This would turn future `StatementContext` field changes into a CI-visible decision instead of relying on reviewers to remember to inspect `createNextExecuteContext()` and `PreparedStatementContext.nextStatementContext()` manually. If a field registry is considered too brittle, an explicit `NextExecuteState` value object or another design that makes the handoff contract mechanically complete would also address the concern. -- 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]
