Skip to content

Map a generated parameter by its catalog type alone - #113

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/map-params-by-catalog-type
Sep 30, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/map-params-by-catalog-type

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

FunctionsGenerator gives each parameter the Java type of its C type in the interface, in
the wrapper and in the call, whatever the parameter's name. SIZE_PARAM_NAMES, which gave an
int parameter named size or wkb_size the Java type long, is gone.

Witness. A parameter declared int size maps to long size under the name rule, so a binding
passes a 64-bit value where MEOS reads a 32-bit one. The test
paramTypeFollowsCTypeNotName gives int size, int32_t wkb_size and size_t vsize the types
int, int and long; under the name rule it reads long for the first two.

Measured. Against the catalog and libmeos of MobilityDB a362004728 with MEOS-API
20efba81be, the 26 parameters named size or wkb_size are 21 size_t, 2 size_t *, 2 Datum and
1 double, none int, and GeneratedFunctions.java is byte for byte the one the name rule
generates. The build succeeds and the suites run 106 and 1,799 tests, all passing.

Why. The catalog states the C type of every parameter, and the binding is its projection:
a name carries no type.

FunctionsGenerator gives each parameter the Java type of its C type in the interface, in
the wrapper and in the call, whatever the parameter's name. SIZE_PARAM_NAMES, which gave an
int parameter named size or wkb_size the Java type long, is gone.

Witness. A parameter declared int size maps to long size under the name rule, so a binding
passes a 64-bit value where MEOS reads a 32-bit one. The test
paramTypeFollowsCTypeNotName gives int size, int32_t wkb_size and size_t vsize the types
int, int and long; under the name rule it reads long for the first two.

Measured. Against the catalog and libmeos of MobilityDB a362004728 with MEOS-API
20efba81be, the 26 parameters named size or wkb_size are 21 size_t, 2 size_t *, 2 Datum and
1 double, none int, and GeneratedFunctions.java is byte for byte the one the name rule
generates. The build succeeds and the suites run 106 and 1,799 tests, all passing.

Why. The catalog states the C type of every parameter, and the binding is its projection:
a name carries no type.
@estebanzimanyi
estebanzimanyi merged commit 3909732 into MobilityDB:main Sep 30, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/map-params-by-catalog-type branch September 30, 2026 13: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