Add Mandelbrot set to WMR slt #31108
Open
+79
−8
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.
The first commit adds a WMR test, drawing an ASCII art of the Mandelbrot set. The query is based on an SQLite example, pointed out by @umanwizard.
Had to tweak the query a bit:
WITH MUTUALLY RECURSIVE
instead ofWITH RECURSIVE
least
instead ofmin
(min
is the aggregation function in Materialize)string_agg
instead ofgroup_concat
chr(10)
instead ofx'0a'
ORDER BY
to thestring_agg
, because otherwise Materialize chooses a non-useful order inside each group.The second commit fixes a bug in sqllogictest: When the expected output starts with a space, the
trim_start()
used to eat this. Thetrim_start
was there, because thesplit_at(&QUERY_OUTPUT_REGEX)
ends at the end of----
, leaving a newline there to be returned by thesplit_at
that computes theoutput_str
. Now we take care to eat just a newline instead oftrim_start
eating all whitespace.(It would be tempting to just make
QUERY_OUTPUT_REGEX
eat the newline after----
. However, this would cause an issue for tests likejoins.slt:753
, where the expected output doesn't have any rows, and there is only one empty line. We expect two newlines to end the expected output, but in this test one of these newlines is the one directly after----
, so ifQUERY_OUTPUT_REGEX
eats this newline, then we get into trouble. One could just tweak this and other similar tests, but I wanted to make the bugfix mostly backwards compatible with existing tests. The one change that I still needed to make in an existing test was arguably in a malformed test.)For some reason, the change in sqllogictest auto-summoned the Adapter team. But I guess it would be better if @def- reviewed the sqllogictest change. @ParkMyCar, feel free to remove yourself and the Adapter team from the reviewers.
Motivation
Tips for reviewer
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.