GeezerVison is showing github.com — [SQL] Do not generate statics whose values are references by mihaibudiu · Pull Request #7693 · feldera/feldera
Conversation
mihaibudiu
commented
Oct 29, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Linked Issue
Fixes #7685
The compiler tries to lift constant expression into StaticLazy expressions. It always tried to lift the maximal possible expression. But this can lead to code like:
static STATIC_a1c14e5b2ab3534d: StaticLazy<(&Tup1<Option<i32>>, )> = StaticLazy::new();
STATIC_a1c14e5b2ab3534d.init(move || (
&Tup1::new(None::<i32>),
));
which does not compile, because it returns a reference to a temporary.
The fix is to only lift this:
STATIC_8c3ff960f750a222.init(move || Tup1::new(None::<i32>));
Describe Manual Test Plan
Checklist
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
LGTM, with one fix needed in the description.
bug (medium): The PR body says Fixes #6785, which is an unrelated S3 adapter test-hang issue. The SQL issue this fixes is #7685 (the new test is named issue7685). As written, merging won't close #7685 and points at the wrong issue.
What I ran:
| Check |
Result |
./build.sh |
✅ |
ExpressionGCIncrementalTests#issue7685 with the fix |
✅ |
Same test with the ImplementStatics change reverted |
❌ E0515: cannot return value referencing temporary value, so the test does reproduce the bug |
ExpressionGCIncrementalTests (whole class) |
✅ 5/5 |
Ad-hoc test: two always-NULL group keys (ts + NULL, x * NULL) on a LATENESS table, plus a non-lateness table grouped by BIGINT + NULL and VARCHAR || NULL |
✅ compiles and gives correct output (not committed) |
The feldera-pr-checks gates pass: the test covers the changed behaviour, there are no flakiness risks, and the change is not user-visible.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
gz
gz approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.