Repository navigation
Lay out a returned SQL array as the catalog's arrayShape states on the typed SQL surfaces - #195
Merged
estebanzimanyi merged 1 commit intoOct 25, 2026
Conversation
…e typed SQL surfaces A signature returning a SQL array whose layout its wrapper gives beyond the C array, the catalog's arrayShape, is read by _array_shape_overload of tools/codegen_jvm.py: each element of the C array, NULL where the output array arrayShape names as nulls is true, and with a rowLength the elements cut into rows of the length the public function it names answers for the parameters it names, an array of arrays on both engines as PostgreSQL answers a two-dimensional array. dumpValues(raster, integer, boolean) answers a row of values per row of the raster, raster_width of it long, NULL for a nodata pixel, and frees the values and the mask raster_dump_values allocates. Witness: over MobilityDB master 1a7a1a0e11 and MEOS-API master 90583fe, whose catalog states the arrayShape of dumpValues(raster, integer, boolean) since MEOS-API #208, main's generator refuses it on the typed Spark and Flink surfaces as arity:jmeos. Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1306 SQL functions and 9375 overloads where main's answer 1305 and 9373, the 2 more the calls of dumpValues with and without its exclusion of the nodata pixels, each answering ARRAY<ARRAY<DOUBLE>>, and every other generated file is identical. codegen/src/test/java/JvmArrayShapeTest.java runs the generator over a function whose signature states its null mask and the function answering the length of its rows: on main it is refused as arity:jmeos on both surfaces, and here it answers an array of arrays of the rows of that length, NULL where the mask is true, freeing the mask with the array.
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 signature returning a SQL array whose layout its wrapper gives beyond the C array, the catalog's arrayShape, is read by _array_shape_overload of tools/codegen_jvm.py: each element of the C array, NULL where the output array arrayShape names as nulls is true, and with a rowLength the elements cut into rows of the length the public function it names answers for the parameters it names, an array of arrays on both engines as PostgreSQL answers a two-dimensional array. dumpValues(raster, integer, boolean) answers a row of values per row of the raster, raster_width of it long, NULL for a nodata pixel, and frees the values and the mask raster_dump_values allocates.
Witness: over MobilityDB master 1a7a1a0e11 and MEOS-API master 90583fe, whose catalog states the arrayShape of dumpValues(raster, integer, boolean) since MEOS-API #208, main's generator refuses it on the typed Spark and Flink surfaces as arity:jmeos.
Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1306 SQL functions and 9375 overloads where main's answer 1305 and 9373, the 2 more the calls of dumpValues with and without its exclusion of the nodata pixels, each answering ARRAY<ARRAY>, and every other generated file is identical. codegen/src/test/java/JvmArrayShapeTest.java runs the generator over a function whose signature states its null mask and the function answering the length of its rows: on main it is refused as arity:jmeos on both surfaces, and here it answers an array of arrays of the rows of that length, NULL where the mask is true, freeing the mask with the array.