Repository navigation
Conversation
…REGATE Three more oracles. TLP_DISTINCT and TLP_HAVING are modes of the TLP oracle (VoltDBTLPWhereOracle becomes VoltDBTLPOracle); TLP_AGGREGATE combines MIN, MAX, SUM and COUNT over the three WHERE partitions in Java, since VoltDB rejects the shared oracles' UNION ALL over partitioned tables. The generator gains aggregates, grouping columns and HAVING predicates, and works around ENG-30529 (aliases on grouped output), ENG-30530 (no grouping on partitioning columns with an outer join) and ENG-30504 in HAVING (NOT pushed down). A partition that returns no row is the empty aggregate (ENG-19957). getObject() now returns null for a NULL value too (ENG-4643).
…output to 12 digits The 30-minute runs found ENG-30531: GROUP BY or DISTINCT on an indexed column, inlined into a FULL JOIN as a serial aggregation, returns the NULL group twice. TLP DISTINCT and HAVING now make no FULL JOINs while --avoid-known-bugs is on. A FLOAT SUM in a HAVING query's output can differ in its last digit between queries, so FLOAT values compare to 12 digits.
…CIMAL precision errors The second 30-minute runs found ENG-30533: MIN of a column without GROUP BY, through a multi-column index whose next column is NULL, skips the row. TLP AGGREGATE now writes MIN and MAX of a bare column as (c + 0) or (c || ''), which the shortcut does not apply to. Trials found ENG-30529 again where the grouped columns are not selected, so grouping columns now have distinct names. With FULL JOINs gone from TLP DISTINCT and HAVING, a LEFT JOIN of a replicated table after partitioned joins could become "not plannable"; those generators keep replicated tables in the FROM list there. "has more than 38 digits of precision" is DECIMAL overflow in folded constants, an expected error.
…gates The third 30-minute runs found ENG-30534: aggregates of x'' and of '' in a GROUP BY join whose ON condition holds x'' fail with a cast error.
This was referenced Nov 5, 2026
Author
|
Superseded by #51, which combines every ENG-30396 PR of this repo into one. This PR's branch is kept, and its description still has this milestone's details and lab results. |
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.
Milestone 5 of ENG-30396: the TLP aggregate, HAVING and DISTINCT oracles, which the plan lists third, "once the first two are stable". Stacked on #4 (milestone 4), which is stacked on #3, #2 and #1; review those first.
What it adds
Each oracle partitions a query by a random predicate
pbeing TRUE, FALSE or NULL, then checks that the three partitions together give the original query's result.TLP_DISTINCT:SELECT DISTINCTof some columns or, half the time, the same columns withGROUP BY.WHERE p,WHERE NOT pandWHERE p IS NULL.TLP_HAVING:HAVING p,HAVING NOT pandHAVING p IS NULL. Herepmixes the grouping columns with MIN, MAX, SUM and COUNT of expressions.TLP_AGGREGATE:WHERE p,WHERE NOT pandWHERE p IS NULL.UNION ALL. VoltDB rejects that over partitioned tables, so this oracle combines them in Java.Structure
VoltDBTLPWhereOraclebecomesVoltDBTLPOracle, with a mode for each of WHERE, DISTINCT and HAVING.VoltDBTLPAggregateOracle.--use-reducer.Other changes
VoltDBSelect: now prints DISTINCT, GROUP BY and HAVING.has more than 38 digits of precision, VoltDB's message when a DECIMAL overflows in an expression of constants.getObject(), as it already did fromgetString().SQLancerResultSetgainsgetObject().Bugs found
Each has a minimal reproduction and is linked to ENG-30396. Each is worked around while
--avoid-known-bugsis on, the default.t0.c0andt1.c0. Found while checking the SQL these oracles generate. Every SQLancer table names its columns c0, c1, ..., so almost every join hits it. TLP HAVING later found that aliases don't help when the grouped columns aren't selected (added as a comment).(a, b)and the row(5, NULL),MIN(a) WHERE a = 5is NULL. Found by TLP AGGREGATE in the second 30-minute runs, and reduced by SQLancer to 3 statements.(c + 0)or(c || ''), which the shortcut doesn't apply to. MIN and MAX of VARBINARY and temporal values are left out of that oracle.x''and of''in a GROUP BY join whose ON condition holdsx''fail with "Type VARCHAR can't be cast as VARBINARY", as if the two were one expression. Found by TLP HAVING in the third 30-minute runs.NOT (a OR b)fails with the BOOLEAN cast error even as the whole clause. Found by TLP HAVING.Also seen: an aggregate query whose WHERE clause folds to FALSE returns no row. This is the existing ENG-19957 (the planner adds LIMIT 0), which was closed as won't fix. The README lists it as an intentional difference, and TLP AGGREGATE treats such a partition as the empty aggregate.
Testing
mvn verify -DskipTestspasses: formatter, checkstyle, PMD and SpotBugs.3-minute trials of each oracle, 1 node: 4,578 DISTINCT checks, 3,604 HAVING checks and 4,004 AGGREGATE checks, none failing.
With
--avoid-known-bugs false: the known bugs fail the run as expected.Acceptance, 30 minutes each: 8 sites per host, with TLP_DISTINCT, TLP_HAVING and TLP_AGGREGATE together and
--use-reducer. Both runs on head c29ce77:Earlier acceptance runs failed and found bugs. Three earlier pairs of runs each failed, and each failure was a real VoltDB bug, worked around in the next commit:
TestVoltDBgains a test for the three oracles. Like the others, it runs only withVOLTDB_AVAILABLE=trueagainst localhost:21212, so it was not run here.