repeat_row: Make subquery guard aware of negative diffs#36185
Merged
ggevay merged 1 commit intoMaterializeInc:mainfrom Apr 21, 2026
Merged
repeat_row: Make subquery guard aware of negative diffs#36185ggevay merged 1 commit intoMaterializeInc:mainfrom
repeat_row: Make subquery guard aware of negative diffs#36185ggevay merged 1 commit intoMaterializeInc:mainfrom
Conversation
repeat_row: Make subquery guard aware of negative diffs
b1f7261 to
88ad442
Compare
88ad442 to
ac14239
Compare
frankmcsherry
approved these changes
Apr 21, 2026
Contributor
frankmcsherry
left a comment
There was a problem hiding this comment.
Seems fine. Personally, the error seems most accurately "Error: not exactly one row", and the different variants for negative vs more than one may not pay dividends. But .. not opposed other than wrt the structured error bloat.
Contributor
Author
|
The reason for making the negative case its own error is that we'd like to handle this case specially: The error message should say something like "this is an internal error, unless you are using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is the 4. PR in the
repeat_rowproductionization work stream. Resolve SQL-164.This resolves #32978 (comment). It was not important originally, but now that we are productionizing
repeat_row, the original error message would become confusing: it would say that "more than one record produced in subquery", when in fact there was a negative number of rows.I didn't add a test, because I wasn't able to find a query where this error deterministically happens. If I just naively put a
repeat_row(-1)inside a subquery, then sometimes this error happens, but sometimes aDistinctgives the negative accumulation error message.