Skip to content

feat(core)!: bump substrait to v0.85.0, drop URI support#740

Open
benbellick wants to merge 12 commits intomainfrom
drop-uri-support
Open

feat(core)!: bump substrait to v0.85.0, drop URI support#740
benbellick wants to merge 12 commits intomainfrom
drop-uri-support

Conversation

@benbellick
Copy link
Member

@benbellick benbellick commented Mar 9, 2026

Completes the URI-to-URN migration started in #522.

Substrait spec v0.85.0 removed the deprecated URI fields from the proto definitions (SimpleExtensionURI, extension_uris, extension_uri_reference) in favor of SimpleExtensionURN, extension_urns, and extension_urn_reference (see substrait#971). This PR bumps the submodule and drops all URI handling from substrait-java to match.

Previously, SimpleExtension maintained a bidirectional URI-to-URN map so that plans could accept either format on input and emit both on output. ExtensionCollector and ImmutableExtensionLookup both dealt with URI fields alongside URN fields during serialization and deserialization. With the upstream removal, all of that is unnecessary. The extension system now works exclusively with URNs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these roundtrip tests are still valuable, even if we aren't testing the migration.

@benbellick benbellick changed the title feat!: bump substrait to v0.85.0, drop URI support feat(core)!: bump substrait to v0.85.0, drop URI support Mar 10, 2026
}

public static Builder builder() {
return builder(DefaultExtensionCatalog.DEFAULT_COLLECTION);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to need this to be able to access the URI<->URN mapping. It was a bit of a hack before but was necessary during the migration.

Map<Integer, String> uriMap = new HashMap<>();

// Handle URN format
// TODO: consider validating URN format (e.g. must start with "extension:")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be reasonable to validate at least extension:<namespace>:<name> here, but I figure that can be left for another PR where it can be properly discussed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to validate the URN format we may want to add a regexp pattern to the extension YAML schema in the spec:

I would agree that is a separate change. Do you want to create an issue for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

substrait-io/substrait#881

I have this PR open where there is some discussion about this. It seemed to stall a bit and it was relatively low priority on my end, so I decided to prioritize other things. However, I would love to see some kind of resolution there :)

*
* <p>Used by {@link AbstractExtensionLookup#getScalarFunction} and similar methods to resolve a
* {@link FunctionAnchor} into a complete {@link Function} with signature metadata.
*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't strictly necessary for this PR, but I get a bit confused in this codebase on the differences between SimpleExtension, ExtensionCollector, ExtensionCollection, and ImmutableExtensionLookup. I wanted to move in the direction of clearer documentation on these differences.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test had to do with the management of the URI<->URN mapping when there was an implied discrepancy of the mapping from the YAML files. Since there is no more mapping, these tests are useless now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new test but testing normally expected behavior, which is just that when we look things up in the ImmutableExtensionLookup, they are indeed there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah just added this roundtrip tests (as mentioned in another comment) because we already had those nice plans, and I think this is a good category of tests to have in general.

@benbellick benbellick marked this pull request as ready for review March 10, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants