Skip to content

docs(berlinmod): streaming-semantics tier overlay + remove stale 'Not covered' section (stacks on #17)#18

Open
estebanzimanyi wants to merge 4 commits into
MobilityDB:mainfrom
estebanzimanyi:docs/berlinmod-streaming-semantics-tier-overlay
Open

docs(berlinmod): streaming-semantics tier overlay + remove stale 'Not covered' section (stacks on #17)#18
estebanzimanyi wants to merge 4 commits into
MobilityDB:mainfrom
estebanzimanyi:docs/berlinmod-streaming-semantics-tier-overlay

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Docs-only follow-up on the BerlinMOD-9 × 3-form parity stack (#15#16#17). Two surgical edits to docs/berlinmod-streaming-forms.md:

1. Add: streaming-semantics tier overlay

Classifies each BerlinMOD-Q by its streaming-execution tier (stateless / bounded-state / windowed / cross-stream) per the closed 7-value vocabulary proposed for the MEOS-API objectModel.streamingSemantics facet (sibling RFC on MEOS-API PR #10).

The mapping makes the cross-binding picture explicit: a Q's tier on NebulaStream is the same tier on Flink / Kafka, regardless of how the engine realizes it. Each row of the new table pairs the BerlinMOD-Q with its NebulaStream realization and points to the equivalent generic wiring on Flink.

Tier BerlinMOD-Q NebulaStream realization Equivalent Flink wiring
stateless Q1 Simple SQL aggregation; no MEOS handle MeosStatelessMap / MeosStatelessFilter
bounded-state Q2, Q3, Q4, Q7, Q8 Per-key latest-position aggregations (TEMPORAL_SEQUENCE pattern) MeosBoundedStateMap
windowed Q6 Window-close-only aggregation (TEMPORAL_LENGTH) MeosWindowedAggregate
cross-stream Q5, Q9 Four-field aggregations with internal cross-vehicle state (PAIR_MEETING, CROSS_DISTANCE) MeosCrossStreamJoin

Plus two short follow-up notes explaining (a) why cross-stream looks different on NebulaStream (single-aggregation Cartesian enumeration vs Flink's interval-join across two streams — same semantic, different topology) and (b) why Q7 is bounded-state rather than windowed (per-POI fan-out, per-(vehicle, POI) bounded state).

2. Remove: stale "Not covered (15 cells / 5 queries)" section

After PR #16 (TEMPORAL_LENGTH closes Q6) and PR #17 (PAIR_MEETING + CROSS_DISTANCE close Q5 + Q9), the matrix is 27/27 full — the doc's own Coverage table at the top confirms it. But the "Not covered (15 cells / 5 queries)" section at line 77 was a remnant from the pre-#16/#17 state, listing Q5/Q6/Q7/Q8/Q9 as blocked. Replace it with the tier-overlay table above.

3. Refresh "Sibling parity references"

Drop stale PR-number references (per the same as-is / no-internal-process discipline applied elsewhere — those PR refs decay as the linked PRs merge), and point at the current state of the Flink and Kafka work:

  • Flink's per-tier wiring infrastructure under org.mobilitydb.flink.meos.wirings (5 generic classes covering 100% of the streamable surface; a capstone demo composes all four tiers into one pipeline)
  • Kafka's codegen mirror under org.mobilitydb.kafka.meos

Diff

Metric Value
Files changed 1 (docs/berlinmod-streaming-forms.md)
Lines +22 / -12
Touches no YAML
Touches no C++ pipeline-layer file

Stacking

Stacks on feat/pair-meeting-cross-distance-aggregations (PR #17). Docs-only; CI on a docs-only branch should pass cleanly.

… on NebulaStream (33 YAMLs, 27/27 cells)

Additive scaffold for the BerlinMOD-9 × 3 streaming-form parity contract
on MobilityNebula, sibling to the existing SNCB Q-series and matching
the MobilityFlink MobilityDB#3 / MobilityKafka MobilityDB#1 streaming-form definitions.

All 27 cells covered:

  Q1 'which vehicles have appeared'      — full (continuous + windowed + snapshot)
  Q2 'where is vehicle X at time T'      — full
  Q3 'vehicles within 5 km of P'         — full
  Q4 'vehicles inside region R (polygon)'— full
  Q5 'pairs of vehicles meeting near P'  — partial (emit per-vehicle trajectories near P; consumer joins)
  Q6 'cumulative distance per vehicle'   — partial (emit TEMPORAL_SEQUENCE; consumer computes length)
  Q7 'first passage of vehicle through POI' × {POI1, POI2, POI3}
                                          — full (per-POI fan-out)
  Q8 'vehicles within d of LINESTRING'   — full (edwithin_tgeo_geo with LINESTRING geometry)
  Q9 'distance between X and Y at time T'— partial (emit X and Y trajectories; consumer joins)

18 of 27 cells are FULL (the BerlinMOD-Q semantic is computed entirely
inside NebulaStream). 9 cells are PARTIAL — NebulaStream emits the
per-window inputs (trajectory, candidate vehicles) and a consumer
post-processes for the final BerlinMOD-Q answer. The partial pattern
is the natural expression of these queries in NebulaStream's current
SQL surface; the path to FULL is documented per-Q in
docs/berlinmod-streaming-forms.md (a stream-self-join for Q5/Q9, a
temporal_length scalar function for Q6).

Form mapping to NebulaStream windows:

  continuous: SLIDING(time_utc, SIZE 1 SEC, ADVANCE BY 1 SEC)
  windowed:   TUMBLING(time_utc, SIZE 10 SEC)
  snapshot:   TUMBLING(time_utc, SIZE 5 SEC)

MEOS-side surface consumed (already exposed by PR MobilityDB#14 + follow-ups):

  edwithin_tgeo_geo — Q3 (POINT predicate), Q4 (POLYGON, d=0.0),
                      Q5 (POINT predicate), Q7 (per-POI POINT),
                      Q8 (LINESTRING predicate)
  TEMPORAL_SEQUENCE — Q2 / Q5 / Q6 / Q9 (per-window per-vehicle trajectory)

No new MEOS PhysicalFunction classes added; no C++ changes; no SNCB
Q-series modifications. All 33 YAMLs are additive in a new
Queries/berlinmod/ subdirectory.

Add (additions):
  Queries/berlinmod/q1_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q2_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q3_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q4_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q5_{continuous,windowed,snapshot}.yaml          (3, partial)
  Queries/berlinmod/q6_{continuous,windowed,snapshot}.yaml          (3, partial)
  Queries/berlinmod/q7_poi{1,2,3}_{continuous,windowed,snapshot}.yaml (9, full via fan-out)
  Queries/berlinmod/q8_{continuous,windowed,snapshot}.yaml          (3, LINESTRING predicate)
  Queries/berlinmod/q9_{continuous,windowed,snapshot}.yaml          (3, partial)
  Input/input_berlinmod.csv  (sample data: 3 vehicles × 21 events, 14 simulated seconds)
  docs/berlinmod-streaming-forms.md

Validation: every YAML parses cleanly via python3 yaml.safe_load.
Runtime verification gated on the NebulaStream test harness.

Coverage: 27 of 27 cells (100 %), with 18 FULL and 9 PARTIAL annotated
explicitly per Q. Path to FULL for the 9 PARTIAL cells is one
MobilityNebula C++ PhysicalFunction class each (or a NebulaStream
upstream stream-self-join), documented in
docs/berlinmod-streaming-forms.md.
…-form cells to full

Adds the TEMPORAL_LENGTH aggregation across the four levels of the
NebulaStream pipeline (logical / physical / parser / lowering) so the
BerlinMOD-Q6 "cumulative distance per vehicle" streaming-form cells
(continuous + windowed + snapshot) compute the spheroidal trajectory
length entirely inside NebulaStream instead of emitting raw trajectories
for a consumer-side reduction.

Logical: nes-logical-operators/{include,src}/Operators/Windows/Aggregations/Meos/TemporalLengthAggregationLogicalFunction.{hpp,cpp}
mirroring TemporalSequenceAggregationLogicalFunctionV2 but with finalAggregateStampType = FLOAT64.
Registers as "TemporalLength" in the aggregation registry. Serializes through the existing
TemporalAggregationSerde wire shape with the type tag overridden.

Physical: nes-physical-operators/{include,src}/Aggregation/Function/Meos/TemporalLengthAggregationPhysicalFunction.{hpp,cpp}
identical lift / combine / reset / cleanup to TemporalSequenceAggregationPhysicalFunction;
the lower() path builds the same MEOS instant-set trajectory string, parses it via
MEOSWrapper::parseTemporalPoint, and calls MEOS' tpoint_length(Temporal*) to return a single
FLOAT64 result.

Parser: nes-sql-parser/AntlrSQL.g4 adds the TEMPORAL_LENGTH lexer token and includes it in
functionName. AntlrSQLQueryPlanCreator.cpp adds the TEMPORAL_LENGTH dispatch in both the
case-label and string-name paths, parallel to TEMPORAL_SEQUENCE.

Lowering: nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp
adds the TEMPORAL_LENGTH special-case lowering, parallel to TEMPORAL_SEQUENCE, producing a
TemporalLengthAggregationPhysicalFunction with the same (lon, lat, timestamp) state schema.

YAMLs: Queries/berlinmod/q6_{continuous,windowed,snapshot}.yaml updated to call
TEMPORAL_LENGTH directly; the FLOAT64 output column replaces the VARSIZED trajectory output;
header comments updated to "FULL".

Docs: docs/berlinmod-streaming-forms.md updated to reflect 21 cells full + 6 cells partial
(Q5 + Q9 only); the path-to-full table now lists those two queries only.

YAML safe_load green on all 3 Q6 cells. Build verification gated on the user's NebulaStream
test harness (vcpkg-bootstrapped); the C++ code follows the established TemporalSequence
template exactly, with the lower() path replaced by tpoint_length.
…streaming-form cells to full

Mirrors the TEMPORAL_LENGTH pattern from the parent PR with two new
four-field aggregations that close the last 6 partial cells on the
MobilityNebula BerlinMOD parity matrix:

PAIR_MEETING(lon, lat, ts, vehicle_id) -> VARSIZED
  Lift collects per-event tuples. Lower picks each vehicle's latest known
  position in the window, enumerates pairs (a < b), calls MEOS' geog_dwithin
  with dMeet = 200 m hardcoded for the BerlinMOD scaffold, and emits a
  string-encoded list of meeting pairs (vid_a, vid_b, ts, "<=dMeet" tag).
  Future PR can parameterize dMeet via a constant input. Closes Q5 × 3 cells.

CROSS_DISTANCE(lon, lat, ts, vehicle_id) -> FLOAT64
  Same lift shape. Lower picks the latest known position of each of the two
  target vehicles (VID_A = 100, VID_B = 200 hardcoded), drives the MEOS
  nad_tgeo_tgeo distance, and returns a FLOAT64 (NaN if either vehicle is
  unobserved). Future PR can parameterize (VID_A, VID_B). Closes Q9 × 3 cells.

Wired across the four pipeline layers identically to TEMPORAL_LENGTH:
  - nes-physical-operators/{include,src}/Aggregation/Function/Meos/{PairMeeting,CrossDistance}AggregationPhysicalFunction.{hpp,cpp}
  - nes-logical-operators/{include,src}/Operators/Windows/Aggregations/Meos/{PairMeeting,CrossDistance}AggregationLogicalFunction.{hpp,cpp}
  - nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt + nes-logical-operators/src/Operators/Windows/Aggregations/Meos/CMakeLists.txt plugin entries
  - nes-sql-parser/AntlrSQL.g4 lexer + functionName tokens
  - nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp case-label + string-name dispatch
  - nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp special-case lowering with 4-field state schema

YAMLs: Queries/berlinmod/q5_{continuous,windowed,snapshot}.yaml and
q9_{continuous,windowed,snapshot}.yaml rewritten to call the new
aggregations directly; sink schemas updated to FLOAT64 / VARSIZED;
header comments updated to FULL.

Docs: docs/berlinmod-streaming-forms.md updated to reflect 27/27 cells
full (was 21 full + 6 partial); MEOS-operators table now lists
PAIR_MEETING and CROSS_DISTANCE alongside the existing ones.

YAML safe_load green on all 6 rewritten Q5/Q9 cells. C++ follows the
established TemporalLength template from the parent MobilityDB#16; build
verification gated on the user's NebulaStream test harness.
… covered' section

After PR MobilityDB#16 (TEMPORAL_LENGTH closes Q6) and PR MobilityDB#17 (PAIR_MEETING +
CROSS_DISTANCE close Q5 + Q9), the parity matrix is 27/27 full —
the doc's own coverage table at the top confirms it. But the
section 'Not covered (15 cells / 5 queries)' at line 77 was a
remnant from the pre-MobilityDB#16/MobilityDB#17 state and contradicts the rest of the
doc. Remove it.

Add a new 'Streaming-semantics tier overlay' section that classifies
each BerlinMOD-Q by its streaming-execution tier (stateless /
bounded-state / windowed / cross-stream) per the closed 7-value
vocabulary proposed for the MEOS-API objectModel.streamingSemantics
facet (see the sibling RFC on MEOS-API PR MobilityDB#10). The mapping makes
the cross-binding picture explicit: a Q's tier on NebulaStream is
the same tier on Flink / Kafka, and the table points to the
equivalent generic wiring class on Flink for each tier.

Two short follow-up notes explain why cross-stream looks different
on NebulaStream (single-aggregation Cartesian enumeration vs Flink's
interval-join across two streams — same semantic, different
topology) and why Q7 is bounded-state rather than windowed (per-POI
fan-out, per-(vehicle, POI) bounded state, no full-sequence
reduction needed).

Refresh the 'Sibling parity references' section to point at the
current state of the Flink and Kafka work — Flink's per-tier wiring
infrastructure under org.mobilitydb.flink.meos.wirings (5 generic
classes covering 100% of the streamable surface) and Kafka's codegen
mirror under org.mobilitydb.kafka.meos. Drops stale PR-number
references per the same as-is / no-internal-process discipline
applied elsewhere in the ecosystem docs.

Stacks on PR MobilityDB#17. Docs-only; touches no YAML, no C++ pipeline-layer
file.
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