GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SQL] Do not share IR nodes between unrelated closures by mihaibudiu · Pull Request #7728 · feldera/feldera

Conversation

@mihaibudiu

@mihaibudiu mihaibudiu commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Supersedes #7718

Checklist

  • Unit tests added/updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mihaibudiu
[SQL] Do not share IR nodes between unrelated closures
4583463
Signed-off-by: Mihai Budiu <[email protected]>
@mihaibudiu mihaibudiu mentioned this pull request Oct 30, 2026
[SQL] Give each fused call of a lambda its own parameters #7718
Closed
12 tasks
@mythical-fred-oss

mythical-fred-oss Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Review: the fix looks correct. It deep-copies the result of g and gives every nested closure fresh parameters, so the post-processing and the empty-set result no longer share lambda parameters.

What I ran

Check Result
./build.sh, then RollingAggregateGCIncrementalTests#fusedLambdaForGen2+issue7507* ✅ 15/15 passed
Same test with the freshenNested(...) line reverted ❌ Key x: &i32? already mapped to p4 ... p5, so the test catches the bug
My extra Gen-2 cases: nested TRANSFORM(TRANSFORM(ARRAY_AGG(c), x -> ..), y -> ..), plus two fused ARRAY_AGGs that each have a lambda ✅ passed (not committed)

Missing tests (medium): The PR has no test for nested lambdas or for several fused columns. These are the cases where shared parameters are most likely to come back. Here is a test you could add:

@Test
public void fusedNestedLambdasForGen2() {
    var nested = this.compileForGen2("""
            CREATE TABLE t(k INT, c INT);
            CREATE VIEW v AS SELECT k,
              ARRAY_MAX(TRANSFORM(TRANSFORM(ARRAY_AGG(c), x -> x * 2), y -> y + 1)) AS m
            FROM t GROUP BY k;""");
    Assert.assertEquals(0, storedArrays(nested));
    var two = this.compileForGen2("""
            CREATE TABLE t(k INT, c INT, d INT);
            CREATE VIEW v AS SELECT k,
              ARRAY_MAX(TRANSFORM(ARRAY_AGG(c), x -> x * 2)) AS m,
              ARRAY_MIN(TRANSFORM(ARRAY_AGG(d), x -> x + 1)) AS n
            FROM t GROUP BY k;""");
    Assert.assertEquals(0, storedArrays(two));
}

Commit message (medium): The body has only the Signed-off-by line. Please explain the why: Gen-2 keeps the aggregate list, and CanonicalForm then requires each parameter to belong to exactly one closure. Please also include the already mapped error message. The description of #7718 already explains this well and could be reused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gz
gz approved these changes Oct 30, 2026
View reviewed changes
@mihaibudiu
mihaibudiu added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 68531e4 Oct 30, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mihaibudiu
mihaibudiu deleted the closure-copy branch October 30, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gz gz gz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mihaibudiu @gz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.