Skip to content

Read an unsigned count field in an integer column of a set of rows on the typed SQL surfaces - #193

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/unsigned-count-column
Oct 25, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/unsigned-count-column

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A set-returning function whose rows read the fields of the structures it returns reads each field through SETRET_FIELD of tools/codegen_jvm.py, which reads an unsigned 32-bit count in an integer column as the 32-bit integer the wrapper returns: valueCount(raster, ...) answers the value and the count of each ValueCount, as Raster_value_count returns its count. An array of uint32_t elements is read as before, through SETRET_SCALAR, where geo_cluster_dbscan answers UINT32_MAX for a noise point that its wrapper turns into NULL.

Witness: over MobilityDB master 1a7a1a0e11 and MEOS-API master 71c23da, main's generator refuses valueCount on the typed Spark and Flink surfaces as setret:column/return:integer, the count of ValueCount being a uint32_t.

Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1303 SQL functions and 9367 overloads where main's answer 1302 and 9365, the 2 more the calls of valueCount(raster, integer, boolean, float[], float) with and without its rounding, and every other generated file is identical. codegen/src/test/java/JvmStructFieldColumnTest.java runs the generator over a function whose rows read a double and a uint32_t field of the structures it returns: on main it is refused as setret:column/return:integer on both surfaces, and here each row reads both fields at their offsets.

… the typed SQL surfaces

A set-returning function whose rows read the fields of the structures it returns reads each field through SETRET_FIELD of tools/codegen_jvm.py, which reads an unsigned 32-bit count in an integer column as the 32-bit integer the wrapper returns: valueCount(raster, ...) answers the value and the count of each ValueCount, as Raster_value_count returns its count. An array of uint32_t elements is read as before, through SETRET_SCALAR, where geo_cluster_dbscan answers UINT32_MAX for a noise point that its wrapper turns into NULL.

Witness: over MobilityDB master 1a7a1a0e11 and MEOS-API master 71c23da, main's generator refuses valueCount on the typed Spark and Flink surfaces as setret:column/return:integer, the count of ValueCount being a uint32_t.

Measured over the same pair with the jar built from that catalog and that libmeos: the Spark SQL and Flink SQL surfaces each answer 1303 SQL functions and 9367 overloads where main's answer 1302 and 9365, the 2 more the calls of valueCount(raster, integer, boolean, float[], float) with and without its rounding, and every other generated file is identical. codegen/src/test/java/JvmStructFieldColumnTest.java runs the generator over a function whose rows read a double and a uint32_t field of the structures it returns: on main it is refused as setret:column/return:integer on both surfaces, and here each row reads both fields at their offsets.
@estebanzimanyi
estebanzimanyi merged commit 98f26b8 into MobilityDB:main Oct 25, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/unsigned-count-column branch October 25, 2026 21:15
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