Skip to content

Conversation

@findepi
Copy link
Member

@findepi findepi commented Aug 14, 2025

In UserDefinedLogicalNode::check_invariants, the actual plan to check for invariants is self. The plan is always LogicalPlan::Extension and provides no further information. It's confusing.

In `UserDefinedLogicalNode::check_invariants`, the actual plan to check
for invariants is `self`. The `plan` is always `LogicalPlan::Extension`
and provides no further information.  It's confusing.
@findepi findepi added the api change Changes the API exposed to users of the crate label Aug 14, 2025
@github-actions github-actions bot added logical-expr Logical plan and expressions core Core DataFusion crate substrait Changes to the substrait crate labels Aug 14, 2025
@findepi findepi mentioned this pull request Aug 14, 2025
@findepi findepi requested review from alamb and timsaucer August 14, 2025 19:00
@alamb
Copy link
Contributor

alamb commented Aug 15, 2025

I worry that this is a backwards incompatible API and if someone has used this API in their downstream application, there is no way to update their code to get the same behavior (aka get access to the containing plan node)

So in my opinion, this is a negative change because it cleans up the code slightly for the maintainers but is a potential negative change to users

Update: I was confused

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Sorry -- I was confused about the scope of this change. I think this is good

Sorry for my confusion @findepi

fn assert_valid_extension_nodes(plan: &LogicalPlan, check: InvariantLevel) -> Result<()> {
plan.apply_with_subqueries(|plan: &LogicalPlan| {
if let LogicalPlan::Extension(Extension { node }) = plan {
node.check_invariants(check, plan)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see -- the point is there is no value to getting the plan passed in here as there is nothing else in LogicalPlan::Extension(Extension { node })

That makes sense to me

@findepi findepi merged commit c17116f into apache:main Aug 17, 2025
27 checks passed
@findepi findepi deleted the findepi/remove-redundant-plan-from-extension-s-check-invariants-b53190 branch August 17, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate logical-expr Logical plan and expressions substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants