Skip to content

[SQL] Never place two retain_value operators on the same input operator -- insert a noop on one side instead#6355

Merged
mihaibudiu merged 1 commit into
mainfrom
issue6350
Jun 3, 2026
Merged

[SQL] Never place two retain_value operators on the same input operator -- insert a noop on one side instead#6355
mihaibudiu merged 1 commit into
mainfrom
issue6350

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

There may be a better way to resolve this, but for now we took a conservative approach and we create something like this:

image

Describe Manual Test Plan

Ran all Java tests manually.

Checklist

  • Unit tests added/updated

…or -- insert a noop on one side instead

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Solid targeted fix for #6350. The record + noop-when- cleanly prevents two operators on the same upstream op, and the placeholder in the left-side iomap walk (InsertLimiters.java:1290-1296) is the real reason the field-order swap (issue6350b) used to crash: previously skipped unused fields entirely, leaving / shorter than and producing a whose shape did not match the left input type. The two regression tests cover both reproductions and assert exactly 2 operators, which is the right shape.

A few non-blocking questions inline. Approving — please consider them before merge.

@mythical-fred

Copy link
Copy Markdown

(Sorry — my APPROVE review body above lost all its code spans due to a quoting bug on my side. Re-posting the intended body here; inline comments have been corrected in place.)

Solid targeted fix for #6350. The JoinLimiters record + noop-when-left == right cleanly prevents two retain_values operators on the same upstream op, and the NonMonotoneType placeholder in the left-side iomap walk (InsertLimiters.java ~L1290–1296) is the real reason the field-order swap (issue6350b) used to crash: previously continue skipped unused fields entirely, leaving value / valuePart shorter than leftValueSize and producing a PartiallyMonotoneTuple whose shape didn’t match the left input type. The two regression tests cover both reproductions and assert exactly 2 retain_values operators, which is the right shape.

Approval stands; non-blocking follow-ups are inline.

@ryzhyk ryzhyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally, we would merge the two bounds, but I think this is sound.

@mihaibudiu mihaibudiu added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 634f1f4 Jun 3, 2026
1 check passed
@mihaibudiu mihaibudiu deleted the issue6350 branch June 3, 2026 01:26
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.

3 participants