Skip to content

feat(core): expose metadata from YAML extension files#691

Merged
benbellick merged 3 commits intomainfrom
benbellick/expose-yaml-metadata
Mar 10, 2026
Merged

feat(core): expose metadata from YAML extension files#691
benbellick merged 3 commits intomainfrom
benbellick/expose-yaml-metadata

Conversation

@benbellick
Copy link
Copy Markdown
Member

Closes #690

Implements support for reading and exposing the optional metadata field
from YAML extension files at runtime. This allows users to extend
Substrait with custom metadata at three levels:

- Extension-level: via ExtensionCollection.getExtensionMetadata(urn)
- Type-level: via Type.metadata()
- Function-level: via ScalarFunctionVariant/AggregateFunctionVariant/
  WindowFunctionVariant.metadata()

Also updates substrait submodule to v0.80.0 which includes the metadata
schema support.

Closes #690
@benbellick benbellick force-pushed the benbellick/expose-yaml-metadata branch from a0b8dbc to 712b0ba Compare March 2, 2026 18:10
@benbellick benbellick marked this pull request as ready for review March 2, 2026 21:13
@benbellick benbellick requested review from nielspardon and vbarua March 2, 2026 21:13

public abstract Map<String, Option> options();

public abstract Optional<Map<String, Object>> metadata();
Copy link
Copy Markdown
Member

@nielspardon nielspardon Mar 3, 2026

Choose a reason for hiding this comment

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

I'm wondering whether it would be useful to have an interface instead of Object for e.g. creating custom YAML deserializers / serializers and whether we should allow to add them to the ObjectMapper in SimpleExtension.load().

Otherwise I'm fine with the changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That is a useful idea, but I wonder if we can leave that for future work? I think this simple approach works for now, and it satisfies the goal of being able to expose arbitrary data to users from YAML files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, if we switch to an interface instead of Object at a later point this would be a breaking change for consumers which we probably want to avoid.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can see that using Object is simpler for default types like String | Integer | Boolean

@benbellick benbellick requested a review from nielspardon March 5, 2026 21:53
Copy link
Copy Markdown
Member

@nielspardon nielspardon left a comment

Choose a reason for hiding this comment

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

LGTM

@benbellick benbellick merged commit b865296 into main Mar 10, 2026
12 checks passed
@benbellick benbellick deleted the benbellick/expose-yaml-metadata branch March 10, 2026 19:14
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.

Handle metadata in YAML extension files

2 participants