Repository navigation
Pass the presence flag of an argument the call states on the typed SQL surfaces - #192
Merged
estebanzimanyi merged 1 commit intoOct 25, 2026
Conversation
…L surfaces A wrapper may read an argument declared DEFAULT NULL as two C parameters, its value and a flag stating whether it is given, and the catalog states the value the flag takes when the argument is given in presentBinds, beside the nullDefaultBinds of the call leaving it out. SqlModel.signatures of tools/codegen_jvm.py binds the flag to that value, so the argument pairs with its value alone: reclass(rast, nband, reclassexpr, pixeltype, nodataval) passes its nodata value and has_nodata true, as Raster_reclass does, and the call leaving the nodata value out passes 0.0 and false, as #_null_default_signatures reads them. Witness: over MobilityDB master bc6f2729ea and MEOS-API master 71c23da, which states presentBinds since MEOS-API #204, main's generator answers reclass, addBand(rast, index, pixeltype, initialvalue, nodataval), raquet and raster on the typed Spark and Flink surfaces only with the call leaving the nodata value out, or not at all, each call stating it refused as arity:sql: one SQL argument stands for two C parameters. 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 9353 overloads where main's answer 1300 and 9349, the 4 more the calls stating the nodata value of raster, raquet, reclass and addBand(rast, index, ...), each passing its flag true, and every other generated file is identical. codegen/src/test/java/JvmPresenceFlagTest.java runs the generator over a function whose nullable argument feeds a value and its flag: on main the call stating the argument is refused as arity:sql on both surfaces, and here it passes the argument and true, and the call leaving it out passes 0.0 and false.
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.
A wrapper may read an argument declared DEFAULT NULL as two C parameters, its value and a flag stating whether it is given, and the catalog states the value the flag takes when the argument is given in presentBinds, beside the nullDefaultBinds of the call leaving it out. SqlModel.signatures of tools/codegen_jvm.py binds the flag to that value, so the argument pairs with its value alone: reclass(rast, nband, reclassexpr, pixeltype, nodataval) passes its nodata value and has_nodata true, as Raster_reclass does, and the call leaving the nodata value out passes 0.0 and false, as #_null_default_signatures reads them.
Witness: over MobilityDB master bc6f2729ea and MEOS-API master 71c23da, which states presentBinds since MEOS-API #204, main's generator answers reclass, addBand(rast, index, pixeltype, initialvalue, nodataval), raquet and raster on the typed Spark and Flink surfaces only with the call leaving the nodata value out, or not at all, each call stating it refused as arity:sql: one SQL argument stands for two C parameters.
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 9353 overloads where main's answer 1300 and 9349, the 4 more the calls stating the nodata value of raster, raquet, reclass and addBand(rast, index, ...), each passing its flag true, and every other generated file is identical. codegen/src/test/java/JvmPresenceFlagTest.java runs the generator over a function whose nullable argument feeds a value and its flag: on main the call stating the argument is refused as arity:sql on both surfaces, and here it passes the argument and true, and the call leaving it out passes 0.0 and false.