Repository navigation
Read the class of an aggregate off the SQL type of its values - #74
Merged
estebanzimanyi merged 1 commit intoNov 20, 2026
Merged
Conversation
An aggregate several transitions serve under one name, one per type of its values, as tMinAgg is tint_tmin_transfn over tint and tfloat_tmin_transfn over tfloat, is a static method of each value's class. #aggregate_class of tools/objectgen.py reads that class off the catalog as #aggregateClass of MEOS.js's codegen/ObjectGenerator.ts does: the leaf of the lattice whose prefix is the SQL type of the aggregate's values (args[0] of the aggregate, tint naming TInt), and otherwise the class of the C type the transition takes the values as. Each method keeps the aggregate's one name and takes the values as its class's own: TInt.TMinAgg(TInt[] values) and TFloat.TSum(TFloat[] values). A struct argument passed by value, the interval of the window aggregates and of appendInstantAgg, is laid out once for every call of the transition, as #call_body lays one out for its call, so TInt.WMin(TInt[] values, Interval interv) and the other window aggregates are methods too; no aggregate is left in GAP-LEDGER.md. MEOS.NET.Tests/AggregateOverloadTests.cs sums two temporal floats and takes the minimum of a temporal integer. Why: an aggregate whose transitions all take a Temporal had no method, since the class of that C type is Temporal for every one of them, and an aggregate whose transition takes an interval had none either. Measured: over the catalog of MobilityDB master d2a7ca45ca, dotnet build reports 0 warnings and 0 errors, and dotnet test passes 123 of 123 with none skipped.
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.
An aggregate several transitions serve under one name, one per type of its values, as tMinAgg is tint_tmin_transfn over tint and tfloat_tmin_transfn over tfloat, is a static method of each value's class. #aggregate_class of tools/objectgen.py reads that class off the catalog as #aggregateClass of MEOS.js's codegen/ObjectGenerator.ts does: the leaf of the lattice whose prefix is the SQL type of the aggregate's values (args[0] of the aggregate, tint naming TInt), and otherwise the class of the C type the transition takes the values as. Each method keeps the aggregate's one name and takes the values as its class's own: TInt.TMinAgg(TInt[] values) and TFloat.TSum(TFloat[] values). A struct argument passed by value, the interval of the window aggregates and of appendInstantAgg, is laid out once for every call of the transition, as #call_body lays one out for its call, so TInt.WMin(TInt[] values, Interval interv) and the other window aggregates are methods too; no aggregate is left in GAP-LEDGER.md. MEOS.NET.Tests/AggregateOverloadTests.cs sums two temporal floats and takes the minimum of a temporal integer.
Why: an aggregate whose transitions all take a Temporal had no method, since the class of that C type is Temporal for every one of them, and an aggregate whose transition takes an interval had none either.
Measured: over the catalog of MobilityDB master d2a7ca45ca, dotnet build reports 0 warnings and 0 errors, and dotnet test passes 123 of 123 with none skipped.