apache / apache/datafusion

Provide valid extensionUris and extensionUriReferences in Substrait

Open
#11,545 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Describe the bug

The Substrait produced by DF contains [SimpleExtensionsDeclarations](https://github.com/substrait-io/substrait/blob/a68c1ac62f92d703da624cb8ac0cef854dd2b35f/proto/substrait/extensions/extensions.proto#L25). 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](https://github.com/substrait-io/substrait/blob/a68c1ac62f92d703da624cb8ac0cef854dd2b35f/proto/substrait/extensions/extensions.proto#L13), 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.

Contributor guide

Open the contributing guide

Research direction

Start with Substrait's proto/substrait/extensions/extensions.proto and the example plans in the SQL-to-Substrait tutorial, then inspect DataFusion's Substrait plan-generation path. Compare the current hardcoded extensionUriReference with valid SimpleExtensionUris and their references; done means DF-produced plans contain valid extensionUris and matching references.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.