Skip to content

State a contiguous array of structs a function reads as an input array - #183

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/struct-value-input-arrays
Oct 9, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/struct-value-input-arrays

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

shape.inputArrays also names a single-pointer parameter MEOS documents as an array followed by a
by-value integer it documents as its number of elements: spanset_make(Span *spans, int count)
reads count spans, as npointset_make(const Npoint *values, int count) and
cbufferset_make(const Cbuffer *values, int count) read count values, where stbox_round(const
STBox *box, int maxdd) reads one box. The C type cannot tell them apart and the @PARAM text can:
attach_struct_input_arrays of parser/shapeinfer.py reads it through extract_param_docs of
parser/nullable.py, the Doxygen #extract_nullable reads, and records the array with its length
and its element as #_input_arrays records an array of pointers. An integer documented otherwise
(Index in meos_array_get) is no length. _signature_fits of parser/sqlfn.py passes no SQL argument
to the length of an input array, as to a bound parameter, so a SQL array fits the array by its
element and attach_claims_fit leaves a signature on the claimant whose array it fits:
Set_constructor's set(float[]) stays on floatset_make and leaves cbufferset_make.

Witness: on MEOS-API master e84319b over MobilityDB master 2a1d52a7ee the catalog states no
inputArrays for spanset_make, spanset_make_exp, spanset_make_free, npointset_make,
cbufferset_make, stboxarr_round and geomval_arr_free, so a binding takes the count for an
argument of its own and the typed Spark and Flink surfaces of JMEOS refuse spanset([]),
set(npoint[]) and set(cbuffer[]) as arity:sql; and cbufferset_make carries the signature
set(float[]) RETURNS floatset.

Measured over MobilityDB master 2a1d52a7ee: run.py states inputArrays for those 7 functions, of
143 single-pointer struct parameters followed by an integer, and removes set(float[]) from
cbufferset_make; every other key of every function equals that of master's parser. The suite
passes 520 tests with none skipped, among them the three of tests/test_shapeinfer.py
StructInputArrayTests and tests/test_claims_fit.py test_an_array_length_takes_no_argument, which
fails with master's parser/sqlfn.py.

Why: the catalog states what a function reads in a form every binding marshals, and the
documentation of a parameter is where MEOS states that a pointer is the first of several values.

shape.inputArrays also names a single-pointer parameter MEOS documents as an array followed by a
by-value integer it documents as its number of elements: spanset_make(Span *spans, int count)
reads count spans, as npointset_make(const Npoint *values, int count) and
cbufferset_make(const Cbuffer *values, int count) read count values, where stbox_round(const
STBox *box, int maxdd) reads one box. The C type cannot tell them apart and the @PARAM text can:
attach_struct_input_arrays of parser/shapeinfer.py reads it through extract_param_docs of
parser/nullable.py, the Doxygen #extract_nullable reads, and records the array with its length
and its element as #_input_arrays records an array of pointers. An integer documented otherwise
(Index in meos_array_get) is no length. _signature_fits of parser/sqlfn.py passes no SQL argument
to the length of an input array, as to a bound parameter, so a SQL array fits the array by its
element and attach_claims_fit leaves a signature on the claimant whose array it fits:
Set_constructor's set(float[]) stays on floatset_make and leaves cbufferset_make.

Witness: on MEOS-API master e84319b over MobilityDB master 2a1d52a7ee the catalog states no
inputArrays for spanset_make, spanset_make_exp, spanset_make_free, npointset_make,
cbufferset_make, stboxarr_round and geomval_arr_free, so a binding takes the count for an
argument of its own and the typed Spark and Flink surfaces of JMEOS refuse spanset(<span>[]),
set(npoint[]) and set(cbuffer[]) as arity:sql; and cbufferset_make carries the signature
set(float[]) RETURNS floatset.

Measured over MobilityDB master 2a1d52a7ee: run.py states inputArrays for those 7 functions, of
143 single-pointer struct parameters followed by an integer, and removes set(float[]) from
cbufferset_make; every other key of every function equals that of master's parser. The suite
passes 520 tests with none skipped, among them the three of tests/test_shapeinfer.py
StructInputArrayTests and tests/test_claims_fit.py test_an_array_length_takes_no_argument, which
fails with master's parser/sqlfn.py.

Why: the catalog states what a function reads in a form every binding marshals, and the
documentation of a parameter is where MEOS states that a pointer is the first of several values.
@estebanzimanyi
estebanzimanyi merged commit f8f63bd into MobilityDB:master Oct 9, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/struct-value-input-arrays branch October 9, 2026 17:47
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