Skip to content

feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TFLOAT_TFLOAT NES operators (W67)#96

Open
estebanzimanyi wants to merge 25 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/nebula-codegen-w67-ever-tfloat-tfloat
Open

feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TFLOAT_TFLOAT NES operators (W67)#96
estebanzimanyi wants to merge 25 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/nebula-codegen-w67-ever-tfloat-tfloat

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Adds 6 per-event NES scalar operators EVER_EQ_TFLOAT_TFLOAT, EVER_GE_TFLOAT_TFLOAT, EVER_GT_TFLOAT_TFLOAT, EVER_LE_TFLOAT_TFLOAT, EVER_LT_TFLOAT_TFLOAT, EVER_NE_TFLOAT_TFLOAT backed by the MEOS ever_eq/ge/gt/le/lt/ne_tfloat_tfloat kernels. Each 3-arg operator takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), builds two single-instant tfloats, and returns FLOAT64 1.0/0.0. Wired across logical/physical CMakeLists, AntlrSQL.g4 functionName rule and lexer section, and AntlrSQLQueryPlanCreator.cpp.

…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.
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