Skip to content

Hint.LoadedComputation and Hint.SavedComputation do not model advanced_extension #1070

Description

@nielspardon

RelCommon.Hint.LoadedComputation and RelCommon.Hint.SavedComputation each carry an advanced_extension field in the protobuf, but neither POJO models it, so it is unmapped in both conversion directions.

Hint, Hint.Stats and Hint.RuntimeConstraint all implement HasExtension (core/src/main/java/io/substrait/hint/Hint.java lines 11, 99 and 180), and both converters map their extensions. SavedComputation (line 126) and LoadedComputation (line 153) do not, so:

  • ProtoRelConverter.optionalHint has nowhere to put an incoming extension and silently discards it.
  • RelProtoConverter.common has nothing to write.

Verified against the pinned io.substrait:protobuf:0.99.0 artifact — javap shows hasAdvancedExtension() / getAdvancedExtension() on both RelCommon$Hint$LoadedComputation and RelCommon$Hint$SavedComputation.

Concretely: a producer emitting a COMPUTATION_TYPE_BLOOM_FILTER loaded computation with an engine-specific advanced extension loses it on import, and no test can catch it because the POJO has no accessor.

This is the same class of gap as #297, and it is also a limitation of the guard added in #1069: RelCommonRoundtripTest enforces coverage per relation type, not per RelCommon subfield, so an unmapped subfield like this slips through.

Fix: have both POJOs implement HasExtension and map the field in ProtoRelConverter.optionalHint and RelProtoConverter.common, plus a round-trip test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorePull requests that update java code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions