apache / apache/datafusion

[substrait] more abstract SubstraitConsumer API

Open
#13,863 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

The code in https://github.com/apache/datafusion/pull/13803 adds a `SubstraitConsumer` trait that explicitly includes the following methods
```rust
fn get_extensions(&self) -> &Extensions;
fn get_function_registry(&self) -> &impl FunctionRegistry;
```
these methods are used by implementors to retrieve structs, which they can then use to resolve and map functions from Substrait into DataFusion.

IMO, these structs are internal implementations detail and should be replace by dedicated methods that do not leak these details.

### Describe the solution you'd like

Identify / devise a series of API methods for the SubstraitConsumer that can be used to replace the calls to `get_extensions` and `get_function_registry`.

This may require rethinking how functions are mapped from Substrait to DataFusion

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reading pull request 13803 and the SubstraitConsumer trait, focusing on get_extensions and get_function_registry and how implementors use the returned structs. Define dedicated methods that hide those implementation details, while checking that Substrait-to-DataFusion function resolution and mapping still work. Done means the API no longer exposes those structs and the replacement mapping flow is agreed and usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.