Skip to content

Provide valid extensionUris and extensionUriReferences in Substrait #11545

Open

Description

@Blizzara

Describe the bug

The Substrait produced by DF contains SimpleExtensionsDeclarations. See https://substrait.io/extensions/#simple-extensions for definition and https://substrait.io/tutorial/sql_to_substrait/#plans for an example (the example only has scalar functions but idea is the same for types and type variations). However, it does not contain proper SimpleExtensionUris, but rather uses a hardcoded extensionUriReference of max i32.

We should switch to providing proper SimpleExtensionUris with correct references.

To Reproduce

No response

Expected behavior

DF-produced Substrait plans contain valid extensionUris like shown here: https://substrait.io/tutorial/sql_to_substrait/#plans

Additional context

Technically, the SimpleExtensions should be defined in YAML files, like the ones here: https://github.com/substrait-io/substrait/blob/a68c1ac62f92d703da624cb8ac0cef854dd2b35f/extensions. That however makes some things more strict than they are now, and there are open questions in Substrait around how to evolve those files etc. So as the first alternative, we could consider just providing a reference to an imaginary uri rather than pointing to a proper YAML.

Activity

  1. benbellick commented on Oct 1, 2025

    @benbellick
    Contributor

    FYI, due to this change in upstream repo (substrait-io/substrait#856), it is extensionUrns, and extensionUrnReferences that need to be added (once substrait is updated).

  2. alexandrefimov commented on Oct 8, 2026

    @alexandrefimov
    Contributor

    Confirmed on main 102a16285 (55.1.0), with i BIGINT NOT NULL: SQL-produced i + 1 and abs(i) round-trip in DataFusion, but Java 0.103.0 rejects them because no URN is registered at anchor -1. A read-only plan loads.

    The plans contain no URNs and reference anchor 4294967295. Adding the arithmetic URN exposes a second problem: bare names add/abs. Using add:i64_i64/abs:i64 as well lets Java load both, without changing the relation tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions