Hint.ComputationType.fromProto scans values() and throws IllegalArgumentException on any proto value it does not recognise, including UNRECOGNIZED (core/src/main/java/io/substrait/hint/Hint.java:87-93).
It is reachable from plan deserialization — ProtoRelConverter.optionalHint calls it for every loaded and saved computation (core/src/main/java/io/substrait/relation/ProtoRelConverter.java:1591 and :1599) — so a hint written by a producer built against a newer spec aborts the entire plan import.
That is a heavy failure mode for hints specifically, since they are defined as non-semantic metadata a consumer is free to ignore. The enum already has a natural degrade target: COMPUTATION_TYPE_UNKNOWN.
Suggested fix: have ComputationType.fromProto fall back to COMPUTATION_TYPE_UNKNOWN instead of throwing.
Note this is deliberately not a blanket argument against the fromProto-throws convention used by the other POJO enums (Set.SetOp, Join.JoinType, …) — those map semantically meaningful values where failing loudly is right. Hints are the case where forward compatibility should win.
Hint.ComputationType.fromProtoscansvalues()and throwsIllegalArgumentExceptionon any proto value it does not recognise, includingUNRECOGNIZED(core/src/main/java/io/substrait/hint/Hint.java:87-93).It is reachable from plan deserialization —
ProtoRelConverter.optionalHintcalls it for every loaded and saved computation (core/src/main/java/io/substrait/relation/ProtoRelConverter.java:1591and:1599) — so a hint written by a producer built against a newer spec aborts the entire plan import.That is a heavy failure mode for hints specifically, since they are defined as non-semantic metadata a consumer is free to ignore. The enum already has a natural degrade target:
COMPUTATION_TYPE_UNKNOWN.Suggested fix: have
ComputationType.fromProtofall back toCOMPUTATION_TYPE_UNKNOWNinstead of throwing.Note this is deliberately not a blanket argument against the
fromProto-throws convention used by the other POJO enums (Set.SetOp,Join.JoinType, …) — those map semantically meaningful values where failing loudly is right. Hints are the case where forward compatibility should win.