fhan688 commented on code in PR #20281:
URL: https://github.com/apache/hudi/pull/20281#discussion_r4247683535
##########
hudi-agent-gateway/skills/hudi-architect/validate_flink_design.py:
##########
@@ -491,20 +542,34 @@ def assess_design(
elif external_catalog is not False:
assessment.add("FLINK_CATALOG_REQUIREMENT_UNRESOLVED", "Catalog
requirement is unresolved")
mutability = safety.get("mutability")
- if mutability == "mutable":
- assessment.add("FLINK_MUTABLE_COW_DEFERRED", "Mutable COW is deferred")
+ if mutable_contract:
+ if mutability != "mutable":
+ assessment.add(
+ "FLINK_MUTABILITY_REQUIRED",
+ "contract_schema 2 requires mutable input",
+ )
+ elif mutability == "mutable":
+ assessment.add(
+ "FLINK_MUTABLE_COW_DEFERRED",
+ "Mutable COW requires the explicit contract_schema 2 safety
contract",
+ )
elif mutability != "append_only":
assessment.add("FLINK_MUTABILITY_REQUIRED", "Append-only input must be
confirmed")
replay_behavior = safety.get("replay_behavior")
if not _non_empty_string(replay_behavior):
assessment.add("FLINK_REPLAY_BEHAVIOR_UNRESOLVED", "Replay behavior is
unresolved")
- elif replay_behavior == "must_collapse":
+ elif replay_behavior == "must_collapse" and not mutable_contract:
assessment.add("FLINK_REPLAY_IDEMPOTENCE_DEFERRED", "Replay
deduplication needs upsert")
- elif replay_behavior not in {"cannot_occur", "duplicates_acceptable"}:
+ elif replay_behavior not in (
+ {"must_collapse"} if mutable_contract else {"cannot_occur",
"duplicates_acceptable"}
Review Comment:
Thanks for pointing this out. I’ve aligned the `schema-2` contract with F6
so that all three resolved replay behaviors are accepted, while unresolved
values remain `REVIEW_REQUIRED`. The `schema-1` behavior is unchanged.
--
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]