Repository navigation
feat(postgres): translate math, string, JSON and row-order aggregate forms to DuckDB - #351
Merged
Merged
Conversation
… reasonably translatable forms to the measure
…gree trigonometry
…ng for an infinite one
…tgreSQL rejects it
…ses uncredited An [[uncredited]] table lists recorded cases that count neither for nor against any form. Its reason is a fixed enum, unspecified_row_order for now. Each listed case must be recorded and raise the aggregate_row_order divergence, and each obligation it cites needs an obligation of the same form and kind citing only credited cases. The report lists the cases and counts them beside the matching total. Files without the table measure exactly as before.
…the tests the new rules changed
An optional [expected_divergences] table maps case references to a declared divergence, for recorded cases whose append-only file cannot name it. Verify treats a listed case as if it declared expected_divergence. Loading fails on a listed case that does not exist, on an unknown divergence, and on a case that both declares the field and is listed. Verify prints every case the table lists. Policies without the table load and verify exactly as before.
…an invalid argument
… aggregates in their row order Each converts in its own ORDER BY, behind a guard that raises the aggregate_row_order divergence where rows tied on every key, or the rows of an unordered call, hold different values. A call ordered by its own value needs no guard; jsonb objects guard only a key holding two values. The generated cases recorded over rows in an unspecified order now expect that divergence through the policy.
…ed ones as uncredited
…collected aggregates, and VARIADIC NULL
…nd count them beside the matching forms
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.
Why
First of four PostgreSQL translation PRs: more PostgreSQL 18.6 forms convert to DuckDB and match the recorded results. The PostgreSQL measure rises from 393 to 462 of 940 translatable forms (+69, forecast 83). Unfinished forms roll into the next PR or carry a named blocker.
Changes
substringwith SIMILAR,json_strip_nulls,jsonb_pretty,uuid_extract_timestamp,num_nulls,extractof rising fields,convert_from/convert_to,quote_ident,parse_identanddivof numerics.array_agg,any_value,string_aggand the JSON aggregates convert in their own ORDER BY. A short guard raisesaggregate_row_orderwhere tied rows hold different values; a call ordered by its own value needs none.[[uncredited]]cases, with the fixed reasonunspecified_row_order. Each listed case must be recorded, must raise that divergence and must have a credited stand-in.[expected_divergences]. It fails closed on a missing case, an unknown divergence or a case that also declares one. SQLSTATE 22030 reads as an invalid argument.5346407: 28 ordered aggregate cases recorded on PostgreSQL 18.6.Verification
sqlbabel verifyon the PostgreSQL cases: 3,029 cases, 0 failed, 8 diverged as expected.syntax-coverage results: 462 of 940 forms match, nothing regressed, and the baseline is updated. 7 cases are listed as uncredited, each with a stand-in.div360 of 360 rows match;quote_identandparse_ident566 of 566.make check-cipasses on this head.