Repository navigation
Pass the arguments of a shorter call in the order the catalog states for the function - #191
Merged
estebanzimanyi merged 1 commit intoOct 25, 2026
Conversation
…for the function The call leaving an argument to its NULL default drops that argument from the order the SQL arguments take, and _sql_overloads of tools/codegen_jvm.py hands _null_default_signatures that order whether the catalog states it for the signature or for the whole function, in shape.sqlArgParams. tfloatSeqSetGaps(tfloat[], maxt interval DEFAULT NULL, maxdist float DEFAULT NULL, interp text DEFAULT 'linear') reads its arguments in the order instants, maxt, maxdist, interp, which tsequenceset_make_gaps takes as instants, interp, maxt, maxdist, so tfloatSeqSetGaps(tfloat[], interval) passes its interval to maxt, -1.0 to maxdist and 'linear' to interp, as the wrapper does; raster(pixels, width, ...) without its nodata value passes its pixels last, 0.0 to nodataval and false to has_nodata. Witness: over MobilityDB master bc6f2729ea and MEOS-API master 71c23da, main's generator answers each <type>SeqSetGaps on the typed Spark and Flink surfaces with the call stating the interval and the distance and the call stating the instants alone, and with no call stating the instants and the interval, and registers neither raster nor raquet: the shorter signature takes the order of the full one, which states arguments it does not, so it pairs nothing and is dropped. Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1302 SQL functions and 9361 overloads where main's answer 1300 and 9349, the 12 more the call of <type>SeqSetGaps stating the instants and the interval for its 10 temporal types, raster without its nodata value and raquet without its nodata value, and every other generated file is identical. codegen/src/test/java/JvmShorterCallOrderTest.java runs the generator over a function whose SQL arguments come in another order than its C parameters: on main the call leaving its last argument out is missing on both surfaces, and here it passes its arguments to the parameters they stand for and the default to the one it leaves out.
estebanzimanyi
deleted the
codegen/shorter-call-takes-the-function-order
branch
October 25, 2026 18:43
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.
The call leaving an argument to its NULL default drops that argument from the order the SQL arguments take, and _sql_overloads of tools/codegen_jvm.py hands _null_default_signatures that order whether the catalog states it for the signature or for the whole function, in shape.sqlArgParams. tfloatSeqSetGaps(tfloat[], maxt interval DEFAULT NULL, maxdist float DEFAULT NULL, interp text DEFAULT 'linear') reads its arguments in the order instants, maxt, maxdist, interp, which tsequenceset_make_gaps takes as instants, interp, maxt, maxdist, so tfloatSeqSetGaps(tfloat[], interval) passes its interval to maxt, -1.0 to maxdist and 'linear' to interp, as the wrapper does; raster(pixels, width, ...) without its nodata value passes its pixels last, 0.0 to nodataval and false to has_nodata.
Witness: over MobilityDB master bc6f2729ea and MEOS-API master 71c23da, main's generator answers each SeqSetGaps on the typed Spark and Flink surfaces with the call stating the interval and the distance and the call stating the instants alone, and with no call stating the instants and the interval, and registers neither raster nor raquet: the shorter signature takes the order of the full one, which states arguments it does not, so it pairs nothing and is dropped.
Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1302 SQL functions and 9361 overloads where main's answer 1300 and 9349, the 12 more the call of SeqSetGaps stating the instants and the interval for its 10 temporal types, raster without its nodata value and raquet without its nodata value, and every other generated file is identical. codegen/src/test/java/JvmShorterCallOrderTest.java runs the generator over a function whose SQL arguments come in another order than its C parameters: on main the call leaving its last argument out is missing on both surfaces, and here it passes its arguments to the parameters they stand for and the default to the one it leaves out.