Skip to content

Generate the splits and asMVTGeom from the columns MEOS writes back - #500

Merged
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:gen/columns-written-back
Oct 25, 2026
Merged

estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:gen/columns-written-back

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Generate the splits of a temporal value from the catalog

MobilityDB declares timeSplit, valueSplit, valueTimeSplit, spaceSplit and spaceTimeSplit as SETOF a composite of the bins and the piece, and the C functions return the pieces and hand each bin array back through an out-parameter. The catalog states per signature which array fills each column (columns, from naming the out-parameter or the return), the SQL defaults and the sizes a short form binds. shape_split reads that: each signature is a table function in-out over its input rows, so the temporal value of a LATERAL call is a column, each row making the one MEOS call when the output reaches it. A body reads the arguments its call passes and the SQL default of the others, and the signatures that differ only in the temporal type share one, reading the type and the column names from its TableFunctionInfo: 19 bodies register 162 forms. The hand registrations of src/temporal/temporal.cpp and src/geo/tgeompoint.cpp are deleted, and the five names leave RETIRE_UNCOVERED_OK.

The surface follows MobilityDB where the hand registrations did not. The columns take the names MobilityDB declares (point, time, tpoint for spaceTimeSplit; number, time, tnumber for valueTimeSplit; time, temp for timeSplit). The default time origin '2000-01-03' is read in the TimeZone setting, as MobilityDB reads its SQL default and as the generated timeTiles reads it: MobilityDB's regression answers timeSplit(tint '[1@2001-01-01, ...]', '1 week') with the bin Mon Jan 01 00:00:00 2001 PST. The splits reach the tbigint splits, timeSplit over all 20 temporal types, spaceSplit and spaceTimeSplit over tgeometry and tgeogpoint, and the one- and two-size forms.

The split tests state UTC-midnight data, so they set TimeZone to UTC, and read the columns by MobilityDB's names. 025_temporal_tile_split_forms.test checks the tbigint value splits, timeSplit over ttext and the one-size spaceTimeSplit over tgeometry against the rows of MobilityDB's regression outputs, in its time zone.

Measured: the generator run twice over the catalog of the pin ac8feb51dc writes the same surface; 025_temporal_tile_split, 025_temporal_tile_border_inc, 025_temporal_tile, 058b_tpoint_split, 058c_tpoint_split_lateral and 025_temporal_tile_split_forms pass on a native build.

Generate asMVTGeom from the catalog

MobilityDB declares asMVTGeom as RETURNS geom_times, the composite of a geometry and the bigint[] of its times, and tpoint_as_mvtgeom answers whether the value meets the bounds and hands the geometry back through one out-parameter and the times through an array and its count. The catalog states per signature which out-parameter fills each column. shape_row_out reads that: each signature is a scalar answering a STRUCT of the declared columns, a geometry handed back alone or an array read whole into a LIST, reading the arguments its call passes and the SQL default of the others. A NULL argument, and a value that meets nothing in the bounds, answer NULL. The hand executor of src/geo/tgeompoint.cpp is deleted, and asMVTGeom leaves RETIRE_UNCOVERED_OK.

076_asmvtgeom_geomeasure.test adds MobilityDB's regression cases, their geometries rounded to six decimals as MobilityDB's regression rounds them: the form with clip false, a 3D trajectory, a value that meets nothing in the bounds, and the error on an extent of 0.

Measured: the generator run twice over the catalog of the pin ac8feb51dc writes the same surface; 076_asmvtgeom_geomeasure passes on a native build.

MobilityDB declares timeSplit, valueSplit, valueTimeSplit, spaceSplit and spaceTimeSplit as SETOF a composite of the bins and the piece, and the C functions return the pieces and hand each bin array back through an out-parameter. The catalog states per signature which array fills each column (columns, from naming the out-parameter or the return), the SQL defaults and the sizes a short form binds. shape_split reads that: each signature is a table function in-out over its input rows, so the temporal value of a LATERAL call is a column, each row making the one MEOS call when the output reaches it. A body reads the arguments its call passes and the SQL default of the others, and the signatures that differ only in the temporal type share one, reading the type and the column names from its TableFunctionInfo: 19 bodies register 162 forms. The hand registrations of src/temporal/temporal.cpp and src/geo/tgeompoint.cpp are deleted, and the five names leave RETIRE_UNCOVERED_OK.

The surface follows MobilityDB where the hand registrations did not. The columns take the names MobilityDB declares (point, time, tpoint for spaceTimeSplit; number, time, tnumber for valueTimeSplit; time, temp for timeSplit). The default time origin '2000-01-03' is read in the `TimeZone` setting, as MobilityDB reads its SQL default and as the generated timeTiles reads it: MobilityDB's regression answers timeSplit(tint '[1@2001-01-01, ...]', '1 week') with the bin Mon Jan 01 00:00:00 2001 PST. The splits reach the tbigint splits, timeSplit over all 20 temporal types, spaceSplit and spaceTimeSplit over tgeometry and tgeogpoint, and the one- and two-size forms.

The split tests state UTC-midnight data, so they set `TimeZone` to UTC, and read the columns by MobilityDB's names. 025_temporal_tile_split_forms.test checks the tbigint value splits, timeSplit over ttext and the one-size spaceTimeSplit over tgeometry against the rows of MobilityDB's regression outputs, in its time zone.

Measured: the generator run twice over the catalog of the pin ac8feb51dc writes the same surface; 025_temporal_tile_split, 025_temporal_tile_border_inc, 025_temporal_tile, 058b_tpoint_split, 058c_tpoint_split_lateral and 025_temporal_tile_split_forms pass on a native build.
MobilityDB declares asMVTGeom as RETURNS geom_times, the composite of a geometry and the bigint[] of its times, and tpoint_as_mvtgeom answers whether the value meets the bounds and hands the geometry back through one out-parameter and the times through an array and its count. The catalog states per signature which out-parameter fills each column. shape_row_out reads that: each signature is a scalar answering a STRUCT of the declared columns, a geometry handed back alone or an array read whole into a LIST, reading the arguments its call passes and the SQL default of the others. A NULL argument, and a value that meets nothing in the bounds, answer NULL. The hand executor of src/geo/tgeompoint.cpp is deleted, and asMVTGeom leaves RETIRE_UNCOVERED_OK.

076_asmvtgeom_geomeasure.test adds MobilityDB's regression cases, their geometries rounded to six decimals as MobilityDB's regression rounds them: the form with clip false, a 3D trajectory, a value that meets nothing in the bounds, and the error on an extent of 0.

Measured: the generator run twice over the catalog of the pin ac8feb51dc writes the same surface; 076_asmvtgeom_geomeasure passes on a native build.
@estebanzimanyi
estebanzimanyi force-pushed the gen/columns-written-back branch from 862077f to 068cea1 Compare October 25, 2026 00:32
@estebanzimanyi
estebanzimanyi merged commit 9c95add into MobilityDB:main Oct 25, 2026
9 checks passed
@estebanzimanyi
estebanzimanyi deleted the gen/columns-written-back branch October 25, 2026 07:25
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