Skip to content

feat(meos): add H3Index static comparator NES operators (W138)#158

Open
estebanzimanyi wants to merge 86 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/nebula-codegen-w138-h3index-static-comparators
Open

feat(meos): add H3Index static comparator NES operators (W138)#158
estebanzimanyi wants to merge 86 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/nebula-codegen-w138-h3index-static-comparators

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Wires H3INDEX_EQ, H3INDEX_NE, H3INDEX_LT, H3INDEX_LE, H3INDEX_GT, H3INDEX_GE, and H3INDEX_CMP as 2-arg (a:UINT64, b:UINT64) -> FLOAT64 operators backed by h3index_eq/ne/lt/le/gt/ge (bool -> 0.0/1.0) and h3index_cmp (int -> -1.0/0.0/1.0). These static H3Index comparators are new in ecosystem-pin-2026-06-18b; H3Index maps to UINT64 throughout the NES type system.

…aho-mqtt-cpp

The Nix environment provides paho-mqtt-cpp as a shared-only library and does
not include libmeos.  Four changes make the build pass:

- flake.nix: add stock paho-mqtt-c + paho-mqtt-cpp to baseThirdPartyDeps;
  pass -DNES_ENABLE_MEOS=OFF in both defaultPackage and devShell cmakeFlags.

- nes-plugins/CMakeLists.txt: introduce NES_ENABLE_MQTT and NES_ENABLE_MEOS
  options that gate the respective plugin subdirectories via
  activate_optional_plugin().

- nes-plugins/Sources/MQTTSource, nes-plugins/Sinks/MQTTSink: select
  PahoMqttCpp::paho-mqttpp3-static when available, fall back to the shared
  PahoMqttCpp::paho-mqttpp3 target (Nix only ships the shared variant).

- nes-physical-operators: gate all MEOS-specific add_plugin calls and the
  nes-meos link behind if(NES_ENABLE_MEOS) in three CMakeLists files
  (top-level, Functions/Meos, Aggregation/Function/Meos).

- CMakeLists.txt (root): declare option(NES_ENABLE_MEOS) and
  add_compile_definitions(NES_ENABLE_MEOS) before the nes-* subdirectory
  loop so the preprocessor symbol is visible to all sibling components.

- nes-query-optimizer/LowerToPhysicalWindowedAggregation.cpp: guard the
  TemporalSequenceAggregationPhysicalFunction include and instantiation
  with #ifdef NES_ENABLE_MEOS so the translation unit compiles and links
  when MEOS is disabled.
Add TFLOAT_SIN, TFLOAT_COS, TFLOAT_TAN as per-event scalar operators
following the extract-marshaler pattern from W25. Each takes (value:FLOAT64,
ts:UINT64), constructs a MEOS single-instant temporal via tfloat_in, applies
the trig C function, and extracts the FLOAT64 result via tfloat_start_value.

Logical and physical function pairs registered as NES plugins; SQL parser
extended with TFLOAT_SIN/COS/TAN tokens in the functionName rule and 2-arg
case blocks.
Add TFLOAT_CEIL, TFLOAT_FLOOR, TFLOAT_RADIANS, TFLOAT_DEGREES as per-event
scalar operators following the extract-marshaler pattern from W44. Each takes
(value:FLOAT64, ts:UINT64), constructs a MEOS single-instant temporal via
tfloat_in, applies the scalar C function, and extracts the FLOAT64 result via
tfloat_start_value. TFLOAT_DEGREES hardcodes normalize=false.

Logical and physical function pairs registered as NES plugins; SQL parser
extended with TFLOAT_CEIL/FLOOR/RADIANS/DEGREES tokens in the functionName
rule and 2-arg case blocks.
Add TFLOAT_SHIFT_VALUE and TFLOAT_SCALE_VALUE as per-event scalar operators
following the extract-marshaler pattern. Each takes (value:FLOAT64, ts:UINT64,
param:FLOAT64), constructs a MEOS single-instant temporal via tfloat_in, applies
the shift or scale, and extracts the FLOAT64 result via tfloat_start_value.

Logical and physical function pairs registered as NES plugins; SQL parser
extended with TFLOAT_SHIFT_VALUE/SCALE_VALUE tokens in the functionName rule
and 3-arg case blocks.
…s (W47)

Adds per-event NES operators backed by `tnumber_abs` (2-arg: value, ts)
and `tfloat_shift_scale_value` (4-arg: value, ts, shift, width). Each
operator constructs a single-instant tfloat, applies the MEOS function,
and returns the resulting double. Logical/physical function pairs, plugin
registrations, grammar tokens, and parser case blocks are included.
Adds per-event NES operators backed by `add_tfloat_float`,
`sub_tfloat_float`, `mul_tfloat_float`, and `div_tfloat_float`
(3-arg each: value, ts, scalar). Each operator constructs a
single-instant tfloat, applies the MEOS arithmetic function against
a constant scalar, and returns the resulting double. Logical/physical
function pairs, plugin registrations, grammar tokens, and parser
case blocks are included.
Adds per-event NES operators backed by `add_tnumber_tnumber`,
`sub_tnumber_tnumber`, `mul_tnumber_tnumber`, and `div_tnumber_tnumber`
(3-arg each: value1, value2, shared-ts). Each operator constructs two
co-instant tfloats, applies the MEOS element-wise arithmetic function,
and returns the resulting double. Logical/physical function pairs,
plugin registrations, grammar tokens, and parser case blocks are
included.
…MBER_TNUMBER NES operators (W50)

Adds per-event NES operators backed by temporal_round (3-arg: value, ts,
maxdd), tdistance_tfloat_float (3-arg: value, ts, d), and
tdistance_tnumber_tnumber (3-arg: value1, value2, ts). Each operator
constructs one or two co-instant tfloats, applies the MEOS function, and
returns the resulting double. Logical/physical function pairs, plugin
registrations, grammar tokens, and parser case blocks are included.
Adds per-event NES operators backed by add_tint_int, sub_tint_int,
mul_tint_int, and div_tint_int (3-arg each: value, ts, scalar_int).
Each operator constructs a single-instant tint, applies the MEOS
integer arithmetic function, and returns the resulting integer as
FLOAT64. Logical/physical function pairs, plugin registrations,
grammar tokens, and parser case blocks are included.
…E, TINT_SHIFT_SCALE_VALUE NES operators (W52)
…, TBIGINT_TO_TFLOAT, TINT_TO_TBIGINT, TFLOAT_TO_TBIGINT (W54)
…W57)

Adds per-event scalar NES operators for reversed-order float arithmetic on
tfloat temporals: ADD_FLOAT_TFLOAT, SUB_FLOAT_TFLOAT, MUL_FLOAT_TFLOAT,
DIV_FLOAT_TFLOAT. Each operator takes (scalar:float, value:float, ts:uint64)
and delegates to the corresponding MEOS add_float_tfloat / sub_float_tfloat /
mul_float_tfloat / div_float_tfloat kernel.
Adds per-event scalar NES operators for reversed-order integer arithmetic on
tint temporals: ADD_INT_TINT, SUB_INT_TINT, MUL_INT_TINT, DIV_INT_TINT. Each
operator takes (scalar:int, value:int, ts:uint64) and delegates to the
corresponding MEOS add_int_tint / sub_int_tint / mul_int_tint / div_int_tint
kernel.
… (W59)

Adds per-event scalar NES operators for reversed-order bigint arithmetic on
tbigint temporals: ADD_BIGINT_TBIGINT, SUB_BIGINT_TBIGINT, MUL_BIGINT_TBIGINT,
DIV_BIGINT_TBIGINT. Each operator takes (scalar:bigint, value:bigint, ts:uint64)
and delegates to the corresponding MEOS add_bigint_tbigint / sub_bigint_tbigint /
mul_bigint_tbigint / div_bigint_tbigint kernel.
Adds per-event scalar NES operators for exponential and logarithmic functions
on tfloat temporals: TFLOAT_EXP, TFLOAT_LN, TFLOAT_LOG10. Each operator takes
(value:float, ts:uint64) and delegates to the corresponding MEOS tfloat_exp /
tfloat_ln / tfloat_log10 kernel.
Adds six per-event ever-comparison scalar operators for tfloat against a
float threshold: EVER_EQ_TFLOAT_FLOAT, EVER_GE_TFLOAT_FLOAT,
EVER_GT_TFLOAT_FLOAT, EVER_LE_TFLOAT_FLOAT, EVER_LT_TFLOAT_FLOAT,
EVER_NE_TFLOAT_FLOAT. Each operator constructs a single-instant tfloat
from (value, ts), calls the corresponding MEOS ever_*_tfloat_float
kernel returning int, and emits the result as double. Logical and
physical function pairs, CMakeLists plugin registrations, AntlrSQL
grammar tokens, and AntlrSQLQueryPlanCreator case blocks are included.
…W62)

Adds six per-event always-comparison scalar operators for tfloat against
a float threshold: ALWAYS_EQ_TFLOAT_FLOAT, ALWAYS_GE_TFLOAT_FLOAT,
ALWAYS_GT_TFLOAT_FLOAT, ALWAYS_LE_TFLOAT_FLOAT, ALWAYS_LT_TFLOAT_FLOAT,
ALWAYS_NE_TFLOAT_FLOAT. Each operator constructs a single-instant tfloat
from (value, ts), calls the corresponding MEOS always_*_tfloat_float
kernel returning int, and emits the result as double. Logical and
physical function pairs, CMakeLists plugin registrations, AntlrSQL
grammar tokens, and AntlrSQLQueryPlanCreator case blocks are included.
Adds six per-event ever-comparison scalar operators for tint against an
int threshold: EVER_EQ_TINT_INT, EVER_GE_TINT_INT, EVER_GT_TINT_INT,
EVER_LE_TINT_INT, EVER_LT_TINT_INT, EVER_NE_TINT_INT. Each operator
constructs a single-instant tint from (value, ts), calls the
corresponding MEOS ever_*_tint_int kernel returning int, and emits the
result as double. Logical and physical function pairs, CMakeLists plugin
registrations, AntlrSQL grammar tokens, and AntlrSQLQueryPlanCreator
case blocks are included.
Adds six per-event always-comparison scalar operators for tint against an
int threshold: ALWAYS_EQ_TINT_INT, ALWAYS_GE_TINT_INT,
ALWAYS_GT_TINT_INT, ALWAYS_LE_TINT_INT, ALWAYS_LT_TINT_INT,
ALWAYS_NE_TINT_INT. Each operator constructs a single-instant tint from
(value, ts), calls the corresponding MEOS always_*_tint_int kernel
returning int, and emits the result as double. Logical and physical
function pairs, CMakeLists plugin registrations, AntlrSQL grammar
tokens, and AntlrSQLQueryPlanCreator case blocks are included.
…W65)

Adds six per-event ever-comparison scalar operators for tbigint against a
bigint threshold: EVER_EQ_TBIGINT_BIGINT, EVER_GE_TBIGINT_BIGINT,
EVER_GT_TBIGINT_BIGINT, EVER_LE_TBIGINT_BIGINT, EVER_LT_TBIGINT_BIGINT,
EVER_NE_TBIGINT_BIGINT. Each operator constructs a single-instant tbigint
from (value, ts), calls the corresponding MEOS ever_*_tbigint_bigint
kernel returning int, and emits the result as double. Logical and
physical function pairs, CMakeLists plugin registrations, AntlrSQL
grammar tokens, and AntlrSQLQueryPlanCreator case blocks are included.
… (W66)

Adds six per-event always-comparison scalar operators for tbigint against
a bigint threshold: ALWAYS_EQ_TBIGINT_BIGINT, ALWAYS_GE_TBIGINT_BIGINT,
ALWAYS_GT_TBIGINT_BIGINT, ALWAYS_LE_TBIGINT_BIGINT,
ALWAYS_LT_TBIGINT_BIGINT, ALWAYS_NE_TBIGINT_BIGINT. Each operator
constructs a single-instant tbigint from (value, ts), calls the
corresponding MEOS always_*_tbigint_bigint kernel returning int, and
emits the result as double. Logical and physical function pairs,
CMakeLists plugin registrations, AntlrSQL grammar tokens, and
AntlrSQLQueryPlanCreator case blocks are included.
…INDEX NES operators (W110)

Wires h3_gs_point_to_cell(lon,lat,resolution) as a 3-arg (FLOAT64, FLOAT64, UINT64) -> VARCHAR
operator returning the H3 cell hex string, and ever_eq/ne + always_eq/ne_th3index_h3index as
3-arg (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64 predicates backed by th3indexinst_make.
Wires nine th3index per-event operators across four patterns:
TH3INDEX_GET_RESOLUTION/BASE_CELL_NUMBER/IS_VALID_CELL/IS_PENTAGON as
2-arg (cell:UINT64, ts:UINT64) -> FLOAT64; TH3INDEX_CELL_TO_PARENT_NEXT
and TH3INDEX_CELL_TO_CENTER_CHILD_NEXT as 2-arg -> VARCHAR; TH3INDEX_CELL_TO_PARENT
and TH3INDEX_CELL_TO_CENTER_CHILD as 3-arg (cell, ts, resolution) -> VARCHAR;
and TH3INDEX_CELL_TO_CHILD_POS as 3-arg (cell, ts, parent_res) -> FLOAT64.
…E NES operators (W112)

Wires two binary th3index per-event operators using a new 4-arg pattern
(cell1:UINT64, ts1:UINT64, cell2:UINT64, ts2:UINT64) -> FLOAT64: TH3INDEX_ARE_NEIGHBOR_CELLS
returns 1.0 when two H3 cells share an edge, and TH3INDEX_GRID_DISTANCE returns the
cell-grid distance between two H3 cells. Both build two th3index instants from the
supplied cell+timestamp pairs and extract the scalar result from the Temporal* return.
Wires eleven tcbuffer per-event spatial operators using a new 5-arg pattern
(lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64.
The physical functions build a tcbuffer instant from lon/lat/radius/ts via
cbuffer_make + tcbufferinst_make, parse the target geometry from WKT, and
call the MEOS predicate. Operators: EINTERSECTS/AINTERSECTS_TCBUFFER_GEO,
ECOVERS/ACOVERS_TCBUFFER_GEO, EDISJOINT/ADISJOINT_TCBUFFER_GEO,
ETOUCHES/ATOUCHES_TCBUFFER_GEO, ECONTAINS/ACONTAINS_TCBUFFER_GEO,
NAD_TCBUFFER_GEO (returns distance as FLOAT64).
…perators (W114)

Wires two tcbuffer within-distance per-event operators using a new 6-arg pattern
(lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64)
-> FLOAT64. EDWITHIN_TCBUFFER_GEO returns 1.0 if the tcbuffer instant ever comes
within dist of the static geometry; ADWITHIN_TCBUFFER_GEO returns 1.0 if it is
always within dist.
Wires fifteen tcbuffer-vs-static-cbuffer per-event operators using a new
7-arg all-numeric pattern (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64,
lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. The physical functions
build a tcbuffer instant from the first lon/lat/radius/ts group and a static
Cbuffer from the second lon/lat/radius group. Operators:
EINTERSECTS/AINTERSECTS, ECOVERS/ACOVERS, EDISJOINT/ADISJOINT,
ETOUCHES/ATOUCHES, ECONTAINS/ACONTAINS, EVER_EQ/ALWAYS_EQ,
EVER_NE/ALWAYS_NE _TCBUFFER_CBUFFER, and NAD_TCBUFFER_CBUFFER.
Wires twelve operators over two tcbuffer instants using a new 8-arg all-numeric
pattern (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, lon2:FLOAT64,
lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. The physical functions build
two tcbuffer instants independently then delegate to the MEOS kernel. Operators:
EVER_EQ/ALWAYS_EQ, EVER_NE/ALWAYS_NE, EINTERSECTS/AINTERSECTS,
ECOVERS/ACOVERS, ADISJOINT, ETOUCHES/ATOUCHES _TCBUFFER_TCBUFFER,
and NAD_TCBUFFER_TCBUFFER.
…rs (W117)

Wires three tcbuffer-vs-tcbuffer operators that take a distance threshold using a
9-arg all-numeric pattern (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64,
lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, dist:FLOAT64) -> FLOAT64.
Operators: EDWITHIN_TCBUFFER_TCBUFFER, ADWITHIN_TCBUFFER_TCBUFFER (return 0/1),
and MINDISTANCE_TCBUFFER_TCBUFFER (returns the minimum distance or -1.0 on error).
… (W118)

Wires ten tnpoint operators using three new patterns. A tnpoint instant is
represented as (rid:UINT64, pos:FLOAT64, ts:UINT64) and built via npoint_make
then tnpointinst_make. Pattern A (4-arg with VARCHAR): NAD_TNPOINT_GEO.
Pattern B (5-arg tnpoint-first: rid1,pos1,ts,rid2,pos2): EVER_EQ/ALWAYS_EQ/
EVER_NE/ALWAYS_NE/NAD _TNPOINT_NPOINT. Pattern C (5-arg npoint-first reversed:
rid_np,pos_np,rid_tp,pos_tp,ts): EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE
_NPOINT_TNPOINT.
Wires five tnpoint-vs-tnpoint operators using a 6-arg all-numeric pattern
(rid1:UINT64, pos1:FLOAT64, ts1:UINT64, rid2:UINT64, pos2:FLOAT64, ts2:UINT64)
-> FLOAT64. Each physical function builds two tnpoint instants via npoint_make
and tnpointinst_make. Operators: EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE
_TNPOINT_TNPOINT (return 0.0/1.0), and NAD_TNPOINT_TNPOINT (nearest approach
distance or -1.0 on error).
…(W120)

Wires ten tpose operators using three new patterns for 2D poses. A tpose 2D
instant is represented as (x:FLOAT64, y:FLOAT64, theta:FLOAT64, ts:UINT64)
and built via pose_make_2d(x,y,theta,false,0) then tposeinst_make. Pattern A
(5-arg with VARCHAR: x,y,theta,ts,wkt): NAD_TPOSE_GEO. Pattern B (7-arg tpose-
first: x,y,theta,ts,x2,y2,theta2): EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE/NAD
_TPOSE_POSE. Pattern C (7-arg pose-first reversed: x2,y2,theta2,x,y,theta,ts):
EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE _POSE_TPOSE.
Wires five tpose-vs-tpose operators using an 8-arg all-numeric pattern
(x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, x2:FLOAT64, y2:FLOAT64,
theta2:FLOAT64, ts2:UINT64) -> FLOAT64. Each physical function builds two 2D
tpose instants via pose_make_2d(x,y,theta,false,0) and tposeinst_make.
Operators: EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE _TPOSE_TPOSE (return 0.0/1.0)
and NAD_TPOSE_TPOSE (nearest approach distance or -1.0 on error).
Wires nine trgeometry operators using a dual-VARCHAR pattern. A trgeometry 2D
instant is built from (ref_wkt:VARCHAR, x:FLOAT64, y:FLOAT64, theta:FLOAT64,
ts:UINT64) via geom_in(ref_wkt), pose_make_2d(x,y,theta,false,0), and
trgeoinst_make(gs_ref, pose, ts). Pattern A (6-arg trgeometry-first with
trailing target VARCHAR): EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE/NAD
_TRGEOMETRY_GEO. Pattern B (6-arg geo-first reversed, target VARCHAR first):
EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE_GEO_TRGEOMETRY.
…W123)

Wires five trgeometry-vs-trgeometry per-event scalar operators using a 10-arg
dual-VARCHAR two-instant pattern (ref1_wkt:VARCHAR, x1:FLOAT64, y1:FLOAT64,
theta1:FLOAT64, ts1:UINT64, ref2_wkt:VARCHAR, x2:FLOAT64, y2:FLOAT64,
theta2:FLOAT64, ts2:UINT64) -> FLOAT64. Each physical function builds two 2D
trgeometry instants via geom_in(ref_wkt), pose_make_2d, and trgeoinst_make.
Operators: EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE_TRGEOMETRY_TRGEOMETRY
(return 0.0/1.0) and NAD_TRGEOMETRY_TRGEOMETRY (distance or 0.0 on error).
…124)

Wires two tpcpoint-vs-geometry per-event scalar operators using a 3-arg
pattern (pt_hexwkb:VARCHAR, ts:UINT64, tgt_wkt:VARCHAR) -> FLOAT64. Each
physical function deserializes the pcpoint from hex-WKB via
pcpoint_from_hexwkb, wraps it as a tpcpoint instant via
tpointcloudinst_make, and evaluates the geometry target built from WKT.
Operators: EINTERSECTS_TPCPOINT_GEO (returns 0.0/1.0) and
NAD_TPCPOINT_GEO (returns nearest-approach distance).
Wires seven quadbin cell operators across four patterns: QUADBIN_POINT_TO_CELL (lon/lat/res→VARCHAR), QUADBIN_IS_VALID_CELL/GET_RESOLUTION/CELL_AREA (cell→FLOAT64), QUADBIN_CELL_TO_QUADKEY (cell→VARCHAR), QUADBIN_CELL_TO_PARENT (cell/res→VARCHAR), QUADBIN_TILE_TO_CELL (x/y/z→VARCHAR). Cell values are UINT64; VARCHAR results use quadbin_index_to_string or quadbin_cell_to_quadkey serialization.
Wires four tjsonb-vs-jsonb per-event scalar comparison operators using a 3-arg
pattern (json_str:VARCHAR, ts:UINT64, target_json:VARCHAR) -> FLOAT64. Each
physical function deserializes both JSON strings via jsonb_in, wraps the first
as a tjsonb instant via tjsonbinst_make, then evaluates the comparison.
Operators: EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE_TJSONB_JSONB (return 0.0/1.0).
Wires four tjsonb-vs-tjsonb per-event scalar comparison operators using a 4-arg
dual-instant pattern (json1:VARCHAR, ts1:UINT64, json2:VARCHAR, ts2:UINT64)
-> FLOAT64. Each physical function deserializes two JSON strings via jsonb_in
and wraps them as tjsonb instants via tjsonbinst_make.
Operators: EVER_EQ/ALWAYS_EQ/EVER_NE/ALWAYS_NE_TJSONB_TJSONB (return 0.0/1.0).
…(W128)

Wires GEOM_BOUNDARY, GEOM_CENTROID, GEOM_CONVEX_HULL, GEO_REVERSE, GEO_POINTS,
and GEOM_UNARY_UNION as 1-arg (wkt:VARCHAR) -> VARCHAR operators. Each physical
function parses the WKT input via geom_in, calls the corresponding MEOS
GSERIALIZED-returning function, then serializes the result with geo_as_text
into an arena-allocated buffer.
… WKT (W129)

Wires GEOM_DIFFERENCE2D, GEOM_INTERSECTION2D, GEOM_SHORTESTLINE2D, and
GEOM_SHORTESTLINE3D as 2-arg (wkt1:VARCHAR, wkt2:VARCHAR) -> VARCHAR operators.
Each physical function parses both WKT inputs via geom_in, calls the
corresponding MEOS GSERIALIZED-returning function, then serializes the
result with geo_as_text into an arena-allocated buffer.
…ing WKT (W130)

Wires GEO_SET_SRID (wkt,srid:U64), GEO_TRANSFORM (wkt,srid_to:U64), GEO_ROUND
(wkt,maxdd:U64), and GEOM_BUFFER (wkt,size:F64,params:VARCHAR) as VARCHAR-returning
operators. Each physical function parses the WKT input via geom_in, applies
the transformation, and serializes the result with geo_as_text.
Wires LINE_NUMPOINTS (wkt->FLOAT64), LINE_LOCATE_POINT (wkt1,wkt2->FLOAT64),
LINE_INTERPOLATE_POINT (wkt,frac:F64,repeat:U64->VARCHAR), and LINE_SUBSTRING
(wkt,from:F64,to:F64->VARCHAR). FLOAT64-returning ops call line_numpoints/
line_locate_point directly; VARCHAR-returning ops parse via geom_in and
serialize results with geo_as_text.
Wires GEOM_POINT_MAKE2D/3DZ and GEOG_POINT_MAKE2D/3DZ (srid:U64,x,y[,z]:F64->
VARCHAR), GEOM_TO_GEOG and GEOG_TO_GEOM (wkt:VARCHAR->VARCHAR), and
GEOG_CENTROID (wkt:VARCHAR,use_spheroid:U64->VARCHAR). Constructor ops call
geompoint_make2d/3dz and geogpoint_make2d/3dz directly; conversion and
centroid ops parse via geom_in/geog_in and serialize with geo_as_text.
…ection NES operators (W133)

Wires GEO_GEO_N (wkt,n:U64->VARCHAR) for nth component of a geometry collection,
LINE_POINT_N (wkt,n:U64->VARCHAR) for nth point of a linestring (1-based), and
GEOM_INTERSECTION2D_COLL (wkt1,wkt2->VARCHAR) for collection-typed intersection.
All ops parse WKT via geom_in and serialize results with geo_as_text.
…erators (W134)

Wires GEO_AS_GEOJSON/HEXEWKB/EWKT (wkt->VARCHAR), GEO_FROM_GEOJSON and
GEOM_FROM_HEXEWKB (string->WKT), GEO_TRANSFORM_PIPELINE (wkt,pipeline,srid,dir->
VARCHAR), GEOM_MIN_BOUNDING_CENTER (wkt->VARCHAR center WKT), and
GEOM_MIN_BOUNDING_RADIUS (wkt->FLOAT64). GeoJSON buffer is MAX_LEN=16384 to
accommodate larger JSON payloads.
Wires GEOM_RELATE_PATTERN(wkt1, wkt2, pattern) as a FLOAT64-returning per-event
operator (1.0=match, 0.0=no match) via geom_relate_pattern, completing the
core static geometry surface in MobilityNebula.
Wires 14 per-event operators for temporal geometry pairs — ever/always_eq/ne,
eintersects/ecovers/edisjoint/econtains/etouches, aintersects/acovers/adisjoint/
acontains/atouches — as 6-arg (lon1,lat1,ts1:U64,lon2,lat2,ts2:U64) → FLOAT64
predicates backed by meos_geo_tgeo_tgeo functions.
Wires EDWITHIN_TGEO_TGEO and ADWITHIN_TGEO_TGEO as 7-arg
(lon1,lat1,ts1:U64,lon2,lat2,ts2:U64,dist:F64) → FLOAT64 predicates
backed by edwithin_tgeo_tgeo / adwithin_tgeo_tgeo. Completes the
tgeo_tgeo predicate family in MobilityNebula.
Wires H3INDEX_EQ, H3INDEX_NE, H3INDEX_LT, H3INDEX_LE, H3INDEX_GT,
H3INDEX_GE, and H3INDEX_CMP as 2-arg (a:UINT64, b:UINT64) -> FLOAT64
operators backed by h3index_eq/ne/lt/le/gt/ge (bool -> 0.0/1.0) and
h3index_cmp (int -> -1.0/0.0/1.0). New in pin ecosystem-pin-2026-06-18b.
@estebanzimanyi estebanzimanyi force-pushed the feat/nebula-codegen-w138-h3index-static-comparators branch from a21fdb1 to 8abdb25 Compare June 23, 2026 06:56
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