Skip to content

feat(core): add context to RelVisitor, ExpressionVisitor and FuncArgVisitor #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nielspardon
Copy link
Contributor

@nielspardon nielspardon commented Jun 27, 2025

BREAKING CHANGE: adds a new context argument to RelVisitor, ExpressionVisitor and FuncArgVisitor

Preparation for #426

Adds the new context argument as a io.substrait.util.EmptyVisitationContext with value null everywhere.

@nielspardon nielspardon changed the title feat(core): adds context to RelVisitor, ExpressionVisitor and FuncArgVisitor feat(core): add context to RelVisitor, ExpressionVisitor and FuncArgVisitor Jun 27, 2025
@nielspardon nielspardon force-pushed the par-visitor-context branch from 0a7d4cb to b91d2e7 Compare June 27, 2025 19:39
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Had a chance to take a look, and have some high-level notes.

I'm generally a fan of this, but I do worry that it could introduce a lot of noise for visitations that don't require context.

Your usage in a2f0c8e (#426) doesn't strictly require a context parameter like you're introducing, as you could achieve a similar result by just pushing the context before calls to accept, and popping it after. However, that is more error prone and having it as parameter makes it easier to understand the dataflow and makes it harder for users to not propagate the context because they're forced to.

I'm going to ping the Slack to get additional eyes for this, because it does end up being an fairly intrusive API change and I'd like to hear what others think.

@nielspardon
Copy link
Contributor Author

I'm generally a fan of this, but I do worry that it could introduce a lot of noise for visitations that don't require context.

I also had this concern while working on this. I first had a new set of visitors that I was shipping alongside the existing once. I then decided to just replace the existing once. There are definitely trade-offs for both options.

@nielspardon
Copy link
Contributor Author

I'm going to ping the Slack to get additional eyes for this, because it does end up being an fairly intrusive API change and I'd like to hear what others think.

make sense. that's why I tagged it as a breaking change since users of substrait-java might be implementing the current visitor and it might be nice to get informed in the release notes that such an intrusive API change has happened.

…isitor

BREAKING CHANGE: adds a new context argument to RelVisitor, ExpressionVisitor and FuncArgVisitor

Signed-off-by: Niels Pardon <[email protected]>
@nielspardon nielspardon force-pushed the par-visitor-context branch from b91d2e7 to 0b61b18 Compare July 1, 2025 16:52
@nielspardon nielspardon requested a review from vbarua July 1, 2025 16:54
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