Repository navigation
Run the aggregates of the catalog over a base value on both typed SQL surfaces - #176
Merged
estebanzimanyi merged 1 commit intoOct 11, 2026
Conversation
… surfaces setUnion over an integer, a bigint, a float, a text, a date and a timestamp, extent over an integer, a bigint, a float, a date and a timestamp, and tCount over a timestamp fold a base value into a set, a span or a temporal integer, each role a public MEOS function: int_union_transfn, int_extent_transfn, timestamptz_tcount_transfn and their siblings, with the combine, final, serialize and deserialize of the same aggregate over the typed values. _catalog_aggregates of tools/codegen_jvm.py carries an aggregate whose first argument is a base value, read into the class the scalars of the surface take it as (Integer, Long, Double, String, LocalDate, Instant) and passed to the transition as they pass it, and _spark_encoder gives Spark the encoder of each of those classes. Flink chooses the accumulate of an overload from the class of the argument, as for the typed values. Witness: with the generator of JMEOS main e8c65dc both surfaces leave the 12 out as "argument <type> or result <type> of no value type", and MobilitySpark's test fails with "aggregate setUnionAgg(int) does not exist". Measured over MobilityDB b2dcdf7d84 and MEOS-API 9b337a00fe: both surfaces register 22 aggregates of 260 overloads against 22 of 248, the 12 added and nothing else changing; every aggregate of the catalog is carried. With this generator MobilitySpark passes 46 tests, 18 of them in GeneratedSqlSurfaceTest, and MobilityFlink 35 binding and 12 benchmark tests, each surface checking the 12 against MobilityDB's answers over the same values, with 0 warnings. Why: a set, a span or a count over the integers, dates or timestamps of a table answers on Spark and Flink as it does in PostgreSQL.
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.
setUnion over an integer, a bigint, a float, a text, a date and a timestamp, extent over an
integer, a bigint, a float, a date and a timestamp, and tCount over a timestamp fold a base value
into a set, a span or a temporal integer, each role a public MEOS function: int_union_transfn,
int_extent_transfn, timestamptz_tcount_transfn and their siblings, with the combine, final,
serialize and deserialize of the same aggregate over the typed values. _catalog_aggregates of
tools/codegen_jvm.py carries an aggregate whose first argument is a base value, read into the
class the scalars of the surface take it as (Integer, Long, Double, String, LocalDate, Instant)
and passed to the transition as they pass it, and _spark_encoder gives Spark the encoder of each
of those classes. Flink chooses the accumulate of an overload from the class of the argument, as
for the typed values.
Witness: with the generator of JMEOS main e8c65dc both surfaces leave the 12 out as "argument
or result of no value type", and MobilitySpark's test fails with "aggregate
setUnionAgg(int) does not exist".
Measured over MobilityDB b2dcdf7d84 and MEOS-API 9b337a00fe: both surfaces register 22 aggregates
of 260 overloads against 22 of 248, the 12 added and nothing else changing; every aggregate of the
catalog is carried. With this generator MobilitySpark passes 46 tests, 18 of them in
GeneratedSqlSurfaceTest, and MobilityFlink 35 binding and 12 benchmark tests, each surface
checking the 12 against MobilityDB's answers over the same values, with 0 warnings.
Why: a set, a span or a count over the integers, dates or timestamps of a table answers on Spark
and Flink as it does in PostgreSQL.