Skip to content

State the value and the presence flag a NULL default argument feeds - #204

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

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/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: Raster_reclass passes has_nodata = ! PG_ARGISNULL(4) and nodataval = has_nodata ? PG_GETARG_FLOAT8(4) : 0.0, and Raquet_constructor, Raster_make and Raster_add_band do the same. attach_null_default_binds of parser/boundargs.py reads such a local as a parameter the argument feeds (#_presence_flag, every assignment of it ! PG_ARGISNULL(k) or PG_ARGISNULL(k)), and #_null_value reads the value a flag holds when the argument is NULL and the branch x = flag ? ... : literal takes then. The signature states both parameters in nullDefaultBinds, and the value the flag takes when the argument is given in presentBinds: reclass(rast, nband, reclassexpr, pixeltype, nodataval float DEFAULT NULL) states nullDefaultBinds {4: {has_nodata: false, nodataval: 0.0}} and presentBinds {4: {has_nodata: true}}.

Witness: over MobilityDB master bc6f2729ea the catalog states argDefaults NULL for the nodata argument of raquet, raster, addBand and reclass and nothing of what their wrappers pass for it, so a binding pairs one SQL argument with two C parameters: the typed Spark and Flink surfaces of JMEOS register none of the four, each refused as arity:sql, and #185 names raquet and reclass among the signatures whose NULL argument the rules do not read.

Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states the two maps for the 4 signatures, raquet_make, raster_make, raster_add_band and raster_reclass, each value the one its wrapper passes; every other key of the 5359 functions, and every top-level section but the path of the checkout the object model names, equals that of master's parser. The suite passes 558 tests with 26 skipped, the engine tests needing MEOS_LIBRARY_PATH, as master's passes 556 with the same 26 skipped; the two new ones are tests/test_boundargs.py PresenceFlagTests, a flag stating the argument given and one stating it absent.

Why: a call answers as PostgreSQL does only when the binding passes what the wrapper passes, for the flag as for the value, and those values are the catalog's to state.

A wrapper may read an argument declared DEFAULT NULL as two C parameters, its value and a flag stating whether it is given: Raster_reclass passes has_nodata = ! PG_ARGISNULL(4) and nodataval = has_nodata ? PG_GETARG_FLOAT8(4) : 0.0, and Raquet_constructor, Raster_make and Raster_add_band do the same. attach_null_default_binds of parser/boundargs.py reads such a local as a parameter the argument feeds (#_presence_flag, every assignment of it `! PG_ARGISNULL(k)` or `PG_ARGISNULL(k)`), and #_null_value reads the value a flag holds when the argument is NULL and the branch `x = flag ? ... : literal` takes then. The signature states both parameters in nullDefaultBinds, and the value the flag takes when the argument is given in presentBinds: reclass(rast, nband, reclassexpr, pixeltype, nodataval float DEFAULT NULL) states nullDefaultBinds {4: {has_nodata: false, nodataval: 0.0}} and presentBinds {4: {has_nodata: true}}.

Witness: over MobilityDB master bc6f2729ea the catalog states argDefaults NULL for the nodata argument of raquet, raster, addBand and reclass and nothing of what their wrappers pass for it, so a binding pairs one SQL argument with two C parameters: the typed Spark and Flink surfaces of JMEOS register none of the four, each refused as arity:sql, and MobilityDB#185 names raquet and reclass among the signatures whose NULL argument the rules do not read.

Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states the two maps for the 4 signatures, raquet_make, raster_make, raster_add_band and raster_reclass, each value the one its wrapper passes; every other key of the 5359 functions, and every top-level section but the path of the checkout the object model names, equals that of master's parser. The suite passes 558 tests with 26 skipped, the engine tests needing MEOS_LIBRARY_PATH, as master's passes 556 with the same 26 skipped; the two new ones are tests/test_boundargs.py PresenceFlagTests, a flag stating the argument given and one stating it absent.

Why: a call answers as PostgreSQL does only when the binding passes what the wrapper passes, for the flag as for the value, and those values are the catalog's to state.
@estebanzimanyi
estebanzimanyi merged commit c1abe85 into MobilityDB:master Oct 25, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/nullable-argument-presence-flag branch October 25, 2026 17:28
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