Skip to content

Pass the presence flag of an argument the call states on the typed SQL surfaces - #192

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/nullable-argument-presence-flag
Oct 25, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/nullable-argument-presence-flag

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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.

…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.
@estebanzimanyi
estebanzimanyi merged commit a0dc2a0 into MobilityDB:main Oct 25, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/nullable-argument-presence-flag branch October 25, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant