repeat_row: Add random-generated tests#36192
Draft
ggevay wants to merge 5 commits intoMaterializeInc:mainfrom
Draft
repeat_row: Add random-generated tests#36192ggevay wants to merge 5 commits intoMaterializeInc:mainfrom
repeat_row: Add random-generated tests#36192ggevay wants to merge 5 commits intoMaterializeInc:mainfrom
Conversation
… ignores Introduces `Scenario.RepeatRow` and a new central module `negative_accumulation_errors.py` holding the substrings of error messages Materialize produces when it detects a negative accumulation (or similar "non-positive multiplicity" condition). The list is sourced from database-issues#9308; when the messages are reworded we update this file and Parallel Workload picks up the changes. When the new scenario is active, these substrings are added to the baseline `Action.errors_to_ignore`, covering every action that inherits that method (DDL and read-path alike). No queries involving `repeat_row` are generated yet; that arrives in follow-up commits. Co-authored-by: Junie <junie@jetbrains.com>
Turns on the `enable_repeat_row` system parameter so the new `Scenario.RepeatRow` can actually call `repeat_row`. The function is not generated in any other scenario, so this flip is a no-op for the existing Parallel Workload runs. Co-authored-by: Junie <junie@jetbrains.com>
In the new `RepeatRow` scenario, ~5% of newly created views wrap their body as `SELECT * FROM (<original>) AS rr_inner, repeat_row(-1)`. The `-1` is constant-folded into a `Constant` MIR node with negative diffs, exercising operator code paths that must handle negative multiplicities without panicking. The `-1` is hardcoded (rather than picking a random small negative) to avoid blowing up the data size. The matching ignore list for negative-accumulation errors was wired up in a previous commit. Co-authored-by: Junie <junie@jetbrains.com>
In the `RepeatRow` scenario, bootstrap a hardcoded `repeat_row_source`
table with a fixed mix of `+1`, `-1`, and `0` values, and have ~5% of
views use a hardcoded body of
SELECT r.diff::bigint AS <col> FROM repeat_row_source r,
repeat_row(r.diff)
This exercises the runtime path where the `repeat_row` count is not
constant-folded but read from a column, which can take negative values.
The two `repeat_row` view modes (constant and table-driven) are mutually
exclusive. The matching error ignores were already wired up.
Co-authored-by: Junie <junie@jetbrains.com>
Templated on `parallel-workload-rename`: same agent queue, runtime, and thread count, but passes `--scenario=repeat-row` to enable the new `repeat_row` codegen and the matching negative-accumulation error ignores. Other Parallel Workload steps are unaffected (the `RepeatRow` scenario is the only place that generates `repeat_row` queries). Co-authored-by: Junie <junie@jetbrains.com>
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.
Draft
Resolves SQL-166